php还原强智教务管理信息系统加密过程
-
原创
-
2016-06-06 20:08:40
1561浏览
[求助帖](http://jybox.net/220-%E5%B0%86%E4%B8%80%E6%AE%B5js%E5%92%8Casp%E8%BD%AC%E6%8D%A2%E6%88%90php),还是自己解决了。**概述**教务系统地址http://jwxt.whsw.cn/,你会发现登陆只能用ie浏览器,他喵的chrome和firefox都不支持。用其他浏览器登录时
[求助帖](http://jybox.net/220-%E5%B0%86%E4%B8%80%E6%AE%B5js%E5%92%8Casp%E8%BD%AC%E6%8D%A2%E6%88%90php),还是自己解决了。
**概述**
教务系统地址http://jwxt.whsw.cn/,你会发现登陆只能用ie浏览器,他喵的chrome和firefox都不支持。用其他浏览器登录时会提示密码错误,原因是他会先在前端加密密码再跟服务器通讯。而加密用的js和vbs,其他浏览器都只能js加密,vbs加密过程就不支持了,所以加密不完全导致提示密码错误。唉,这套系统也太老了,最后更新还是2005年,无力吐槽。
**js加密还原**
原过程
var pwd = theform.PassWord.value;
var rndNum = 394058;
rndNum = rndNum.toString();
var curPos = 0;
var tmpStr,EnCryptStr = "";
for(Cnt=0;Cnt
'';
echo $rndNum;
echo ''
'';
echo EncryptString($EnCryptStr);
function fromCharCode($codes) {
if (is_scalar($codes)) $codes= func_get_args();
$str= '''';
foreach ($codes as $code) $str.= chr($code);
return $str;
}
function charCodeAt($word) {
if (is_array($word))
$arr = $word;
else
$arr = str_split($word);
$bin_str = '''';
foreach ($arr as $value)
$bin_str .= decbin(ord($value));
$bin_str = preg_replace(''/^.{4}(.{4}).{2}(.{6}).{2}(.{6})$/'',''$1$2$3'', $bin_str);
return bindec($bin_str);
}
**vbs加密还原**
原函数
Function EncryptString(InputText , ThePassword )''用户口令加密
Dim il_bit, il_x, il_y, il_z, il_len, i
Dim is_out
Password = InputText
il_len = Len(Password)
il_x = 0
il_y = 0
is_out = ""
For i = 1 To il_len
il_bit = AscW(Mid(Password, i, 1)) ''W系列支持unicode
il_y = (il_bit * 13 Mod 256) + il_x
is_out = is_out & ChrW(Fix(il_y)) ''取整 int和fix区别: fix修正负数
il_x = il_bit * 13 / 256
Next
is_out = is_out & ChrW(Fix(il_x))
Password = is_out
il_len = Len(Password)
il_x = 0
il_y = 0
is_out = ""
For i = 1 To il_len
il_bit = AscW(Mid(Password, i, 1)) ''取前4位值
il_y = il_bit / 16 + 64
is_out = is_out & ChrW(Fix(il_y)) ''取后4位值
il_y = (il_bit Mod 16) + 64
is_out = is_out & ChrW(Fix(il_y))
Next
EncryptString = is_out
End Function
}
用php还原
function EncryptString($Password){ //密码前端加密部分
$il_len = strlen($Password);
$il_x = 0;
$il_y = 0;
$is_out = "";
for($i=0;$i
原文地址:php还原强智教务管理信息系统加密过程, 感谢原作者分享。
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。