Documentation ¶
Overview ¶
Package wrapper contains built-in implementations of the 'c2.Wrapper' interface, which can be used to wrap or encode data that is passed between Sessions and C2 Servers.
Index ¶
Constants ¶
const ( // Zlib is the default Zlib Wrapper. This wrapper uses the default compression level. Use the 'NewZlib' // function to create a wrapper with a different level. Zlib = compress(0x0) // Gzip is the default Gzip Wrapper. This wrapper uses the default compression level. Use the 'NewGzip' // function to create a wrapper with a different level. Gzip = compress(0x1) )
const ( // Hex is the Hex encoding Wrapper. This wraps the binary data as hex values. Hex = simple(0x1) // Base64 is the Base64 Wrapper. This wraps the binary data as a Base64 byte string. This may be // combined with the Base64 transform. Base64 = simple(0x2) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block is the cipher.Block implementation of a Wrapper. This instance will create a Block based Wrapper with ciphers such as AES.
func (Block) Wrap ¶
func (b Block) Wrap(w io.WriteCloser) (io.WriteCloser, error)
Wrap fulfils the Wrapper interface.
type CBK ¶ added in v0.4.4
type CBK [5]byte
CBK is the crypto.CBK implementation of a Wrapper. This instance will create a new CBK instance with these supplied values and size.
func NewCBK ¶ added in v0.1.0
NewCBK creates a special type of Wrapper for CBK-based encryptors.
NOTE: This function will prevent CBK from using its index based block functions, not sure if there's a way to work around this.
func (CBK) Wrap ¶ added in v0.4.4
func (c CBK) Wrap(w io.WriteCloser) (io.WriteCloser, error)
Wrap fulfils the Wrapper interface.
type XOR ¶ added in v0.4.4
type XOR struct {
// contains filtered or unexported fields
}
XOR is the crypto.XOR implementation of a Wrapper. This instance will create a XOR key stream with IV based on the supplied values.
func NewXOR ¶ added in v0.1.0
NewXOR is a function that is an alias for 'Stream(crypto.XOR(k), crypto.XOR(k))'
This wil return a Stream-backed XOR Wrapper.
func (XOR) Wrap ¶ added in v0.4.4
func (x XOR) Wrap(w io.WriteCloser) (io.WriteCloser, error)
Wrap fulfils the Wrapper interface.