|
楼主 |
发表于 2014-12-12 21:08:32
|
显示全部楼层
广西壮族自治区南宁市
我试了下,这样不行, 我发我的代码给你看看
function getEncryption(password, salt, vcode, isMd5) {
//salt = uin2hex(salt);
eval('salt="' + salt + '"'); //就是这个地方,用上面的uin2hex(salt); 也可以,但是salt要直接是QQ号才行
//salt="' + salt + '"
vcode = vcode || "";
password = password || "";
var md5Pwd = isMd5 ? password : md5(password), h1 = hexchar2bin(md5Pwd), s2 = md5(h1 + salt), rsaH1 = $.RSA.rsa_encrypt(h1), rsaH1Len = (rsaH1.length / 2).toString(16), hexVcode = TEAobj.TEA.strToBytes(vcode.toUpperCase()), vcodeLen = "000" + vcode.length.toString(16);
while (rsaH1Len.length < 4) {
rsaH1Len = "0" + rsaH1Len
}
TEAobj.TEA.initkey(s2);
var saltPwd = TEAobj.TEA.enAsBase64(rsaH1Len + rsaH1 + TEAobj.TEA.strToBytes(salt) + vcodeLen + hexVcode);
TEAobj.TEA.initkey("");
// __monitor(488358, 1);
return saltPwd.replace(/[\/\+=]/g, function(a) {
return {"/": "-","+": "*","=": "_"}[a]
})
}
QQ空间登录.zip
(749.17 KB, 下载次数: 80)
|
|