rfc3961

package
v0.0.0-...-fc028b1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Encryption and checksum methods as specified in RFC 3961

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DES3DecryptData

func DES3DecryptData(key, data []byte, e etype.EType) ([]byte, error)

func DES3DecryptMessage

func DES3DecryptMessage(key, ciphertext []byte, usage uint32, e etype.EType) ([]byte, error)

func DES3EncryptData

func DES3EncryptData(key, data []byte, e etype.EType) ([]byte, []byte, error)

func DES3EncryptMessage

func DES3EncryptMessage(key, message []byte, usage uint32, e etype.EType) ([]byte, []byte, error)

func DES3RandomToKey

func DES3RandomToKey(b []byte) []byte

func DES3StringToKey

func DES3StringToKey(secret, salt string, e etype.EType) ([]byte, error)

func DeriveKey

func DeriveKey(protocolKey, usage []byte, e etype.EType) ([]byte, error)

func DeriveRandom

func DeriveRandom(key, usage []byte, e etype.EType) ([]byte, error)

RFC 3961: DR(Key, Constant) = k-truncate(E(Key, Constant, initial-cipher-state)).

key: base key or protocol key. Likely to be a key from a keytab file.

usage: a constant.

n: block size in bits (not bytes) - note if you use something like aes.BlockSize this is in bytes.

k: key length / key seed length in bits. Eg. for AES256 this value is 256.

e: the encryption etype function to use.

func Nfold

func Nfold(m []byte, n int) []byte

RFC 3961: n-fold algorithm.

m input bytes that will be "stretched" to the least common multiple of n bits and the bit length of m.

func PseudoRandom

func PseudoRandom(key, b []byte, e etype.EType) ([]byte, error)

func RandomToKey

func RandomToKey(b []byte) []byte

func S2KparamsToItertions

func S2KparamsToItertions(s2kparams string) (int, error)

func StringToKey

func StringToKey(secret, salt, s2kparams string, e etype.EType) ([]byte, error)

func StringToKeyIter

func StringToKeyIter(secret, salt string, iterations int, e etype.EType) ([]byte, error)

func StringToPBKDF2

func StringToPBKDF2(secret, salt string, iterations int, e etype.EType) []byte

func VerifyIntegrity

func VerifyIntegrity(key, ct, pt []byte, usage uint32, etype etype.EType) bool

Verify the integrity of cipertext bytes ct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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