首页 / PHP / phpvbs加密复原
phpvbs加密复原
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了phpvbs加密复原,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3186字,纯文字阅读大概需要5分钟。
内容图文
![phpvbs加密复原](/upload/InfoBanner/zyjiaocheng/230/5f04e8b5281a4d98814afc8143698440.jpg)
js加密还原
原过程
var pwd = theform.PassWord.value;var rndNum = 394058;rndNum = rndNum.toString();var curPos = 0;var tmpStr,EnCryptStr = "";for(Cnt=0;Cnt<pwd.length;Cnt++){ if(Cnt % rndNum.length == 0 ) curPos = 0; tmpStr = pwd.substring(Cnt,Cnt+1); EnCryptStr += String.fromCharCode(tmpStr.charCodeAt(0) - Cnt - rndNum.substring(curPos,curPos+1)); curPos +=1;}theform.PassWord.value = EnCryptStr;//Assigned the EncryptPassword value to the PassWord TextFiledtheform.EnRndNum.value = rndNum;
用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< $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); }}
内容总结
以上是互联网集市为您收集整理的phpvbs加密复原全部内容,希望文章能够帮你解决phpvbs加密复原所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。