Documentation
¶
Overview ¶
Package encryption provides encryption utilities for secure credential storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidKey indicates the encryption key is invalid (must be 32 bytes for AES-256) ErrInvalidKey = errors.New("encryption key must be 32 bytes") // ErrInvalidCiphertext indicates the ciphertext is too short or corrupted ErrInvalidCiphertext = errors.New("ciphertext too short") // ErrDecryptionFailed indicates decryption failed (wrong key or corrupted data) ErrDecryptionFailed = errors.New("decryption failed") )
Functions ¶
This section is empty.
Types ¶
type Encryptor ¶
type Encryptor struct {
// contains filtered or unexported fields
}
Encryptor provides AES-256-GCM encryption and decryption.
func NewEncryptor ¶
NewEncryptor creates a new Encryptor with the given 32-byte key.
func (*Encryptor) Decrypt ¶
Decrypt decrypts ciphertext that was encrypted with Encrypt. Expects the nonce to be prepended to the ciphertext.
func (*Encryptor) DecryptJSON ¶
DecryptJSON decrypts ciphertext and unmarshals the JSON result into v.
Click to show internal directories.
Click to hide internal directories.