Documentation ¶
Overview ¶
Package gdes provides useful API for DES encryption/decryption algorithms.
Index ¶
- func DecryptCBC(cipherText []byte, key []byte, iv []byte, padding DesPadding) ([]byte, error)
- func DecryptCBCTriple(cipherText []byte, key []byte, iv []byte, padding DesPadding) ([]byte, error)
- func DecryptECB(cipherText []byte, key []byte, padding DesPadding) ([]byte, error)
- func DecryptECBTriple(cipherText []byte, key []byte, padding DesPadding) ([]byte, error)
- func EncryptCBC(plainText []byte, key []byte, iv []byte, padding DesPadding) ([]byte, error)
- func EncryptCBCTriple(plainText []byte, key []byte, iv []byte, padding DesPadding) ([]byte, error)
- func EncryptECB(plainText []byte, key []byte, padding DesPadding) ([]byte, error)
- func EncryptECBTriple(plainText []byte, key []byte, padding DesPadding) ([]byte, error)
- func Padding(text []byte, padding DesPadding) ([]byte, error)
- func PaddingPKCS5(text []byte, blockSize int) []byte
- func UnPadding(text []byte, padding DesPadding) ([]byte, error)
- func UnPaddingPKCS5(text []byte) []byte
- type DesPadding
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptCBC ¶
DecryptCBC decrypts <cipherText> using CBC mode.
func DecryptCBCTriple ¶
DecryptCBCTriple decrypts <cipherText> using TripleDES and CBC mode.
func DecryptECB ¶
func DecryptECB(cipherText []byte, key []byte, padding DesPadding) ([]byte, error)
DecryptECB decrypts <cipherText> using ECB mode.
func DecryptECBTriple ¶
func DecryptECBTriple(cipherText []byte, key []byte, padding DesPadding) ([]byte, error)
DecryptECBTriple decrypts <cipherText> using TripleDES and ECB mode. The length of the <key> should be either 16 or 24 bytes.
func EncryptCBC ¶
EncryptCBC encrypts <plainText> using CBC mode.
func EncryptCBCTriple ¶
EncryptCBCTriple encrypts <plainText> using TripleDES and CBC mode.
func EncryptECB ¶
func EncryptECB(plainText []byte, key []byte, padding DesPadding) ([]byte, error)
EncryptECB encrypts <plainText> using ECB mode.
func EncryptECBTriple ¶
func EncryptECBTriple(plainText []byte, key []byte, padding DesPadding) ([]byte, error)
EncryptECBTriple encrypts <plainText> using TripleDES and ECB mode. The length of the <key> should be either 16 or 24 bytes.
func PaddingPKCS5 ¶
func UnPaddingPKCS5 ¶
Types ¶
type DesPadding ¶ added in v1.0.2
type DesPadding int
const ( NOPADDING DesPadding = iota PKCS5PADDING )