Documentation ¶
Overview ¶
Package gaes provides useful API for AES encryption/decryption algorithms.
Index ¶
- 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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptCBC ¶
AES解密, 使用CBC模式,注意key必须为16/24/32位长度,iv初始化向量为非必需参数
func DecryptCFB ¶
AES解密, 使用CFB模式。 注意key必须为16/24/32位长度,unpadding为去补位长度,iv初始化向量为非必需参数。
func EncryptCBC ¶
AES加密, 使用CBC模式,注意key必须为16/24/32位长度,iv初始化向量为非必需参数。
func EncryptCFB ¶
AES加密, 使用CFB模式。 注意key必须为16/24/32位长度,padding返回补位长度,iv初始化向量为非必需参数。
func PKCS5Padding ¶
func ZeroUnPadding ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.