Documentation
¶
Overview ¶
Package lcrypt provides crypto operations for lyra
Package lcrypt provides crypto operations for lyra
Index ¶
Constants ¶
const Iterations uint32 = 4
Iterations uint32 number of times argon2 is to be run with args
const KeyLen uint32 = 32
KeyLen uint32 the size of the key to be generated
const Memory uint32 = 64 * 1024
Memory uint32 size of memory cost
const NonceSize = 12
NonceSize defines size of nonce in bytes, NIST specifies for GCM, a nonce size of 12 bytes or 96 bits.
const SaltSize uint16 = 16
SaltSize uint8 is the salt length
const Threads uint8 = 4
Threads uint8 the number of threads to be adjusted
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
AesDecrypt decrypts and authenticates a ciphertxt, all values must be decoded into raw values and can not be in string hex representation.
func AesEncrypt ¶
AesEncrypt encrypts and authenticates a plaintext via the AES encryption scheme in GCM, all values must be in decoded into raw values and can not be in string representation.
func GenKey ¶
GenKey generates a cipher key from pass. Key is generated via argon2id with parameters specified via Iterations, Memory, Threads and KeyLen
Types ¶
type KeyManager ¶
type KeyManager interface { //DestroyKey safely destroys a key that has been stored in memory. DestroyKey() error //GetKey gets a key GetKey() []byte // contains filtered or unexported methods }
KeyManager implements encryption Key management
type LKey ¶
type LKey struct {
// contains filtered or unexported fields
}
LKey represents an immutable encryption key. This key is protected from unintended swap, buffer overflows and underflows. However the most important is that it can be securely destroyed.
func NewLKey ¶
NewLKey returns a new encryption key init to passphrase and salt, if no salt is specified, a new salt will be generated for the new key.
func (*LKey) DestroyKey ¶
DestroyKey safely destroy the encryption from memory,