aesgcm

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package AESGCM implement AES encryption with GCM authentication according to the paper at ref: https://eprint.iacr.org/2015/102.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AESGCM

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

AESGCM implements the Encrypt/Decrypt methods using AES-GCM: https://eprint.iacr.org/2015/102.pdf

func New

func New(key *[32]byte) (*AESGCM, error)

New makes a new AES/GCM Cryptor. In order to select AES-256, a 32-byte key is enforced.

ref: https://github.com/gtank/cryptopasta/blob/master/encrypt.go

func (*AESGCM) Decrypt

func (ag *AESGCM) Decrypt(cipherText []byte) (plainText []byte, err error)

Decrypt decrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Expects input form nonce|ciphertext|tag where '|' indicates concatenation.

func (*AESGCM) Encrypt

func (ag *AESGCM) Encrypt(plainText []byte) (cypherText []byte, err error)

Encrypt encrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Output takes the form nonce|ciphertext|tag where '|' indicates concatenation.

func (AESGCM) String

func (ag AESGCM) String(plainText []byte) string

Jump to

Keyboard shortcuts

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