Documentation ¶
Index ¶
- Variables
- func AesDecrypt(crypted, key []byte, iv []byte) ([]byte, error)
- func AesDecryptECB(data, key []byte) []byte
- func AesDecryptECBPK5(data, key []byte) []byte
- func AesDecryptECBPK7(data, key []byte) []byte
- func AesDecryptPKCS5(crypted, key []byte, iv []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte, iv []byte) ([]byte, error)
- func AesEncryptECB(data, key []byte) (encrypted []byte)
- func AesEncryptECBPK5(data, key []byte) (encrypted []byte)
- func AesEncryptECBPK7(data, key []byte) (encrypted []byte)
- func AesEncryptPKCS5(origData, key []byte, iv []byte) ([]byte, error)
- func CompressBrotli(data []byte) ([]byte, error)
- func Crc32(s string) uint32
- func DecompressBrotli(compressedData []byte) ([]byte, error)
- func GenRsaKey(filePath string) error
- func Gzip(data []byte) []byte
- func HmacSHA1(data, key string) []byte
- func HmacSHA256(data, key []byte) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func RsaDecWithPriKey(cipherByte []byte, privateKey string) ([]byte, error)
- func RsaEncWithPKCS8(cipherText []byte, privateKey []byte) ([]byte, error)
- func RsaEncWithPriKey(priv *rsa.PrivateKey, data []byte) (enc []byte, err error)
- func RsaEncWithPubKey(sourceBytes, pubKey []byte) ([]byte, error)
- func RsaSign(cipherText []byte, privateKey []byte) ([]byte, error)
- func RsaSignPKCS8(cipherText []byte, privateKey []byte) ([]byte, error)
- func RsaVerifySign(origData []byte, sign []byte, publicKey string) error
- func Sha1(data []byte) [20]byte
- func Sha256(data []byte) string
- func Sm2Encrypt(plaintext []byte, pubKeyBytes []byte, cipherTextType int) ([]byte, error)
- func Sm4CbcPkcs5Decode(data []byte, key []byte, iv []byte) ([]byte, error)
- func Sm4CbcPkcs5Encode(data []byte, key []byte, iv []byte) ([]byte, error)
- func Sm4EcbPkcs5Decode(data []byte, key []byte) ([]byte, error)
- func Sm4EcbPkcs5Encode(data []byte, key []byte) ([]byte, error)
- func ToMd5(str string) string
- func TripleDesDecrypt(crypted, key, iv []byte) ([]byte, error)
- func TripleDesEncrypt(origData, key, iv []byte) ([]byte, error)
- func UnGzip(compressSrc []byte) []byte
- func UnicodeString(str string) string
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInputSize = errors.New("input size too large") ErrEncryption = errors.New("encryption error") )
Functions ¶
func AesDecryptECB ¶
func AesDecryptECBPK5 ¶ added in v0.0.7
func AesDecryptECBPK7 ¶
func AesEncryptECB ¶
func AesEncryptECBPK5 ¶ added in v0.0.7
func AesEncryptECBPK7 ¶
func CompressBrotli ¶ added in v0.0.5
CompressBrotli 压缩数据使用 Brotli 算法
func DecompressBrotli ¶ added in v0.0.5
DecompressBrotli 解压缩使用 Brotli 算法压缩的数据
func HmacSHA256 ¶
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func PKCS7UnPadding ¶
func RsaEncWithPKCS8 ¶
* @param cipherText 待签名字段 RSA私钥签名sha1
func RsaEncWithPriKey ¶
func RsaEncWithPriKey(priv *rsa.PrivateKey, data []byte) (enc []byte, err error)
func RsaSignPKCS8 ¶
* @param cipherText 待签名字段 RSA私钥签名sha1
func RsaVerifySign ¶
* @param origData 待签名字段 @param sign 签名 公钥验签
func Sm2Encrypt ¶
func UnicodeString ¶
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.