algorithms

package
v0.1.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAlgorithms

func GetAlgorithms() []string

GetAlgorithms returns a list of registered algorithms.

func GetDefaultAlgorithm

func GetDefaultAlgorithm() string

GetDefaultAlgorithm returns the default algorithm.

Types

type Algorithm

type Algorithm interface {
	Encrypt(key []byte, data []byte) ([]byte, error)
	Decrypt(key []byte, ciphertext []byte) ([]byte, error)
	Label() string
	NeedsKey() bool
}

Algorithm implementations encrypt and decrypt data.

func New

func New(algorithm string) (Algorithm, error)

New returns an Algorithm corresponding to the requested cipher.

Jump to

Keyboard shortcuts

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