Versions in this module Expand all Collapse all v0 v0.1.1 Mar 23, 2026 v0.1.0 Mar 23, 2026 Changes in this version + const Argon2idIterations + const Argon2idKeyLength + const Argon2idMemory + const Argon2idParallelism + const Argon2idSaltLength + const KeySize + const NonceSize + var ErrDecryptionFailed = errors.New("decryption failed") + var ErrInvalidCiphertext = errors.New("ciphertext too short") + var ErrInvalidKey = errors.New("invalid key") + var ErrInvalidKeySize = errors.New("key must be 32 bytes for AES-256") + var ErrInvalidNonce = errors.New("invalid nonce") + var ErrKeyNotFound = errors.New("key not found") + type AESGCM struct + func NewAESGCM() *AESGCM + func (a *AESGCM) Decrypt(ciphertext []byte, key []byte) ([]byte, error) + func (a *AESGCM) Encrypt(plaintext []byte, key []byte) ([]byte, error) + func (a *AESGCM) GenerateNonce() ([]byte, error) + type Argon2idDeriver struct + func NewArgon2idDeriver() *Argon2idDeriver + func (d *Argon2idDeriver) DeriveKey(password, salt []byte) []byte + func (d *Argon2idDeriver) GenerateSalt() ([]byte, error) + func (d *Argon2idDeriver) GetKeyLength() uint32 + func (d *Argon2idDeriver) GetSaltLength() int + func (d *Argon2idDeriver) Verify(password []byte, key []byte) bool + func (d *Argon2idDeriver) VerifyWithSalt(password, salt, expectedKey []byte) bool + type Cipher interface + Decrypt func(ciphertext []byte, key []byte) ([]byte, error) + Encrypt func(plaintext []byte, key []byte) ([]byte, error) + GenerateNonce func() ([]byte, error) + type KeyDerivationFunc interface + DeriveKey func(password, salt []byte) []byte + GenerateSalt func() ([]byte, error) + Verify func(password []byte, key []byte) bool