encryption

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryptor

type Encryptor struct {
	Key string // encryption 256-bits key encoded in hexadecimal
	// contains filtered or unexported fields
}

Encryptor allows to encrypt/Decrypt any date with AES tools

func NewEncryptor

func NewEncryptor(key string) (*Encryptor, error)

NewEncryptor allows to instantiate a new encryptor with an existing key or a new one if no key is provided

func (*Encryptor) Decrypt

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

Decrypt allows to decrypt previously encrypted data We need to retrieve the nonce defined as the encrypted data prefix

func (*Encryptor) Encrypt

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

Encrypt allows to encrypt data with the encryptor GCM encrypted data is prefixed with the nonce

Jump to

Keyboard shortcuts

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