Documentation ¶
Index ¶
- func AesCbcDecrypt(encrypted, key []byte) []byte
- func AesCbcEncrypt(data, key []byte) []byte
- func AesCfbDecrypt(encrypted, key []byte) []byte
- func AesCfbEncrypt(data, key []byte) []byte
- func AesCtrCrypt(data, key []byte) []byte
- func AesEcbDecrypt(encrypted, key []byte) []byte
- func AesEcbEncrypt(data, key []byte) []byte
- func AesOfbDecrypt(data, key []byte) []byte
- func AesOfbEncrypt(data, key []byte) []byte
- func Base64StdDecode(s string) string
- func Base64StdEncode(s string) string
- func DesCbcDecrypt(encrypted, key []byte) []byte
- func DesCbcEncrypt(data, key []byte) []byte
- func DesCfbDecrypt(encrypted, key []byte) []byte
- func DesCfbEncrypt(data, key []byte) []byte
- func DesCtrCrypt(data, key []byte) []byte
- func DesEcbDecrypt(encrypted, key []byte) []byte
- func DesEcbEncrypt(data, key []byte) []byte
- func DesOfbDecrypt(data, key []byte) []byte
- func DesOfbEncrypt(data, key []byte) []byte
- func GenKey(bits int) (string, string)
- func HmacMd5(str, key string) string
- func HmacMd5WithBase64(data, key string) string
- func HmacSha1(str, key string) string
- func HmacSha1WithBase64(str, key string) string
- func HmacSha256(str, key string) string
- func HmacSha256WithBase64(str, key string) string
- func HmacSha512(str, key string) string
- func HmacSha512WithBase64(str, key string) string
- func Md5Byte(data []byte) string
- func Md5ByteWithBase64(data []byte) string
- func Md5File(filename string) (string, error)
- func Md5String(s string) string
- func Md5StringWithBase64(s string) string
- func RsaDecrypt(data, privateKey string) (string, error)
- func RsaEncrypt(data, publicKey string) (string, error)
- func RsaSign(data, privateKey string) (string, error)
- func RsaVerify(data, sign, publicKey string) error
- func Sha1(str string) string
- func Sha1WithBase64(str string) string
- func Sha256(str string) string
- func Sha256WithBase64(str string) string
- func Sha512(str string) string
- func Sha512WithBase64(str string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesCbcDecrypt ¶
AesCbcDecrypt decrypt data with key use AES CBC algorithm len(key) should be 16, 24 or 32.
func AesCbcEncrypt ¶
AesCbcEncrypt encrypt data with key use AES CBC algorithm len(key) should be 16, 24 or 32.
func AesCfbDecrypt ¶
AesCfbDecrypt decrypt data with key use AES CFB algorithm len(encrypted) should be great than 16, len(key) should be 16, 24 or 32.
func AesCfbEncrypt ¶
AesCfbEncrypt encrypt data with key use AES CFB algorithm len(key) should be 16, 24 or 32.
func AesCtrCrypt ¶
AesCtrCrypt encrypt data with key use AES CTR algorithm len(key) should be 16, 24 or 32.
func AesEcbDecrypt ¶
AesEcbDecrypt decrypt data with key use AES ECB algorithm len(key) should be 16, 24 or 32.
func AesEcbEncrypt ¶
AesEcbEncrypt encrypt data with key use AES ECB algorithm len(key) should be 16, 24 or 32.
func AesOfbDecrypt ¶
AesOfbDecrypt decrypt data with key use AES OFB algorithm len(key) should be 16, 24 or 32.
func AesOfbEncrypt ¶
AesOfbEncrypt encrypt data with key use AES OFB algorithm len(key) should be 16, 24 or 32.
func Base64StdDecode ¶
Base64StdDecode decode a base64 encoded string.
func Base64StdEncode ¶
Base64StdEncode encode string with base64 encoding.
func DesCbcDecrypt ¶
DesCbcDecrypt decrypt data with key use DES CBC algorithm len(key) should be 8.
func DesCbcEncrypt ¶
DesCbcEncrypt encrypt data with key use DES CBC algorithm len(key) should be 8.
func DesCfbDecrypt ¶
DesCfbDecrypt decrypt data with key use DES CFB algorithm len(encrypted) should be great than 16, len(key) should be 8.
func DesCfbEncrypt ¶
DesCfbEncrypt encrypt data with key use DES CFB algorithm len(key) should be 8.
func DesCtrCrypt ¶
DesCtrCrypt encrypt data with key use DES CTR algorithm len(key) should be 8.
func DesEcbDecrypt ¶
DesEcbDecrypt decrypt data with key use DES ECB algorithm len(key) should be 8.
func DesEcbEncrypt ¶
DesEcbEncrypt encrypt data with key use DES ECB algorithm len(key) should be 8.
func DesOfbDecrypt ¶
DesOfbDecrypt decrypt data with key use DES OFB algorithm len(key) should be 8.
func DesOfbEncrypt ¶
DesOfbEncrypt encrypt data with key use DES OFB algorithm len(key) should be 16, 24 or 32.
func HmacMd5WithBase64 ¶
HmacMd5WithBase64 return the hmac hash of string use md5 with base64.
func HmacSha1WithBase64 ¶
HmacSha1WithBase64 return the hmac hash of string use sha1 with base64.
func HmacSha256 ¶
HmacSha256 return the hmac hash of string use sha256.
func HmacSha256WithBase64 ¶
HmacSha256WithBase64 return the hmac hash of string use sha256 with base64.
func HmacSha512 ¶
HmacSha512 return the hmac hash of string use sha512.
func HmacSha512WithBase64 ¶
HmacSha512WithBase64 return the hmac hash of string use sha512 with base64.
func Md5ByteWithBase64 ¶
Md5ByteWithBase64 return the md5 string of byte slice with base64.
func Md5StringWithBase64 ¶
Md5StringWithBase64 return the md5 value of string with base64.
func RsaDecrypt ¶
RsaDecrypt decrypt data with ras algorithm to match java
func RsaEncrypt ¶
RsaEncrypt encrypt data with ras algorithm to match java
func Sha1WithBase64 ¶
Sha1WithBase64 return the sha1 value (SHA-1 hash algorithm) of base64 string.
func Sha256WithBase64 ¶
Sha256WithBase64 return the sha256 value (SHA256 hash algorithm) of base64 string.
func Sha512WithBase64 ¶
Sha512WithBase64 return the sha512 value (SHA512 hash algorithm) of base64 string.
Types ¶
This section is empty.