encryption

package
v0.12.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AESEncryptor

type AESEncryptor struct{}

AESEncryptor implements AES encryption/decryption

func NewAESEncryptor

func NewAESEncryptor() *AESEncryptor

func (*AESEncryptor) Decrypt

func (e *AESEncryptor) Decrypt(key []byte, data []byte) ([]byte, error)

Decrypt decrypts data using AES-GCM

func (*AESEncryptor) Encrypt

func (e *AESEncryptor) Encrypt(key []byte, data []byte) ([]byte, error)

Encrypt encrypts data using AES-GCM with a random nonce

func (*AESEncryptor) Name added in v0.8.0

func (e *AESEncryptor) Name() string

type Cipher

type Cipher interface {
	Name() string
	Encrypt(key, data []byte) ([]byte, error)
	Decrypt(key, encryptedData []byte) ([]byte, error)
}

Interface for decoupling the message encryption and decryption

Jump to

Keyboard shortcuts

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