Documentation
¶
Overview ¶
Package aesgcm offers minimalistic AES-256-GCM authenticated encryption with constant-memory, goroutine-safe primitives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrKeyInvalid indicates that the encryption key is invalid or improperly formatted. ErrKeyInvalid = errors.New("aesgcm: invalid key") // ErrEncrypt indicates that the encryption process failed. ErrEncrypt = errors.New("aesgcm: encryption failed") // ErrDecrypt indicates that the decryption process failed. ErrDecrypt = errors.New("aesgcm: decryption failed") )
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
type Cipher interface {
// Encrypt takes a plaintext string and returns the encrypted data as a byte slice.
Encrypt(plain string) ([]byte, error)
// Decrypt takes a byte slice produced by Encrypt and returns the original plaintext string.
Decrypt(raw []byte) (string, error)
}
Cipher defines the interface for high-level AES-256-GCM encryption and decryption.
Click to show internal directories.
Click to hide internal directories.