aes

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeySize   = 32
	NonceSize = 12
)

Variables

View Source
var (
	ErrEncrypt = errors.New("secret: encryption failed")
	ErrDecrypt = errors.New("secret: decryption failed")
)

Functions

func Decrypt

func Decrypt(key, message []byte) ([]byte, error)

Decrypt recovers a message secured using AES-GCM.

func Encrypt

func Encrypt(key, message []byte) ([]byte, error)

Encrypt secures a message using AES-GCM.

func GenerateKey

func GenerateKey() ([]byte, error)

GenerateKey generates a new AES-256 key.

func GenerateNonce

func GenerateNonce(size int) (nonce []byte, err error)

GenerateNonce generates a new AES-GCM nonce.

Types

This section is empty.

Jump to

Keyboard shortcuts

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