Documentation ¶
Index ¶
- Constants
- func AesCBCPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func AesCBCPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func AesCFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func AesCFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func AesCTRPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func AesCTRPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func AesECBPkcs7Decrypt(src, key []byte) ([]byte, error)
- func AesECBPkcs7Encrypt(data, key []byte) ([]byte, error)
- func AesOFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func AesOFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func Base64Decode(s string) ([]byte, error)
- func Base64Encode(src []byte) string
- func Decrypt(multiple cryptoType, cipherText, key, iv []byte, mode mode, padding padding) ([]byte, error)
- func DesCBCPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func DesCFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func DesCFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func DesCTRPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func DesCTRPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func DesECBPkcs7Decrypt(src, key []byte) ([]byte, error)
- func DesECBPkcs7Encrypt(data, key []byte) ([]byte, error)
- func DesOFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func DesOFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func DescCBCPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func EasyDecrypt(easyType, cipherText, key, iv string) (string, error)
- func EasyEncrypt(easyType, plainText, key, iv string) (string, error)
- func Encrypt(multiple cryptoType, plainText, key, iv []byte, mode mode, padding padding) ([]byte, error)
- func GenKeys(bits int) ([]byte, []byte, error)
- func GenPKCS1PrvKey(bits int) ([]byte, error)
- func GenPrvKey(bits int) ([]byte, error)
- func GenPubKeyFromPrvKey(prvKey []byte) ([]byte, error)
- func HexDecode(s string) ([]byte, error)
- func HexEncode(src []byte) string
- func Pkcs5Padding(text []byte) []byte
- func Pkcs5UnPadding(src []byte) []byte
- func Pkcs7Padding(text []byte, blockSize int) []byte
- func Pkcs7UnPadding(src []byte) []byte
- func PrvKeyDecrypt(prvKey, cipherText []byte) ([]byte, error)
- func PrvKeySign(prvKey, plainText []byte, hash crypto.Hash) ([]byte, error)
- func PubKeyEncrypt(pubKey, plainText []byte) ([]byte, error)
- func PubKeyVerifySign(pubKey, plainText, sign []byte, hash crypto.Hash) error
- func TripleDesCBCPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func TripleDesCBCPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func TripleDesCFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func TripleDesCFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func TripleDesCTRPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func TripleDesCTRPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func TripleDesECBPkcs7Decrypt(src, key []byte) ([]byte, error)
- func TripleDesECBPkcs7Encrypt(data, key []byte) ([]byte, error)
- func TripleDesOFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)
- func TripleDesOFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)
- func ZeroPadding(text []byte, blockSize int) []byte
- func ZeroUnPadding(src []byte) []byte
Constants ¶
View Source
const ( Aes cryptoType = iota Des TriDes )
View Source
const ( ECB mode = iota CBC CFB OFB CTR )
View Source
const ( No padding = iota Zero Pkcs5 Pkcs7 )
View Source
const ( Base64 transcode = iota Hex )
Variables ¶
This section is empty.
Functions ¶
func AesCBCPkcs7Decrypt ¶
func AesCBCPkcs7Encrypt ¶
func AesCFBPkcs7Decrypt ¶
func AesCFBPkcs7Encrypt ¶
func AesCTRPkcs7Decrypt ¶
func AesCTRPkcs7Encrypt ¶
func AesECBPkcs7Decrypt ¶
ECB 模式解密 src密文,key加密时的密钥
func AesECBPkcs7Encrypt ¶
Ecb加密模式 data要加密的数据,key要加密的密钥
func AesOFBPkcs7Decrypt ¶
func AesOFBPkcs7Encrypt ¶
func Base64Decode ¶
func Base64Encode ¶
func DesCBCPkcs7Encrypt ¶
func DesCFBPkcs7Decrypt ¶
func DesCFBPkcs7Encrypt ¶
func DesCTRPkcs7Decrypt ¶
func DesCTRPkcs7Encrypt ¶
func DesECBPkcs7Decrypt ¶
ECB 模式解密 src密文,key加密时的密钥
func DesECBPkcs7Encrypt ¶
Ecb加密模式 data要加密的数据,key要加密的密钥
func DesOFBPkcs7Decrypt ¶
func DesOFBPkcs7Encrypt ¶
func DescCBCPkcs7Decrypt ¶
func EasyDecrypt ¶
func EasyEncrypt ¶
easyType:cryptoType/mode/padding/transcode
func GenPKCS1PrvKey ¶
GenPKCS1PrvKey Generate an RSA private key in PKCS#1 format
func GenPubKeyFromPrvKey ¶
GenPubKeyFromPrvKey Generate a public key from a private key
func Pkcs5Padding ¶
func Pkcs5UnPadding ¶
func Pkcs7Padding ¶
func Pkcs7UnPadding ¶
func PrvKeyDecrypt ¶
PrvKeyDecrypt private key decryption
func PrvKeySign ¶
PrvKeySign private key signature
func PubKeyEncrypt ¶
PubKeyEncrypt public key encryption
func PubKeyVerifySign ¶
PubKeyVerifySign public key verification signature
func TripleDesECBPkcs7Decrypt ¶
ECB 模式解密 src密文,key加密时的密钥
func TripleDesECBPkcs7Encrypt ¶
Ecb加密模式 data要加密的数据,key要加密的密钥
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.