为什么我无法调用TX的JS脚本?

ColaCoder 2015-05-15 05:34:16
小弟不才,最近在研究webqq的协议,然后在获取加密密码的算法上遇到了困难。

请问我这样写为什么无法调用JS函数。。

如果能有大神能翻一下此JS函数的每条语句就更好了

	function getEncryption(password, salt, vcode, isMd5) {
vcode = vcode || "";
password = password || "";
var md5Pwd = isMd5 ? password : md5(password),
h1 = hexchar2bin(md5Pwd),
s2 = md5(h1 + salt),
rsaH1 = $pt.RSA.rsa_encrypt(h1),
rsaH1Len = (rsaH1.length / 2).toString(16),
hexVcode = TEA.strToBytes(vcode.toUpperCase(), true),
vcodeLen = Number(hexVcode.length / 2).toString(16);
while (vcodeLen.length < 4) {
vcodeLen = "0" + vcodeLen
}
while (rsaH1Len.length < 4) {
rsaH1Len = "0" + rsaH1Len
}
TEA.initkey(s2);
var saltPwd = TEA.enAsBase64(rsaH1Len + rsaH1 + TEA.strToBytes(salt) + vcodeLen + hexVcode);
TEA.initkey("");
setTimeout(function() {
__monitor(488358, 1)
}, 0);
return saltPwd.replace(/[\/\+=]/g, function(a) {
return {
"/": "-",
"+": "*",
"=": "_"
}[a]
})
}


我的调用代码
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript">
function show()
{
str = getEncryption("123123","\x00\x00\x00\x00\x22\xcd\xaf\x37","!XVP",1);
alert(str);
}
</script>
</head>
<body>
<script src="mq_comm.js"></script>
<button onclick="show()">Show me</button>
</body>
</html>

...全文
156 1 打赏 收藏 举报
写回复
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ColaCoder 2015-05-15
  • 打赏
  • 举报
回复
已找到原因。。结贴
相关推荐
发帖
JavaScript

8.7w+

社区成员

Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
帖子事件
创建了帖子
2015-05-15 05:34
社区公告
暂无公告