Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

somecode

Status
Not open for further replies.

hillbillyfritz

Technical User
Mar 28, 2001
34
US
I am new at javascript and was wondering if someone could explain this code to me.

<script>
function somecode( s ) { var sRet=&quot;&quot;; for(j=0; j< s.length; j++ ){ var n= s.charCodeAt(j); if (n>=8364) {n = 128;} sRet += String.fromCharCode( n - 3 ); } return( sRet ); }
var sJsCmds =&quot;&quot; +
&quot;?iudphvhw#frov@%-/483%#iudphvsdflqj@%#erughu@%3%#iudpherughu@%3%A##?iudphvhw#frov@%4:3/-%A##?qriudphvA?erg|A?2vfulswA##?sAWklv#sdjh#xvhv#iudphv/#exw#|rxu#eurzvhu#grhvq*w#vxssruw#wkhp1?2sA##?2erg|A##?2qriudphvA##?iudph#qdph@%ohiwphqx%#wdujhw@%pdlq%#vuf@%ohiwphqx1kwp%#vfuroolqj@%dxwr%#qruhvl}h#pdujlqzlgwk@%8%#pdujlqkhljkw@%8%A##?iudph#qdph@%pdlq%#vuf@%qhzv1kwp%A##?2iudphvhwA##?iudph#vuf@%uljkwphqx1kwp%#pdujlqzlgwk@%8%#pdujlqkhljkw@%8%#vfuroolqj@%dxwr%#qdph@%uljkwphqx%#qruhvl}h#wdujhw@%bvhoi%A?2iudphvhwA&quot; +
&quot;&quot;;
var s= somecode( sJsCmds);
document.write (s);
</script>

Thanks in advance :)
 
The scripting you are looking at is an encryption attempt. The var sJsCmds =&quot;&quot; +
&quot;?iudphvhw#frov@%-/483%#iudphvsdflqj@%#erughu@%3%#iudpherughu@%3%A##?iudphvhw#frov@%4:3/-%A##?qriudphvA?erg|A?2vfulswA##?sAWklv#sdjh#xvhv#iudphv/#exw#|rxu#eurzvhu#grhvq*w#vxssruw#wkhp1?2sA##?2erg|A##?2qriudphvA##?iudph#qdph@%ohiwphqx%#wdujhw@%pdlq%#vuf@%ohiwphqx1kwp%#vfuroolqj@%dxwr%#qruhvl}h#pdujlqzlgwk@%8%#pdujlqkhljkw@%8%A##?iudph#qdph@%pdlq%#vuf@%qhzv1kwp%A##?2iudphvhwA##?iudph#vuf@%uljkwphqx1kwp%#pdujlqzlgwk@%8%#pdujlqkhljkw@%8%#vfuroolqj@%dxwr%#qdph@%uljkwphqx%#qruhvl}h#wdujhw@%bvhoi%A?2iudphvhwA&quot; +
&quot;&quot;;
is actually encrypted html.

The call to
function somecode( s )
{
var sRet=&quot;&quot;;
for(j=0; j< s.length; j++ )
{
var n= s.charCodeAt(j);
if (n>=8364)
{
n = 128;
}
sRet += String.fromCharCode( n - 3 );
}
return( sRet );
}
is decrypting it prior to the document write putting it on the screen.

All the code actually does though is produce three frames on the screen and call three seperate pages for each one.

Boring really.

DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
Do you know of any generators where you could encrypt something like that?
 
The only one i can think of is,


However it is a bit bulky, but thats the price you pay for hiding your code.

Mind if i ask WHY you wanna hide your source code in this manner, even though i have shown you that you can hack it very easily???

Stick this coding into a page and look at it, very easily hacked eh? I haven't changed that much coding have i?

[ignore]
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<title>Hacker</title>
</head>
<script>
function somecode( s ) { var sRet=&quot;&quot;; for(j=0; j< s.length; j++ ){ var n= s.charCodeAt(j); if (n>=8364) {n = 128;} sRet += String.fromCharCode( n - 3 ); } return( sRet ); }
var sJsCmds =&quot;&quot; +
&quot;?iudphvhw#frov@%-/483%#iudphvsdflqj@%#erughu@%3%#iudpherughu@%3%A##?iudphvhw#frov@%4:3/-%A##?qriudphvA?erg|A?2vfulswA##?sAWklv#sdjh#xvhv#iudphv/#exw#|rxu#eurzvhu#grhvq*w#vxssruw#wkhp1?2sA##?2erg|A##?2qriudphvA##?iudph#qdph@%ohiwphqx%#wdujhw@%pdlq%#vuf@%ohiwphqx1kwp%#vfuroolqj@%dxwr%#qruhvl}h#pdujlqzlgwk@%8%#pdujlqkhljkw@%8%A##?iudph#qdph@%pdlq%#vuf@%qhzv1kwp%A##?2iudphvhwA##?iudph#vuf@%uljkwphqx1kwp%#pdujlqzlgwk@%8%#pdujlqkhljkw@%8%#vfuroolqj@%dxwr%#qdph@%uljkwphqx%#qruhvl}h#wdujhw@%bvhoi%A?2iudphvhwA&quot; +
&quot;&quot;;
var s= somecode( sJsCmds);
</script>
<body>
<textarea cols=80 rows=5 name=hack></textarea>
<script>
hack.value = s
</script>
</body>
</html>
[/ignore]

DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
I am not really trying to hide the html, but rather to trick the browser. When a person saves the page all of the frames are saved, but with the encoding the browser only saves the index file (the only file I want to encode). I know it is not fool-proof, but just a mere attempt to keep some people out. Thanks for all of the help :)
 
Anytime! DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top