Documentation ¶
Overview ¶
* * @Author: TheLife * @Date: 2020-2-25 9:00 下午
* * @Author: TheLife * @Date: 2020-2-25 9:00 下午
* * @Author: TheLife * @Date: 2020-2-25 9:00 下午
* * @Author: TheLife * @Date: 2020-2-25 9:00 下午
Index ¶
Constants ¶
View Source
const DataCaptcha = "v"
View Source
const DataCode = "c"
View Source
const DataIsCaptcha = "i"
View Source
const DataSalt = "s"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Captcha ¶
type Captcha struct {
// contains filtered or unexported fields
}
验证码
type Password ¶
func (*Password) DecryptAndCheck ¶
*
- 解密密码
- 原理: // AES-128-CBC {padding:Pkcs7,iv:salt}( // md5( md5(salt + 验证码)+sha512(单数位 salt) ).从第三个开始取16个长度 // AES-128-CBC {padding:Pkcs7,iv:md5(salt)的前16位}( // sha512(sha384(salt) + 验证码长度 + 验证码 + md5(双数位 salt)).从第十个开始取16个长度, // sha512(sha384(salt) + 验证码长度 + 验证码 + md5(双数位 salt)) + QQ 密码) // ) // 注: salt 长度必须为16
解密密码与验证
func (*Password) MakePassword ¶
加密密码
func (*Password) RandSaltAndCode ¶
生产salt和code
Click to show internal directories.
Click to hide internal directories.