Documentation ¶
Overview ¶
Package gaes provides useful API for AES encryption/decryption algorithms.
Index ¶
- Constants
- func Decrypt(cipherText []byte, key []byte, iv ...[]byte) ([]byte, error)
- func DecryptCBC(cipherText []byte, key []byte, iv ...[]byte) ([]byte, error)
- func DecryptCFB(cipherText []byte, key []byte, unPadding int, iv ...[]byte) ([]byte, error)
- func Encrypt(plainText []byte, key []byte, iv ...[]byte) ([]byte, error)
- func EncryptCBC(plainText []byte, key []byte, iv ...[]byte) ([]byte, error)
- func EncryptCFB(plainText []byte, key []byte, padding *int, iv ...[]byte) ([]byte, error)
- func PKCS5Padding(src []byte, blockSize int) []byte
- func PKCS5UnPadding(src []byte, blockSize int) ([]byte, error)
- func ZeroPadding(cipherText []byte, blockSize int) ([]byte, int)
- func ZeroUnPadding(plaintext []byte, unPadding int) []byte
Constants ¶
const (
// IVDefaultValue is the default value for IV.
IVDefaultValue = "I Love Go Frame!"
)
Variables ¶
This section is empty.
Functions ¶
func DecryptCBC ¶
DecryptCBC decrypts `cipherText` using CBC mode. Note that the key must be 16/24/32 bit length. The parameter `iv` initialization vector is unnecessary.
func DecryptCFB ¶
DecryptCFB decrypts `plainText` using CFB mode. Note that the key must be 16/24/32 bit length. The parameter `iv` initialization vector is unnecessary.
func EncryptCBC ¶
EncryptCBC encrypts `plainText` using CBC mode. Note that the key must be 16/24/32 bit length. The parameter `iv` initialization vector is unnecessary.
func EncryptCFB ¶
EncryptCFB encrypts `plainText` using CFB mode. Note that the key must be 16/24/32 bit length. The parameter `iv` initialization vector is unnecessary.
func PKCS5Padding ¶
func ZeroUnPadding ¶
Types ¶
This section is empty.