aeswrapper

package
v0.0.0-...-1b5cee2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKeyLength   = errors.New("invalid key length, must be longer then 32 bytes")
	ErrCipherFailure      = errors.New("cipher creation failure")
	ErrGCMFailure         = errors.New("gcm creation failure")
	ErrRandomNonceFailure = errors.New("random nonce creation failure")
	ErrOpenDataFailure    = errors.New("open data failure, cannot decrypt data")
)

Functions

This section is empty.

Types

type Helper

type Helper struct{}

Helper wraps eas encryption and decryption. Uses Galois Counter Mode (GCM) for encryption and decryption.

func New

func New() Helper

Creates a new Helper.

func (Helper) Decrypt

func (h Helper) Decrypt(key, data []byte) ([]byte, error)

Decrypt decrypts data with key. Key must be at least 32 bytes long.

func (Helper) Encrypt

func (h Helper) Encrypt(key, data []byte) ([]byte, error)

Encrypt encrypts data with key. Key must be at least 32 bytes long.

Jump to

Keyboard shortcuts

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