Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
Decrypt decrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Expects input form nonce|ciphertext|tag where '|' indicates concatenation.
Types ¶
type Key ¶
type Key [32]byte
Key ...
func NewEncryptionKey ¶
NewEncryptionKey generates a random 256-bit key for Encrypt() and Decrypt(). If text is nil or empty, creates a random key. It panics if the source of randomness fails. If text is not nil and not empty, and the length of text is lower than 32, the key is completed with spaces. If text is not nil and not empty, and the length of text us greater than 32, the 32 first bytes are used as key.
Click to show internal directories.
Click to hide internal directories.