js加解密 脚本解密
作者:
利用js异或算法实现脚本加解密的代码
function MyDecode(str)
{
var i,k,str2="";
k=str.split(".");
for(i=0;i<k.length;i++)
{
str2+=String.fromCharCode(k[i]^0x12);
}
return str2;
}
myrand="46.97.115";
WScript.echo(MyDecode(myrand));
function Encrypt(str)
{
var monyer = new Array();
var i, s, str;
for (i = 0; i < str.length; i++)
{
monyer += str.charCodeAt(i)^0x12
monyer+=".";
}
return monyer;
}
WScript.Echo(Encrypt("<script>alert('ok')</script>").replace(/.$/,""));
{
var i,k,str2="";
k=str.split(".");
for(i=0;i<k.length;i++)
{
str2+=String.fromCharCode(k[i]^0x12);
}
return str2;
}
myrand="46.97.115";
WScript.echo(MyDecode(myrand));
function Encrypt(str)
{
var monyer = new Array();
var i, s, str;
for (i = 0; i < str.length; i++)
{
monyer += str.charCodeAt(i)^0x12
monyer+=".";
}
return monyer;
}
WScript.Echo(Encrypt("<script>alert('ok')</script>").replace(/.$/,""));