Documentation
¶
Overview ¶
Package cipher provides symmetric encryption using XChaCha20-Poly1305. It is designed for encrypting sensitive data before storing in databases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCiphertextTooShort is returned when the ciphertext is shorter than the nonce size. ErrCiphertextTooShort = errors.New("cipher: ciphertext too short") )
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
Cipher wraps XChaCha20-Poly1305 AEAD for encryption and decryption.
func New ¶
New creates a new Cipher with the given key. The key must be exactly 32 bytes for XChaCha20-Poly1305.
Click to show internal directories.
Click to hide internal directories.