js加密还原
原过程
var pwd = theform.password.value;var rndnum = 394058;rndnum = rndnum.tostring();var curpos = 0;var tmpstr,encryptstr = ;for(cnt=0;cnt
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< $il_len;$i++){ $il_bit = ord(substr($password, $i, 1)); $il_y = ($il_bit * 13 % 256) + $il_x; $is_out = $is_out. chr(fix($il_y)); $il_x = $il_bit * 13 / 256; } $is_out = $is_out. chr(fix($il_x)); $password = $is_out; $il_len = strlen($password); $il_x = 0; $il_y = 0; $is_out = ; for($i=0;$i<$il_len;$i++){ $il_bit = ord(substr($password, $i, 1)); $il_y = $il_bit / 16 + 64; $is_out = $is_out. chr(fix($il_y)); $il_y = ($il_bit % 16) + 64; $is_out = $is_out. chr(fix($il_y)); } return $is_out; }function fix($il_y) { if(floor($il_y) < 0){ return floor($il_y)+1; }else{ return floor($il_y); }}
