Documentation ¶
Index ¶
- Constants
- func AesCbcDecrypt(encrypted, key []byte) []byte
- func AesCbcEncrypt(data, key []byte) []byte
- func AesEcbDecrypt(encrypted, key []byte) []byte
- func AesEcbEncrypt(data, key []byte) []byte
- func Base62Decode(str string) int64
- func Base62Encode(number int64) string
- func Base64StdDecode(s string) string
- func Base64StdEncode(s string) string
- func CreateRsaKey(keySize int, priKeyFile, pubKeyFile string) error
- func DecryptDESECB4Base64(src, key string) string
- func DecryptDESECB4Hex(src, key string) string
- func EncryptDESECB2Base64(src, key string) string
- func EncryptDESECB2Hex(src, key string) string
- func GetAesKey(key []byte) []byte
- func GetDesKey(key []byte) []byte
- func HmacMd5(dataStr, key string) string
- func HmacSha1(dataStr, key string) string
- func HmacSha2562Byte(stringToSign string, secret string) []byte
- func HmacSha256V1(source, secret string) string
- func HmacSha512(dataStr, key string) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func Pkcs7Padding(origData []byte, blockSize int) []byte
- func Pkcs7UnPadding(origData []byte) []byte
- func RsaDecrypt(data []byte, privateKeyFileName string) (error, []byte)
- func RsaEncrypt(data []byte, pubKeyFileName string) (error, []byte)
- func Sha1(str string) string
- func Sha1File(path string) (string, error)
- func Sha1V1(str string) string
- func Sha2562Byte(str string) []byte
- func Sha256ByByteV1(by []byte) string
- func Sha256V1(str string) string
- func Sha256V2(str string) string
- func Sha512(dataStr string) string
Constants ¶
View Source
const ShortChar = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Variables ¶
This section is empty.
Functions ¶
func Base62Decode ¶
func Base62Encode ¶
func Base64StdDecode ¶ added in v1.0.4
func Base64StdEncode ¶ added in v1.0.4
func CreateRsaKey ¶ added in v1.0.4
创建公钥、私钥
func DecryptDESECB4Base64 ¶
des ECB hex解密: src := xcrypto.DecryptDESECB4Base64(xcrypto.EncryptDESECB2Base64("hello'!@123", "basesoft"),"basesoft")
func DecryptDESECB4Hex ¶
des ECB hex解密: src := xcrypto.DecryptDESECB4Hex(xcrypto.EncryptDESECB2Hex("123456", "basesoft"),"basesoft")
func EncryptDESECB2Base64 ¶
des ECB base64加密:xcrypto.EncryptDESECB2Base64("密码", "basesoft")
func HmacSha2562Byte ¶ added in v1.0.4
func HmacSha256V1 ¶ added in v1.0.4
HmacSha256V1 HmacSHA256加密算法
func HmacSha512 ¶ added in v1.0.4
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func Pkcs7Padding ¶ added in v1.0.4
func Pkcs7UnPadding ¶ added in v1.0.4
func RsaDecrypt ¶ added in v1.0.4
通过私钥解密
func RsaEncrypt ¶ added in v1.0.4
通过公钥进行rsa加密
func Sha2562Byte ¶ added in v1.0.4
func Sha256ByByteV1 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.