Versions in this module Expand all Collapse all v0 v0.0.2 Apr 7, 2026 Changes in this version + type AES256GCMCipher struct + func NewAES256GCMCipher(key []byte) (*AES256GCMCipher, error) + func (c *AES256GCMCipher) Decrypt(ciphertext []byte) ([]byte, error) + func (c *AES256GCMCipher) Encrypt(plaintext []byte) ([]byte, error) + func (c *AES256GCMCipher) KeySize() int type Cipher + KeySize func() int + type PBKDF2SHA256KDF struct + Iterations int + func DefaultPBKDF2KDF() *PBKDF2SHA256KDF + func (p *PBKDF2SHA256KDF) DeriveKey(password, salt []byte, keyLen int) ([]byte, error) type XChacha20Cipher + func (c *XChacha20Cipher) KeySize() int v0.0.1 Apr 2, 2026 Changes in this version + var ErrDecrypt = errors.New("decryption failed") + type Argon2KDF struct + Memory uint32 + Parallelism uint8 + Time uint32 + func DefaultArgon2KDF() *Argon2KDF + func (a *Argon2KDF) DeriveKey(password, salt []byte, keyLen int) ([]byte, error) + type Cipher interface + Decrypt func(ciphertext []byte) ([]byte, error) + Encrypt func(plaintext []byte) ([]byte, error) + type KDF interface + DeriveKey func(password, salt []byte, keyLen int) ([]byte, error) + type ScryptKDF struct + N int + P int + R int + func DefaultScryptKDF() *ScryptKDF + func (s *ScryptKDF) DeriveKey(password, salt []byte, keyLen int) ([]byte, error) + type XChacha20Cipher struct + func NewCipher(secret string) (*XChacha20Cipher, error) + func NewCipherFromKey(key []byte) (*XChacha20Cipher, error) + func (c *XChacha20Cipher) Decrypt(ciphertext []byte) ([]byte, error) + func (c *XChacha20Cipher) Encrypt(plaintext []byte) ([]byte, error)