Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crypto ¶
type Crypto struct {
HashSecretKey string
EncryptSecretKey string
Logger libLog.Logger
Cipher cipher.AEAD
}
func (*Crypto) Decrypt ¶
Decrypt a base64 encoded encrypted plaintext. The encrypted plain text must be prefixed with the random nonce used for encryption.
func (*Crypto) Encrypt ¶
Encrypt a plaintext using AES-GCM, which requires a private 32 bytes key and a random 12 bytes nonce. It generates a base64 string with the encoded ciphertext.
func (*Crypto) GenerateHash ¶
GenerateHash using HMAC-SHA256
func (*Crypto) InitializeCipher ¶
InitializeCipher loads an AES-GCM block cipher for encryption/decryption
Click to show internal directories.
Click to hide internal directories.