gencrypt

package module
v0.0.0-...-206b6c0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

README

gencrypt

GoDoc Build Status

Encrypt/Decrypt data using AES.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidData = errors.New("atedja/gencrypt: invalid data")

Functions

This section is empty.

Types

type AES

type AES struct {
	Secret []byte
	// contains filtered or unexported fields
}

func New

func New(secret []byte) (*AES, error)

Create a new AES encryption using a secret key. Secret key length has to be either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256. See golang crypto/aes for more information.

func (*AES) Decrypt

func (aes *AES) Decrypt(data []byte) ([]byte, error)

Decrypts encrypted data and return the decrypted bytes.

func (*AES) Encrypt

func (aes *AES) Encrypt(data []byte) ([]byte, error)

Encrypts data and returns the encrypted bytes.

Jump to

Keyboard shortcuts

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