Documentation
¶
Index ¶
Constants ¶
View Source
const (
SizeKey = 32
)
Variables ¶
View Source
var ( ErrVerifyKEy = errors.New("err verify key on standard aes") ErrBlockCipher = errors.New("err create 128-bit block cipher") ErrRandRead = errors.New("err rand read encrypt") ErrAuthCiphertext = errors.New("err open decrypts and authenticates ciphertext") ErrGenerateKey = errors.New("err generate key") )
Functions ¶
func Decrypt ¶
Decrypt authenticates and decrypts ciphertext using: - Same key used for encryption - Embedded nonce from ciphertext Returns plaintext or error if decryption/authentication fails
func Encrypt ¶
Encrypt securely encrypts plaintext using AES-GCM with: - Provided encryption key - Random nonce generation Returns ciphertext or error if encryption fails
func GenerateKey ¶
GenerateKey creates a cryptographically secure: - 256-bit (32-byte) random key - Suitable for AES-256 encryption Returns key or error if random generation fails
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.