Documentation ¶
Index ¶
- Variables
- func AESDecrypt(crypt string, key string) (string, error)
- func AESEncrypt(orig string, key string) (string, error)
- func Base64Decrypt(str string) (string, error)
- func Base64Encrypt(str string) string
- func BcryptComparePassword(hashedPassword string, password string) error
- func BcryptHashPassword(password string) (string, error)
- func DESDecrypt(data string, key []byte) string
- func DESEncrypt(origData, key []byte) string
- func MD5(value string) 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 RSADecrypt(ciphertext []byte) ([]byte, error)
- func RSAEncrypt(origData []byte) ([]byte, error)
- func ScryptComparePassword(storedPassword string, suppliedPassword string) (bool, error)
- func ScryptHashPassword(password string) (string, error)
- func Sha1(str string) string
- func Sha256(str string) string
- func Sha512(str string) string
- func TripleDESDecrypt(crypted, key []byte) ([]byte, error)
- func TripleDESEncrypt(origData, key []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var AES_KEY = "ZRxS9kLzR90GLpCFabUWMKAw"
View Source
var DES_KEY = "fBEznwcv"
Functions ¶
func AESDecrypt ¶
AESDecrypt Aes解密 key: 24个字符
func AESEncrypt ¶
AESEncrypt Aes加密 key: 24个字符
func BcryptComparePassword ¶
BcryptComparePassword 判断密码是否正确 hashedPassword 加密密码 password 原始密码
func BcryptHashPassword ¶
BcryptHashPassword bcrypt 加密 password 原始密码
func PKCS7Padding ¶
PKCS7Padding 补码 AES加密数据块分组长度必须为128bit(byte[16]),密钥长度可以是128bit(byte[16])、192bit(byte[24])、256bit(byte[32])中的任意一个。
func ScryptComparePassword ¶
ScryptComparePassword 判断密码是否正确 storedPassword 加密密码 suppliedPassword 原始密码
func ScryptHashPassword ¶
ScryptHashPassword scrypt 加密 password 原始密码
func TripleDESDecrypt ¶
TripleDESDecrypt 3DES解密 key:24位
func TripleDESEncrypt ¶
TripleDESEncrypt 3DES加密 key:24位
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.