Documentation ¶
Index ¶
- Constants
- func Aes128EcbPkcs5Decrypt(ciphertext, key []byte) []byte
- func Aes128EcbPkcs5DecryptBase64(msg, key string) string
- func Aes128EcbPkcs5Encrypt(plaintext, key []byte) []byte
- func Aes128EcbPkcs5EncryptBase64(msg, key string) string
- func Aes256EcbPkcs7Decrypt(ciphertext, key []byte) ([]byte, error)
- func Aes256EcbPkcs7DecryptBase64(msg, key string) (string, error)
- func Aes256EcbPkcs7Encrypt(plaintext, key []byte) ([]byte, error)
- func Aes256EcbPkcs7EncryptBase64(msg, key string) (string, error)
- func AesCbcDecryptWithSalt(ciphertext, key []byte) ([]byte, error)
- func AesCbcEncryptWithSalt(plaintext, key []byte) ([]byte, error)
- func AesCbcPkcs5Decrypt(ciphertext, key []byte) ([]byte, error)
- func AesCbcPkcs5DecryptBase64(ciphertext, key string) (string, error)
- func AesCbcPkcs5Encrypt(plaintext, key []byte) ([]byte, error)
- func AesCbcPkcs5EncryptBase64(plaintext, key string) (string, error)
- func AesCbcPkcs7Decrypt(base64EncryptMsg, encodingAesKey string) ([]byte, error)
- func AesCbcPkcs7DecryptBase64(base64EncryptMsg, encodingAesKey string) (string, error)
- func AesCbcPkcs7Encrypt(msg, encodingAesKey string) ([]byte, error)
- func AesCbcPkcs7EncryptBase64(msg, encodingAesKey string) (string, error)
- func AesCfbDecryptBase64(base64EncryptMsg, encodingAesKey string) (string, error)
- func AesCfbDecryptWithSalt(ciphertext []byte, key []byte) ([]byte, error)
- func AesCfbEncryptBase64(msg, encodingAesKey string) (string, error)
- func AesCfbEncryptWithSalt(plaintext []byte, key []byte) ([]byte, error)
- func DesEbcDecrypt(ciphertext, key []byte) ([]byte, error)
- func DesEbcEncrypt(plaintext, key []byte) ([]byte, error)
- func DesEbcPkcs5DecryptBase64(msg, key string) (string, error)
- func DesEbcPkcs5EncryptBase64(msg, key string) (string, error)
- func DesEdeEcbDecrypt(src, key []byte) ([]byte, error)
- func DesEdeEcbEncrypt(plaintext, key []byte) ([]byte, error)
- func GenerateEncodingAesKey(key string) string
- func PKCS5Padding(plaintext []byte, blockSize int) []byte
- func PKCS5UnPadding(plaintext []byte) []byte
- func PKCS7Padding(plaintext []byte, blockSize int) []byte
- func PKCS7UnPadding(plaintext []byte, blockSize int) ([]byte, error)
- func PasswdPadding16(key []byte) []byte
- func PasswdPadding24(key []byte) []byte
- func PasswdPadding32(key []byte) []byte
- func PasswdPadding8(key []byte) []byte
- func ZeroPadding(plaintext []byte, blockSize int) []byte
- func ZeroUnPadding(plaintext []byte) []byte
Constants ¶
const ( PKCS7AesKeyLen = 32 //AES算法的密钥,长度为32字节 PKCS5AesKeyLen = 16 )
Variables ¶
This section is empty.
Functions ¶
func Aes128EcbPkcs5Decrypt ¶
Aes128EcbPkcs5Decrypt 解密 => MYSQL AES_DECRYPT
func Aes128EcbPkcs5DecryptBase64 ¶
Aes128EcbPkcs5DecryptBase64 解密+base64编码
func Aes128EcbPkcs5Encrypt ¶
Aes128EcbPkcs5Encrypt 加密 => MYSQL AES_ENCRYPT
func Aes128EcbPkcs5EncryptBase64 ¶
Aes128EcbPkcs5EncryptBase64 加密+base64编码 => MYSQL TO_BASE64(AES_ENCRYPT)
func Aes256EcbPkcs7Decrypt ¶
Aes256EcbPkcs7Decrypt 解密
func Aes256EcbPkcs7DecryptBase64 ¶
Aes256EcbPkcs7DecryptBase64 解密+base64编码
func Aes256EcbPkcs7Encrypt ¶
Aes256EcbPkcs7Encrypt 加密
func Aes256EcbPkcs7EncryptBase64 ¶
Aes256EcbPkcs7EncryptBase64 加密+base64编码
func AesCbcDecryptWithSalt ¶
AesCbcDecryptWithSalt 加盐解密
func AesCbcEncryptWithSalt ¶
AesCbcEncryptWithSalt 加盐加密
func AesCbcPkcs5Decrypt ¶
AesCbcPkcs5Decrypt AES解密
func AesCbcPkcs5DecryptBase64 ¶
AesCbcPkcs5DecryptBase64 解密+base64编码
func AesCbcPkcs5Encrypt ¶
AesCbcPkcs5Encrypt AES加密
func AesCbcPkcs5EncryptBase64 ¶
AesCbcPkcs5EncryptBase64 加密+base64编码
func AesCbcPkcs7Decrypt ¶
AesCbcPkcs7Decrypt 解密
func AesCbcPkcs7DecryptBase64 ¶
AesCbcPkcs7DecryptBase64 解密
func AesCbcPkcs7Encrypt ¶
AesCbcPkcs7Encrypt 加密
func AesCbcPkcs7EncryptBase64 ¶
AesCbcPkcs7EncryptBase64 加密
func AesCfbDecryptBase64 ¶
AesCfbDecryptBase64 解密
func AesCfbDecryptWithSalt ¶
AesCfbDecryptWithSalt 加盐解密
func AesCfbEncryptBase64 ¶
AesCfbEncryptBase64 加密
func AesCfbEncryptWithSalt ¶
AesCfbEncryptWithSalt 加盐加密
func DesEbcPkcs5DecryptBase64 ¶
DesEbcPkcs5DecryptBase64 解密+Base64 兼容java默认
func DesEbcPkcs5EncryptBase64 ¶
DesEbcPkcs5EncryptBase64 加密+Base64 兼容java默认
func DesEdeEcbDecrypt ¶
DesEdeEcbDecrypt 3DES解密desede-ECB
func DesEdeEcbEncrypt ¶
DesEdeEcbEncrypt 3DES加密desede-ECB
func GenerateEncodingAesKey ¶
GenerateEncodingAesKey 生成43位EncodingAesKey,len(key)最好等于32
func PKCS7UnPadding ¶
PKCS7UnPadding 去除
func PasswdPadding32 ¶
PasswdPadding32 Fill 0x00 if the length of key less than 32
func PasswdPadding8 ¶
PasswdPadding8 Fill 0x00 if the length of key less than 8
Types ¶
This section is empty.