encryption

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// algorithm - Ex. AES, (T)DES
	AES = "AES"
	// operation(op) mode - Ex. CTR, CBC, CFB, GCM, OFB
	CTR = "CTR"
)

Variables

View Source
var DefaultAlgo = AES
View Source
var DefaultKeyLen = 192
View Source
var DefaultOpMode = CTR
View Source
var ErrAlgorithmNotSupported = errors.New("entered algorithm is not supported")
View Source
var ErrKeyLengthNotSupported = errors.New("entered key length is not supported")
View Source
var ErrOperationModeNotSupported = errors.New("entered operation mode is not supported")

Functions

func DecryptKey

func DecryptKey(encryptedKey, key []byte, opts *Opts) ([]byte, error)

func EncryptKey

func EncryptKey(pri heimdall.Key, key []byte, opts *Opts) (encryptedKey []byte, err error)

Types

type Opts

type Opts struct {
	Algorithm string
	KeyLen    int
	OpMode    string
}

func NewOpts

func NewOpts(algorithm string, keyLen int, opMode string) (encOpt *Opts, err error)

func (*Opts) ToString

func (opt *Opts) ToString() string

ToString returns string format of encryption algorithm with key length (ex. AES128)

Jump to

Keyboard shortcuts

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