aes

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissmatchedNonceSize = errors.New("missmatched nonce size")

Functions

This section is empty.

Types

type Encrypter

type Encrypter struct {
	// contains filtered or unexported fields
}

func NewEncrypter

func NewEncrypter(key []byte) (*Encrypter, error)

NewEncrypter creates a new AES encrypter with the provided key. Key should be 16, 24, or 32 bytes for AES-128, AES-192, or AES-256.

func (*Encrypter) Decrypt

func (e *Encrypter) Decrypt(value []byte) ([]byte, error)

Decrypt decrypts the ciphertext using AES-GCM. Expects nonce to be prepended to ciphertext.

func (*Encrypter) Encrypt

func (e *Encrypter) Encrypt(value []byte) ([]byte, error)

Encrypt encrypts the plaintext using AES-GCM. Returns ciphertext with nonce prepended.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL