Documentation ¶
Index ¶
- Constants
- func Aes128CBCDecrypt(key [16]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes128CBCEncrypt(key [16]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes128CFBDecrypt(key [16]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes128CFBEncrypt(key [16]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes128CTRDecrypt(key [16]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes128CTREncrypt(key [16]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes128ECBDecrypt(key [16]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes128ECBEncrypt(key [16]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes128OFBDecrypt(key [16]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes128OFBEncrypt(key [16]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes192CBCDecrypt(key [24]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes192CBCEncrypt(key [24]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes192CFBDecrypt(key [24]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes192CFBEncrypt(key [24]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes192CTRDecrypt(key [24]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes192CTREncrypt(key [24]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes192ECBDecrypt(key [24]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes192ECBEncrypt(key [24]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes192OFBDecrypt(key [24]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes192OFBEncrypt(key [24]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes256CBCDecrypt(key [32]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes256CBCEncrypt(key [32]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes256CFBDecrypt(key [32]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes256CFBEncrypt(key [32]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes256CTRDecrypt(key [32]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes256CTREncrypt(key [32]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Aes256ECBDecrypt(key [32]byte, ciphertext []byte) (plaintext []byte, err error)
- func Aes256ECBEncrypt(key [32]byte, plaintext []byte) (ciphertext []byte, err error)
- func Aes256OFBDecrypt(key [32]byte, cipherReader io.Reader) (plainReader io.Reader, err error)
- func Aes256OFBEncrypt(key [32]byte, plainReader io.Reader) (cipherReader io.Reader, err error)
- func Base64Decode(raw []byte) []byte
- func Base64Encode(raw []byte) []byte
- func BytesReverse(b []byte) []byte
- func Convert16bytes(b []byte) (b16 [16]byte)
- func Convert24bytes(b []byte) (b24 [24]byte)
- func Convert32bytes(b []byte) (b32 [32]byte)
- func DESCBCDecrypt3(ciphertext, key, iv []byte) (plaintext []byte, err error)
- func DESCBCEncrypt3(plaintext, key, iv []byte) (ciphertext []byte, err error)
- func GZIPCompress(src io.Reader, writeTo io.Writer) (err error)
- func GZIPCompressFile(filePath string) (err error)
- func GZIPUncompress(src io.Reader, writeTo io.Writer) (err error)
- func GZIPUnompressFile(filePath string) (err error)
- func HmacMD5(key, origData []byte) (sum []byte)
- func HmacSHA1(key, origData []byte) (sum []byte)
- func HmacSHA256(key, origData []byte) (sum []byte)
- func HmacSHA512(key, origData []byte) (sum []byte)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(plaintext []byte) []byte
- func RSADecryptNoPadding(rsaPrivateKey string, ciphertext []byte) ([]byte, error)
- func RSAEncryptNoPadding(rsaPublicKeyModulus string, rsaPublicKeyExponent int64, origData []byte) (ciphertext []byte, err error)
- func RSAEncryptOfWapBaidu(rsaPublicKeyModulus string, origData []byte) (string, error)
- func StringReverse(s string) string
- type AesMode
Constants ¶
const ( // DefaultRSAPublicKeyModulus 默认的公钥模数 DefaultRSAPublicKeyModulus = "" /* 256-byte string literal not displayed */ // DefaultRSAPublicKeyExponent 默认的公钥指数 DefaultRSAPublicKeyExponent = 0x10001 // DefaultRSAPrivateKey 默认的私钥 DefaultRSAPrivateKey = `` /* 886-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func Aes128CBCDecrypt ¶
Aes128CBCDecrypt aes-128-cbc 解密
func Aes128CBCEncrypt ¶
Aes128CBCEncrypt aes-128-cbc 加密
func Aes128CFBDecrypt ¶
Aes128CFBDecrypt aes-128-cfb 解密
func Aes128CFBEncrypt ¶
Aes128CFBEncrypt aes-128-cfb 加密
func Aes128CTRDecrypt ¶
Aes128CTRDecrypt aes-128-ctr 解密
func Aes128CTREncrypt ¶
Aes128CTREncrypt aes-128-ctr 加密
func Aes128ECBDecrypt ¶
Aes128ECBDecrypt aes-128-ecb 解密
func Aes128ECBEncrypt ¶
Aes128ECBEncrypt aes-128-ecb 加密
func Aes128OFBDecrypt ¶
Aes128OFBDecrypt aes-128-ofb 解密
func Aes128OFBEncrypt ¶
Aes128OFBEncrypt aes-128-ofb 加密
func Aes192CBCDecrypt ¶
Aes192CBCDecrypt aes-192-cbc 解密
func Aes192CBCEncrypt ¶
Aes192CBCEncrypt aes-192-cbc 加密
func Aes192CFBDecrypt ¶
Aes192CFBDecrypt aes-192-cfb 解密
func Aes192CFBEncrypt ¶
Aes192CFBEncrypt aes-192-cfb 加密
func Aes192CTRDecrypt ¶
Aes192CTRDecrypt aes-192-ctr 解密
func Aes192CTREncrypt ¶
Aes192CTREncrypt aes-192-ctr 加密
func Aes192ECBDecrypt ¶
Aes192ECBDecrypt aes-192-ecb 解密
func Aes192ECBEncrypt ¶
Aes192ECBEncrypt aes-192-ecb 加密
func Aes192OFBDecrypt ¶
Aes192OFBDecrypt aes-192-ofb 解密
func Aes192OFBEncrypt ¶
Aes192OFBEncrypt aes-192-ofb 加密
func Aes256CBCDecrypt ¶
Aes256CBCDecrypt aes-256-cbc 解密
func Aes256CBCEncrypt ¶
Aes256CBCEncrypt aes-256-cbc 加密
func Aes256CFBDecrypt ¶
Aes256CFBDecrypt aes-256-cfb 解密
func Aes256CFBEncrypt ¶
Aes256CFBEncrypt aes-256-cfb 加密
func Aes256CTRDecrypt ¶
Aes256CTRDecrypt aes-256-ctr 解密
func Aes256CTREncrypt ¶
Aes256CTREncrypt aes-256-ctr 加密
func Aes256ECBDecrypt ¶
Aes256ECBDecrypt aes-256-ecb 解密
func Aes256ECBEncrypt ¶
Aes256ECBEncrypt aes-256-ecb 加密
func Aes256OFBDecrypt ¶
Aes256OFBDecrypt aes-256-ofb 解密
func Aes256OFBEncrypt ¶
Aes256OFBEncrypt aes-256-ofb 加密
func Convert16bytes ¶
Convert16bytes 将 []byte 转为 [16]byte
func Convert24bytes ¶
Convert24bytes 将 []byte 转为 [24]byte
func Convert32bytes ¶
Convert32bytes 将 []byte 转为 [32]byte
func DESCBCDecrypt3 ¶
DESCBCDecrypt3 实现3DES解密, CBC模式
func DESCBCEncrypt3 ¶
DESCBCEncrypt3 实现3DES加密, CBC模式
func GZIPCompress ¶
GZIPCompress GZIP 压缩
func GZIPCompressFile ¶
GZIPCompressFile GZIP 压缩文件
func GZIPUncompress ¶
GZIPUncompress GZIP 解压缩
func GZIPUnompressFile ¶
GZIPUnompressFile GZIP 解压缩文件
func PKCS5Padding ¶
PKCS5Padding PKCS5 Padding
func RSADecryptNoPadding ¶
RSADecryptNoPadding 无填充模式的 RSA 解密
func RSAEncryptNoPadding ¶
func RSAEncryptNoPadding(rsaPublicKeyModulus string, rsaPublicKeyExponent int64, origData []byte) (ciphertext []byte, err error)
RSAEncryptNoPadding 无填充模式的 RSA 加密
func RSAEncryptOfWapBaidu ¶
RSAEncryptOfWapBaidu 针对 WAP 登录百度的 RSA 加密