encrypt

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aesgcm

type Aesgcm struct {
	Compat bool
	// contains filtered or unexported fields
}

Aesgcm provides an encryper that uses the aesgcm encryption alogirthm.

func (*Aesgcm) Decrypt

func (e *Aesgcm) Decrypt(ciphertext []byte) (string, error)

Decrypt decrypts the ciphertext using aesgcm.

func (*Aesgcm) Encrypt

func (e *Aesgcm) Encrypt(plaintext string) ([]byte, error)

Encrypt encrypts the plaintext using aesgcm.

type Encrypter

type Encrypter interface {
	Encrypt(plaintext string) ([]byte, error)
	Decrypt(ciphertext []byte) (string, error)
}

Encrypter provides database field encryption and decryption. Encrypted values are currently limited to strings, which is reflected in the interface design.

func New

func New(key string) (Encrypter, error)

New provides a new database field encrypter.

Jump to

Keyboard shortcuts

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