crypt

package
v0.44.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KeySaltBytes   = 8
	KeySizeBytes   = 32
	NonceSizeBytes = 24
)

Variables

View Source
var (
	ErrFailDecrypt = errors.New("could not decrypt value")
)

Functions

This section is empty.

Types

type NaclSecretStore

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

func NewSecretStore

func NewSecretStore(secret []byte) *NaclSecretStore

func (*NaclSecretStore) Decrypt

func (a *NaclSecretStore) Decrypt(encrypted []byte) ([]byte, error)

func (*NaclSecretStore) Encrypt

func (a *NaclSecretStore) Encrypt(data []byte) ([]byte, error)

func (*NaclSecretStore) SharedSecret

func (a *NaclSecretStore) SharedSecret() []byte

type SecretStore

type SecretStore interface {
	SharedSecret() []byte
	Encrypt(data []byte) ([]byte, error)
	Decrypt(encrypted []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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