Documentation
¶
Overview ¶
Package aes provides AES-GCM encryption and decryption functionality with base64 encoding. It supports 128, 192, and 256-bit keys and uses authenticated encryption for security.
Example usage:
// Generate a key
key, err := aes.GenerateAESKey(256)
if err != nil {
log.Fatal(err)
}
// Encrypt data
ciphertext, err := aes.Encrypt(key, "secret message")
if err != nil {
log.Fatal(err)
}
// Decrypt data
plaintext, err := aes.Decrypt(key, ciphertext)
if err != nil {
log.Fatal(err)
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encrypt ¶
Encrypt encrypts the plaintext using AES-GCM and returns a base64-encoded ciphertext.
func GenerateAESKey ¶
GenerateAESKey creates a base64-encoded AES key. Valid bit lengths: 128, 192, or 256.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.