Documentation ¶
Overview ¶
aes.go
des.go
padding.go
rsa.go
Index ¶
- func AesCBCDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte, err error)
- func AesCBCEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte, err error)
- func AesCFBDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte, err error)
- func AesCFBEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte, err error)
- func AesECBDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte, err error)
- func AesECBEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte, err error)
- func Crypto(ctype string, s string) (string, error)
- func DesCBCDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte, err error)
- func DesCBCEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte, err error)
- func DesCFBDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte, err error)
- func DesCFBEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte, err error)
- func GenRsaKey(bits int, pemFile ...string) error
- func Hmac(ctype, s, key string) (string, error)
- func HmacSha1(ctype, s, key string) string
- func HmacSha256(ctype, s, key string) string
- func Md5(s string) string
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func RSADecrypt(data []byte, privatePem ...string) ([]byte, error)
- func RSAEncrypt(data []byte, publicPem ...string) ([]byte, error)
- func SetAesKey(key string) (err error)
- func SetDesKey(key string) error
- func Sha1(s string) string
- func Sha256(s string) string
- func Sha512(s string) string
- func TripleDesCBCDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte, err error)
- func TripleDesCBCEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte, err error)
- func TripleDesCFBDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte, err error)
- func TripleDesCFBEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte, err error)
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesCBCDecrypt ¶
func AesCBCEncrypt ¶
func AesCFBDecrypt ¶
func AesCFBEncrypt ¶
func AesECBDecrypt ¶
func AesECBEncrypt ¶
func DesCBCDecrypt ¶
func DesCBCEncrypt ¶
func DesCFBDecrypt ¶
func DesCFBEncrypt ¶
func GenRsaKey ¶
openssl genrsa -out private.pem 1024 openssl rsa -in private.pem -pubout -out public.pem
func HmacSha256 ¶ added in v1.6.1
func NewECBDecrypter ¶
NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.
func NewECBEncrypter ¶
NewECBEncrypter returns a BlockMode which encrypts in electronic code book mode, using the given Block.
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func TripleDesCBCDecrypt ¶
3DES解密
func TripleDesCBCEncrypt ¶
3DES加密
func TripleDesCFBDecrypt ¶
3DES解密
func TripleDesCFBEncrypt ¶
3DES加密
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.