Documentation ¶
Overview ¶
Package rotfile provides functions that securely encrypt and decrypt data in rotfiles.
For a description of the rotfile file format, see the "doc" directory in the repository.
Index ¶
Constants ¶
const (
KeySize = chacha20poly1305.KeySize
)
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
Decrypt is the inverse operation of Encrypt.
If message authentication failed (for example, because the key is incorrect, or because the input was tampered with after encryption), then IsMessageAuthenticationFailed(err) will return true.
func Encrypt ¶
Encrypt encrypts plaintext using the XChaCha20-Poly1305 AEAD. A nonce required for encryption is generated internally and is included in the returned bytes. The returned bytes can be provided to func Decrypt to retrieve the original plaintext.
The key length must equal KeySize.
func EncryptedLen ¶
EncryptedLen returns the expected length of the ciphertext (from func Encrypt) for a plaintext of the given length.
Types ¶
This section is empty.