Documentation
¶
Index ¶
- Variables
- func AesDecrypt(cryptedText, key, iv []byte) ([]byte, error)
- func AesEncrypt(plainText, key, iv []byte) ([]byte, error)
- func GenerateAESKey(length int) ([]byte, error)
- func GenerateSalt(length int) (string, error)
- func HashPassword(password string) (string, error)
- func HashPasswordWithSalt(password, salt string) (string, error)
- func PKCS5Padding(plaintext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func VerifyPassword(password, hash string) bool
- func VerifyPasswordWithSalt(password, salt, hashedPassword string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAESKey = []byte("f51d66a73d8a0927")
DefaultAESKey 默认AES密钥(16字节)
View Source
var DefaultCost = 10
DefaultCost 最小值=4 最大值=31 默认值=10
Functions ¶
func HashPasswordWithSalt ¶
HashPasswordWithSalt 对密码进行加盐哈希处理
func VerifyPasswordWithSalt ¶
VerifyPasswordWithSalt 验证密码是否正确
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.