encode| Code | Script Encoding Example
The following is a short example that contains JScript code that needs to be protected:
<HTML>
<HEAD>
<TITLE> Script Encoder Sample page </TITLE>
<script language= "JScript" >
<!--//
copyright©1998 Microsoft Corporation. All Rights Reserved.
* * Start Coding * *
function Verifycorrectbrowser () {
if (navigator.appname = = "Microsoft Internet Explorer")
if (Navigator.appVersion.indexOf ("5.") >= 0)
return (true);
Else
return (false);
}
function Getappropriatepage () {
var str1 = "Had This been the actual Web site, a page compatible with";
var str2 = "browsers other than";
var str3 = "Microsoft Internet Explorer 5.0";
var STR4 = "would have been loaded.";
if (Verifycorrectbrowser ())
document.write (str1 + STR3 + STR4);
Else
document.write (str1 + str2 + str3 + STR4);
}
-->
</SCRIPT>
</HEAD>
<body onload= "Getappropriatepage ()" >
</BODY>
</HTML>
The page, which is run after the script encoder, looks like this:
<HTML>
<HEAD>
<TITLE> Script Encoder Sample page </TITLE>
<script language= "Jscript.encode" >
<!--//
copyright©1998 Microsoft Corporation. All Rights Reserved.
* * Start Coding **#@~^qwiaaa==@#@&0; MDKW p7ndb0zzkd.n1yamghk+dvb ' @#@&p,kw ' uc7klldgdcl22gl:n~{' ~jtr1dgkw6yp&xdnd +OPA62sKD+ME#@#@&P,~~ K6pvxc\rlmygdccwa.n.kkwu Bx+x66pcr*cj#,@*{~!*p~p,p~.yemu ' ddebip,p,+s/n@#@&p~p,~pm+o; Mx ' wc^/n#pn6eu1ybwx,oobaw.wadrcd+nml+v# @#@&~p7lmpdy.q, ' ~j_cn,y4rkp4nn pcx,c1y;mv,+ (PkrY~~l,wCLPmKhwmYk ( snpskdt~ji@#@&p~\m.pky.+, ' pe8mwa/.kpgdtdpdtmupri@#@&,p-cmp/d.&, ' pr\rmmwkwwy~ (YnD nY,2a2^WDn.,*!, EP@#@&,P7LD,/D.C, ' ~jsw;s9ptm-+,4+u~vkl9+[rei,pr0,c\drwhzw. Moamgs/nm ' *#@#@&p,~p9w^es+uochdbo+v/ymq~_,/ddfpq~ky.c*ip,+sd@#@&~~,p[w1;s+udrsdkd+vdymf~_,/o.yp_,dym &p3~dymc*inz&r @*^#~@
-->
</SCRIPT>
</HEAD>
<body onload= "Getappropriatepage ()" >
</BODY>
</HTML>
Important: After coding, if you change the encoded text, even if only one word change. The integrity of the script is lost and can no longer be used.