encryption

package
v6.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDataIsEncrypted = errors.New("failed to decrypt data that is encrypted")
View Source
var ErrDataIsNotEncrypted = errors.New("failed to decrypt data that is not encrypted")

Functions

This section is empty.

Types

type Key

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

func NewKey

func NewKey(a cipher.AEAD) *Key

func (Key) Decrypt

func (e Key) Decrypt(text string, n *string) ([]byte, error)

func (Key) Encrypt

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

type NoEncryption

type NoEncryption struct{}

func NewNoEncryption

func NewNoEncryption() *NoEncryption

func (NoEncryption) Decrypt

func (n NoEncryption) Decrypt(text string, nonce *string) ([]byte, error)

func (NoEncryption) Encrypt

func (n NoEncryption) Encrypt(plaintext []byte) (string, *string, error)

type Strategy

type Strategy interface {
	Encrypt([]byte) (string, *string, error)
	Decrypt(string, *string) ([]byte, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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