rc4_js.htm

来自「RC4加密算法的Javascript实现」· HTM 代码 · 共 16 行

HTM
16
字号
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">

<title>新建网页 1</title>
</head><body>

<!--WARNING: IF YOU ARE READING THIS, YOU MAY BE CONSIDERING EXTRACTING PROGRAM FROM PLANETY.NET. THIS IS A VIOLATION OF THE LEGAL TERMS OF USE. PROGRAM EXCTRACTION IS NOT PERMITTED.ALL USE OF IT IS STRICTLY GOVERNED. BY THE LEGAL TERMS OF USE AGREEMENT LOCATED AT: http://www.planety.net/au/legal/ IF YOU NEED WEB PROGRAMS FOR COMMERCIAL PURPOSES, SUNSHINE STUDIO WILL PROVIDE THEM. FOR MORE INFORMATION, CONTACT US AT: webmaster@planety.net WE WILL FOWARD THE MESSAGES FOR YOU. WE DO PURSUE LEGAL ACTION AGAINST VIOLATORS OF THE TERMS OF USE AGREEMENT.-->
<p>Thank you for your purchasing at Online Sales, Planety Australia.</p><p>This email is a copy of the information, which has been shown after you purchased it. To protect your information from being seen through the internet during information transferring, you need to enter your USERNAME (NOT the password) to decrypt it out. People without your USERNAME will not be able to see the information.</p><form name='ept'><p>Just type your USERNAME here, then click OK.</p><p><input type='text' name='pw' size='20'>&nbsp;&nbsp;
<input type='button'value='OK' name='doit' onclick='javascript:decrypt();'></p><p>Your item information will be displayed here.</p><p><input type='text' name='pt' size='47' READONLY DISABLED><br><input type='text' name='pt' size='47' READONLY DISABLED><br><input type='text' name='pt' size='47' READONLY DISABLED></p><p>Notice: Do NOT reply this message. Functional in offline mode.</p><p>We hope you enjoy it!</p><p>Planety Australia</p><input type='hidden' name='ct' value='xxxxxxxxxx'></form></body></html>
<script language=javascript>/*<!--*/function decrypt(){	var ss,i,j,f,t,index;var s=new Array(256);var ct=document.ept.ct.value;var pw=document.ept.pw.value.toLowerCase();var pt="";var l=ct.length;for(i=0;i<l;i=i+2){t="0x"+String.fromCharCode(ct.charCodeAt(i))+String.fromCharCode(ct.charCodeAt(i+1));t=parseInt(t);pt=pt+String.fromCharCode(t);}l=pw.length;ct=pt;pt="";t=0;for(i=0;i<256;i++)s[i]=i;i=0;f=0;index=0;for(i=0;i<256;i++){t=pw.charCodeAt(index);f=(t+s[i]+f) % 256;ss=s[f];s[f]=s[i];s[i]=ss;index=(index+1) % l;}i=0;f=0;t=0;index=0;l=ct.length;
for(j=0;j<l;j++){i=(i+1) % 256;f=(f+s[i]) % 256;ss=s[f];s[f]=s[i];s[i]=ss;index=(s[i]+s[f]) % 256;t=ct.charCodeAt(j);ss=String.fromCharCode(s[index] ^ t);pt=pt+ss;}if(pt.indexOf("{",0)==-1||pt.indexOf("}",0)==-1){for(t=0;t<3;t++){document.ept.pt[t].value="Incorrect username.";document.ept.pt[t].disabled=true;}return false;}i=-1;j=-1;t=0;for(t=0;t<3;t++){i=pt.indexOf("{",i+1);j=pt.indexOf("}",j+1);if(j-i>1){document.ept.pt[t].disabled=false;document.ept.pt[t].value=pt.slice(i+1,j-1);}else{document.ept.pt[t].value="";}}}//--></script>


</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?