Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have problem understanding the jscript below, assume that I run the start running the function testEncode
thanks in advance.
function testEncode(form) {
var dater = new Date();
Day = dater.getDate();
dater = null;
var Ret = encode (form.inputbox1.value, Day)
location = Ret + ".php"
}function encode (OrigString, CipherVal) {
Ref="0123456789abcdefghijklmnopqrstuvwxyz._~ABCDEFGHIJKLMNOPQRSTUVWXYZ"
CipherVal = parseInt(CipherVal)
var Temp=""
for (Count=0; Count OrigString.length; Count++) {
var TempChar = OrigString.substring (Count, Count+1)
var Conv = cton(TempChar)
var Cipher=Conv^CipherVal
Cipher=ntoc(Cipher)
Temp += Cipher
}
return (Temp)
}function cton (Char) {
return (Ref.indexOf(Char));
}function ntoc (Val) {
return (Ref.substring(Val, Val+1))
}

I didn't find a problem with it, aside from the code styling.
Try this:
function testEncode(form) {
var dater = new Date();
var Day = dater.getDate();
location.href= encode( form.inputbox1.value, Day ) + ".php" );
}function encode( OrigString, CipherVal ) {
var Ref = "0123456789abcdefghijklmnopqrstuvwxyz._~ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var Temp = "";
for( Count = 0; Count OrigString.length; Count++ ) {
Temp += Ref.charAt( Ref.indexOf( OrigString.charAt( Count ) ) ^ parseInt( CipherVal ) );
}
return Temp;
}And remember to put in the less than sign between Count and OrigString.length in the for(;;) loop declaration.

em, I understand there isnt any problem with the code and it can run but does it review to ppl the password to following page?
do you think is insecure?
can you get the password that you need to type in in order to get to the next page?
if you can it means is insecure.
thank you again.

![]() |
vb 6 preforming file sear...
|
Urgent: need help with c+...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |