Documentation ¶
Index ¶
- Constants
- Variables
- func EnclessDecode(authKey *[32]byte, nonce, in []byte) ([]byte, error)
- func EnclessEncode(authKey *[32]byte, nonce, in []byte) ([]byte, error)
- func GetKey(k string, kenLen int) []byte
- func SliceZero(data []byte)
- type AESBlockCrypt
- type BlockConfig
- type BlockCrypt
- type Cipher
- type NoneBlockCrypt
- type Salsa20BlockCrypt
Constants ¶
const ( NONE = Cipher("None") SALSA20 = Cipher("salsa20") AES256CFB = Cipher("aes256cfb") AES128CFB = Cipher("aes128cfb") SALT = "i'm salt" )
const (
EnclessEnlargeSize = aont.AontHashSize + aont.AontKeySize*cnw.EnlargeFactor
)
Variables ¶
var (
Rand io.Reader = rand.Reader
)
Functions ¶
func EnclessDecode ¶
Decode EnclessEncode-ed data.
func EnclessEncode ¶
Confidentiality preserving (but encryptionless) encoding.
It uses Chaffing-and-Winnowing technology (it is neither encryption nor steganography) over All-Or-Nothing-Transformed data. nonce is 64-bit nonce. Output data will be EnclessEnlargeSize larger. It also consumes 64-bits of entropy.
Types ¶
type AESBlockCrypt ¶
type AESBlockCrypt struct {
// contains filtered or unexported fields
}
AESBlockCrypt implements BlockCrypt
func (*AESBlockCrypt) Decrypt ¶
func (c *AESBlockCrypt) Decrypt(dst, src []byte)
Decrypt implements Decrypt interface
func (*AESBlockCrypt) Encrypt ¶
func (c *AESBlockCrypt) Encrypt(dst, src []byte)
Encrypt implements Encrypt interface
type BlockConfig ¶
type BlockCrypt ¶
type BlockCrypt interface { // Encrypt encrypts the whole block in src into dst. // Dst and src may point at the same memory. Encrypt(dst, src []byte) // Decrypt decrypts the whole block in src into dst. // Dst and src may point at the same memory. Decrypt(dst, src []byte) }
BlockCrypt defines encryption/decryption methods for a given byte slice
func NewAESBlockCrypt ¶
func NewAESBlockCrypt(key []byte) (BlockCrypt, error)
NewAESBlockCrypt initates BlockCrypt by the given key
func NewBlock ¶
func NewBlock(config *BlockConfig) (BlockCrypt, error)
func NewNoneBlockCrypt ¶
func NewNoneBlockCrypt(key []byte) (BlockCrypt, error)
NewNoneBlockCrypt initate by the given key
func NewSalsa20BlockCrypt ¶
func NewSalsa20BlockCrypt(key []byte) (BlockCrypt, error)
NewSalsa20BlockCrypt initates BlockCrypt by the given key
type NoneBlockCrypt ¶
type NoneBlockCrypt struct {
// contains filtered or unexported fields
}
NoneBlockCrypt simple returns the plaintext
func (*NoneBlockCrypt) Decrypt ¶
func (c *NoneBlockCrypt) Decrypt(dst, src []byte)
Decrypt implements Decrypt interface
func (*NoneBlockCrypt) Encrypt ¶
func (c *NoneBlockCrypt) Encrypt(dst, src []byte)
Encrypt implements Encrypt interface
type Salsa20BlockCrypt ¶
type Salsa20BlockCrypt struct {
// contains filtered or unexported fields
}
Salsa20BlockCrypt implements BlockCrypt
func (*Salsa20BlockCrypt) Decrypt ¶
func (c *Salsa20BlockCrypt) Decrypt(dst, src []byte)
Decrypt implements Decrypt interface
func (*Salsa20BlockCrypt) Encrypt ¶
func (c *Salsa20BlockCrypt) Encrypt(dst, src []byte)
Encrypt implements Encrypt interface