Documentation ¶
Index ¶
Constants ¶
View Source
const ( // KeySize is the size of the keys created by GenerateKey() KeySize = 32 // NonceSize is the size of the nonces created by GenerateNonce() NonceSize = 24 )
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
Decrypt extracts the nonce from the encrypted text, and attempts to decrypt with nacl.box.
func Encrypt ¶
Encrypt generates a random nonce and encrypts the input using nacl.secretbox package. We store the nonce in the first 24 bytes of the encrypted text.
func GenerateKey ¶
GenerateKey generates a new random secret key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.