Versions in this module Expand all Collapse all v0 v0.8.0 Feb 21, 2026 v0.7.0 Feb 19, 2026 Changes in this version + const KeySize + const NonceSize + const PBKDF2Iterations + const SaltSize + var ErrDecryptionFailed = errors.New("encryption: decryption failed (wrong password or corrupted data)") + var ErrEmptyCiphertext = errors.New("encryption: ciphertext cannot be empty") + var ErrEmptyPassword = errors.New("encryption: password cannot be empty") + var ErrEmptyPlaintext = errors.New("encryption: plaintext cannot be empty") + var ErrEmptySalt = errors.New("encryption: salt cannot be empty") + var ErrInvalidKey = errors.New("encryption: key must be 32 bytes") + var ErrInvalidSaltSize = errors.New("encryption: salt must be 16 bytes") + var ErrMalformedData = errors.New("encryption: ciphertext too short to contain salt, nonce, and tag") + func Decrypt(ciphertext64, password string) ([]byte, error) + func DecryptWithKey(ciphertext64 string, key []byte) ([]byte, error) + func DeriveKey(password string, salt []byte) ([]byte, error) + func Encrypt(plaintext []byte, password string) (string, error) + func EncryptWithKey(plaintext, key, salt []byte) (string, error) + func GenerateSalt() ([]byte, error)