Documentation ¶
Index ¶
- func CBCDecrypt(secretData, key, iv []byte) ([]byte, error)
- func CBCEncrypt(originData, key, iv []byte) ([]byte, error)
- func ECBDecrypt(secretData, key []byte) ([]byte, error)
- func ECBEncrypt(originData, key []byte) ([]byte, error)
- func GCMDecrypt(cipherText, nonce, additional, key []byte) ([]byte, error)
- func GCMEncrypt(originText, additional, key []byte) (nonce []byte, cipherText []byte, err error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) (bs []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CBCDecrypt ¶ added in v1.5.74
AES-CBC 解密数据
func CBCEncrypt ¶ added in v1.5.74
AES-CBC 加密数据
func ECBDecrypt ¶ added in v1.5.74
AES-ECB 解密数据
func ECBEncrypt ¶ added in v1.5.74
AES-ECB 加密数据
func GCMDecrypt ¶
AES-GCM 解密数据
func GCMEncrypt ¶
AES-GCM 加密数据
func PKCS5Padding ¶
加密填充模式(添加补全码) PKCS5Padding 加密时,如果加密bytes的length不是blockSize的整数倍,需要在最后面添加填充byte
func PKCS5UnPadding ¶
解密填充模式(去除补全码) PKCS5UnPadding 解密时,需要在最后面去掉加密时添加的填充byte
func PKCS7Padding ¶
加密填充模式(添加补全码) PKCS5Padding 加密时,如果加密bytes的length不是blockSize的整数倍,需要在最后面添加填充byte
func PKCS7UnPadding ¶
解密填充模式(去除补全码) PKCS7UnPadding 解密时,需要在最后面去掉加密时添加的填充byte
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.