website/pkg/encryption/keygen/keygen.go
2023-09-18 17:22:50 -07:00

12 lines
277 B
Go

// Package keygen provides the AES key initializer function.
package keygen
import "crypto/rand"
// NewAESKey returns a 32-byte (AES 256 bit) encryption key.
func NewAESKey() ([]byte, error) {
var result = make([]byte, 32)
_, err := rand.Read(result)
return result, err
}