Documentation ¶
Overview ¶
Package cryptoKit 本文件来自于gogf/gf的crypto/gaes/gaes.go
Package cryptoKit 加密工具包
Index ¶
- func AESDecryptCBC(cipherText []byte, key []byte, iv ...[]byte) ([]byte, error)
- func AESDecryptCFB(cipherText []byte, key []byte, unPadding int, iv ...[]byte) ([]byte, error)
- func AESEncryptCBC(plainText []byte, key []byte, iv ...[]byte) ([]byte, error)
- func AESEncryptCFB(plainText []byte, key []byte, padding *int, iv ...[]byte) ([]byte, error)
- func Base64Decode(str string) (string, error)
- func Base64Encode(str string) string
- func Hmac256(str, secret string) string
- func Md5(str string) string
- func Md5ToUpper(str string) string
- func PKCS5Padding(src []byte, blockSize int) []byte
- func PKCS5UnPadding(src []byte, blockSize int) ([]byte, error)
- func Sha256(str string) string
- func Sha256ToUpper(str string) string
- func UnicodeDecode(str string) (string, error)
- func UnicodeEncode(str string) string
- func UrlDecode(str string) (string, error)
- func UrlEncode(str string) string
- 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 AESDecryptCBC ¶ added in v0.2.12
AESDecryptCBC AES使用CBC模式解密
- 注意,密钥必须是16/24/32位长度
- @param cipherText 加密字符串
- @param key 密钥
- @param iv 向量
func AESDecryptCFB ¶ added in v0.2.12
AESDecryptCFB AES CFB解密
- 注意,密钥必须是16/24/32位长度。
- @param cipherText 密文
- @param key 密钥
- @param unPadding 去填充
- @param iv 向量
func AESEncryptCBC ¶ added in v0.2.12
AESEncryptCBC AES使用CBC模式加密
- 注意,密钥必须是16/24/32位长度
- @param plainText 待加密内容
- @param key 密钥
- @param iv 向量
func AESEncryptCFB ¶ added in v0.2.12
AESEncryptCFB AEC CFB模式加密
- 注意,密钥必须是16/24/32位长度。
- @param plainText 明文
- @param key 密钥
- @param padding 填充
- @param iv 向量
func PKCS5Padding ¶ added in v0.2.12
PKCS5Padding 填充
func PKCS5UnPadding ¶ added in v0.2.12
PKCS5UnPadding 反填充
func Sha256ToUpper ¶ added in v0.0.5
Sha256ToUpper Sha256加密大写 *
- @param str 加密字符串
- @return 加密结果 32个字符大写
func UnicodeDecode ¶ added in v0.1.1
UnicodeDecode 将Unicode编码转为字符串 *
- @param str Unicode编码字符串
- @return 字符串
func UnicodeEncode ¶ added in v0.1.1
UnicodeEncode 将字符串转为Unicode编码 *
- @param str 字符串
- @return Unicode编码字符串
func ZeroUnPadding ¶ added in v0.2.12
ZeroUnPadding 零未填充
- @param plaintext 明文
- @param unPadding 去除数据中的填充
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.