wrapper

package
v0.3.2-b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package wrapper is a simple container package for c2 Wrapper types.

Index

Constants

View Source
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)
)
View Source
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 transfrom.
	Base64 = simple(0x2)
)

Variables

This section is empty.

Functions

func Block

func Block(b cipher.Block, v []byte) (c2.Wrapper, error)

Block returns a Wrapper based on a Block Cipher, such as AES.

func NewCBK added in v0.1.0

func NewCBK(a, b, c, d, size byte) c2.Wrapper

NewCBK creates a special type of Wrapper for CBK-based encryptors.

NOTE: This function will prevent CBK from using it's index based block functions, not sure if there's a way to work around this.

func NewXOR added in v0.1.0

func NewXOR(k []byte) c2.Wrapper

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 Stream

func Stream(r crypto.Reader, w crypto.Writer) c2.Wrapper

Stream returns a Wrapper based on the crypto.Writer and crypto.Reader interfaces, such as XOR.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL