Documentation ¶
Index ¶
- Variables
- func DecryptDes(data []byte, key []byte) ([]byte, error)
- func DecryptTripleDes(data []byte, key []byte) ([]byte, error)
- func DecryptTripleDesEde2(key []byte, data []byte, paddingType PaddingType) ([]byte, error)
- func EncryptDes(data []byte, key []byte) ([]byte, error)
- func EncryptDesCbc(data []byte, key []byte) ([]byte, error)
- func EncryptTripleDes(data []byte, key []byte) ([]byte, error)
- func EncryptTripleDesEde2(key []byte, data []byte, paddingType PaddingType) ([]byte, error)
- func GenerateDesKey(keyLen int) ([]byte, error)
- func RotN(n int, val string) string
- type DesMode
- type PaddingType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidKeyLength = errors.New("invalid key length")
View Source
var ZeroIv []byte = []byte{0, 0, 0, 0, 0, 0, 0, 0}
Functions ¶
func DecryptTripleDesEde2 ¶
func DecryptTripleDesEde2(key []byte, data []byte, paddingType PaddingType) ([]byte, error)
func EncryptTripleDesEde2 ¶
func EncryptTripleDesEde2(key []byte, data []byte, paddingType PaddingType) ([]byte, error)
func GenerateDesKey ¶
Generates a DES key, keyLen should be specified in multiple of 8
Types ¶
type PaddingType ¶
type PaddingType int
PaddingType identifies the padding type used when MAC'ing
const ( // Iso9797M1Padding Iso9797M1Padding PaddingType = iota + 1 // Iso9797M2Padding Iso9797M2Padding // DesBlockSize DesBlockSize = 8 )
func (PaddingType) Pad ¶
func (paddingType PaddingType) Pad(data []byte) []byte
func (PaddingType) RemovePad ¶
func (paddingType PaddingType) RemovePad(paddedData []byte) []byte
Source Files ¶
Click to show internal directories.
Click to hide internal directories.