Versions in this module Expand all Collapse all v0 v0.1.0 May 31, 2026 Changes in this version type Vault + func (v *Vault) Key() []byte v0.0.1 May 31, 2026 Changes in this version + var DefaultArgon2id = Argon2idParams + var ErrDecrypt = errors.New("secretbox: decryption failed") + var ErrLocked = errors.New("secretbox: vault is locked") + var ErrNotInitialized = errors.New("secretbox: vault not initialized") + var ErrUnsupported = errors.New("secretbox: unsupported algorithm") + var ErrWrongPassword = errors.New("secretbox: incorrect password") + func Seal(plaintext []byte, password string) ([]byte, error) + func SealWith(plaintext []byte, password string, kdf KDF, c Cipher) ([]byte, error) + func Unseal(blob []byte, password string) ([]byte, error) + type AESGCM struct + func (AESGCM) Decrypt(ciphertext, key []byte) ([]byte, error) + func (AESGCM) Encrypt(plaintext, key []byte) ([]byte, error) + func (AESGCM) ID() string + func (AESGCM) KeySize() int + type Argon2id struct + func NewArgon2id(p Argon2idParams) Argon2id + func (Argon2id) ID() string + func (a Argon2id) DeriveKey(password string, salt []byte, keyLen uint32) []byte + func (a Argon2id) Params() map[string]uint32 + type Argon2idParams struct + Memory uint32 + Threads uint8 + Time uint32 + type ChaCha20Poly1305 struct + func (ChaCha20Poly1305) Decrypt(ciphertext, key []byte) ([]byte, error) + func (ChaCha20Poly1305) Encrypt(plaintext, key []byte) ([]byte, error) + func (ChaCha20Poly1305) ID() string + func (ChaCha20Poly1305) KeySize() int + type Cipher interface + Decrypt func(ciphertext, key []byte) ([]byte, error) + Encrypt func(plaintext, key []byte) ([]byte, error) + ID func() string + KeySize func() int + type KDF interface + DeriveKey func(password string, salt []byte, keyLen uint32) []byte + ID func() string + Params func() map[string]uint32 + type Meta struct + Cipher string + KDF string + Params map[string]uint32 + Salt string + Sentinel string + Version int + type Option func(*Vault) + func WithCipher(c Cipher) Option + func WithKDF(kdf KDF) Option + type Vault struct + func NewVault(metaPath string, opts ...Option) *Vault + func (v *Vault) ChangePassword(newPassword string) error + func (v *Vault) Decrypt(ciphertext []byte) ([]byte, error) + func (v *Vault) Encrypt(plaintext []byte) ([]byte, error) + func (v *Vault) Init(password string) error + func (v *Vault) Initialized() bool + func (v *Vault) Lock() + func (v *Vault) Locked() bool + func (v *Vault) ReadFile(path string) ([]byte, error) + func (v *Vault) Rekey(newPassword string, files []string) error + func (v *Vault) Unlock(password string) error + func (v *Vault) WriteFile(path string, data []byte, perm os.FileMode) error