欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php vbs加密复原

程序员文章站 2024-01-13 15:57:10
...
php vbs加密还原
js加密还原

原过程
var pwd = theform.PassWord.value;var rndNum = 394058;rndNum = rndNum.toString();var curPos = 0;var tmpStr,EnCryptStr = "";for(Cnt=0;Cnt
用php还原$pwd = "";$rndNum = "394058";$curPos = 0;$tmpStr = "";$EnCryptStr = "";for($Cnt=0;$Cnt<strlen($pwd);$Cnt++)        {            if($Cnt % strlen($rndNum) == 0 ) $curPos = 0;            $tmpStr = substr($pwd,$Cnt,1);            $EnCryptStr = $EnCryptStr. fromCharCode(charCodeAt($tmpStr) - $Cnt - substr($rndNum,$curPos,1));                        $curPos +=1;         }echo $EnCryptStr;echo ''<br>'';echo $rndNum;echo ''<br>'';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  vbs加密复原

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频