加密.hta代码(完全可以保存为html,执行效果一样)
程序代码
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<머리>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>设置加密邮件内容</title>
<스크립트 유형="텍스트/자바스크립트">
함수 itArt(){
this.html="안녕하세요";
this.css="color:#000;width:640px;text-indent:20px;padding:5px;border:solid 5px #666;margin:5px;배경:#CCC;margin-left:auto;margin-right: 자동";
this.길이=0;
}
itArt.prototype = {
초기화:함수(){
this.length=this.html.length;
},
재생:함수(){
this.init();
this.setPassword();
this.echo();
},
setHtml:함수(v){
this.html=v;
},
setPassword:함수(){
var tmp="";
for(var i=0;i<this.length;i++){
tmp+="$"+this.html.charCodeAt(i);
}
this.html=tmp;
tmp="";
for(var i=0;i<this.html.length;i+=3){
tmp+=" "+this.html.substr(i,3);
}
this.html=tmp;
tmp="";
for(var i=0;i<this.html.length;i++){
tmp+=" "+this.html.charCodeAt(i);
}
this.html=tmp;
},
에코:함수(){
var t=document.createElement("div");
t.innerHTML=this.html;
if(window.ActiveXObject)
t.style.cssText=this.css;
또 다른
t.setAttribute("style",this.css);
//사용할 수 없는 DOM删掉子 元素了,反想各浏览器都支持
document.getElementById("x100").innerHTML="";
document.getElementById("x100").appendChild(t);
}
}
함수 setPassword(t){
if(t!=""){
var 데모=새로운 itArt();
데모.setHtml(t);
데모.플레이();
}또 다른{
Alert("请输入内容开始加密");
}
}
window.onload=함수(){
setPassword("你好,猜猜我给你的密文是什么? 哈哈,猜不到吧");
}
</script>
</head>
<본문>
<textarea style="display:block;color:#000;width:640px;height:280px;text-indent:20px;border:solid 5px #666;margin:5px; background:#FFF;margin-left:auto; margin-right:auto" ondblclick="setPassword(this.value);" title="双击开始加密">你好,猜猜我给你的密文是什么? 哈哈,猜不到吧</textarea>
<div ID="x100">
</div>
</body>
</html>
解密
程序代码
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<머리>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>获取加密邮件内容</title>
<스크립트 유형="텍스트/자바스크립트">
함수 itArt(){
this.html="안녕하세요";
this.css="color:#000;width:640px;text-indent:20px;padding:5px;border:solid 5px #666;margin:5px;배경:#CCC;margin-left:auto;margin-right: 자동";
this.길이=0;
}
itArt.prototype = {
초기화:함수(){
this.length=this.html.length;
},
재생:함수(){
this.init();
this.setPassword();
this.echo();
},
setHtml:함수(v){
this.html=v;
},
setPassword:함수(){
var tmp=this.html.split(" "),tmps="";
for(i=0;i<tmp.length;i++){
tmps+=String.fromCharCode(tmp[i]);
}
this.html=tmps.replace(" ","");
tmps="";
tmp=this.html.split("$");
for(i=0;i<tmp.length;i++){
if(tmp[i]!=""&&tmp[i]!=0){
tmps+=String.fromCharCode(tmp[i].replace(" ",""));
}
}
this.html=tmps;
},
에코:함수(){
var t=document.createElement("div");
t.innerHTML=this.html;
if(window.ActiveXObject)
t.style.cssText=this.css;
또 다른
t.setAttribute("style",this.css);
//사용할 수 없는 DOM删掉子 元素了,反想各浏览器都支持
document.getElementById("x100").innerHTML="";
document.getElementById("x100").appendChild(t);
}
}
데모=새로운 itArt();
데모.setHtml();
함수 getPassword(t){
if(t!=""){
var 데모=새로운 itArt();
데모.setHtml(t);
데모.플레이();
}또 다른{
Alert("请输入内容开始解密");
}
}
window.onload=함수(){
getPassword("32 36 50 48 32 51 50 48 32 36 50 50 32 57 48 57 32 36 54 53 32 50 57 50 32 36 50 57 32 52 54 56 32 36 50 57 32 52 54 6 32 36 50 53 32 49 48 53 32 36 51 50 32 52 55 51 32 36 50 48 32 51 50 48 32 36 51 48 32 51 52 48 32 36 50 51 32 52 57 52 32 36 50 53 32 57 57 49 32 36 50 54 32 49 53 57 32 36 50 48 32 49 54 48 32 36 50 48 32 48 52 48 32 36 54 53 32 51 49 49 32 36 51 50 32 36 50 49 32 55 48 52 32 36 50 49 32 55 48 52 32 36 54 53 32 50 57 50 32 36 50 57 32 52 54 56 32 36 49 57 32 57 56 49 32 36 50 49 32 48 52 48 32 36 50 49 32 53 52 51");
}
</script>
</head>
<본문>
<textarea style="display:block;color:#000;width:640px;height:280px;text-indent:20px;border:solid 5px #666;margin:5px; background:#FFF;margin-left:auto; margin-right:auto" ondblclick="getPassword(this.value);" title="双击开始解密">32 36 50 48 32 51 50 48 32 36 50 50 32 57 48 57 32 36 54 53 32 50 57 50 32 36 50 57 32 52 54 56 32 36 50 57 32 52 54 56 32 36 50 53 32 49 48 53 32 36 51 50 32 52 55 51 32 36 50 48 32 51 50 48 32 36 51 48 32 51 52 48 32 36 50 51 32 52 57 52 32 36 50 53 32 57 57 49 32 36 50 54 32 49 53 57 32 36 50 48 32 49 54 48 32 36 50 48 32 48 52 48 32 36 54 53 32 51 49 49 32 36 51 50 32 36 50 49 32 55 48 52 32 36 50 49 32 55 48 52 32 36 54 53 32 50 57 50 32 36 50 57 32 52 54 56 32 36 49 57 32 57 56 49 32 36 50 49 32 48 52 48 32 36 50 49 32 53 52 51
<div ID="x100">
</div>
</body>
</html>