Recently I posted a JavaScript password script from a friend's site that was cracked by people here.
I have found this one on the net and modified it.
I think it is much harder to crack?
I have put up a test page here -
Gold star for anyone that cracks it
The code is below:
<center><form name=login>
<input type="hidden" value='John Smith|59364|OEIPPFGF' name="memlist" value="">
<input type=password size=10 maxlength=8 name=pass>
<input type=button value="Submit" onclick="check(this.form)">
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var params=new Array(4);
var alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI";
function check(form) {
which=form.memlist;
choice = form.memlist.value+"|";
p=0;
for (i=0;i<3;i++) {
a=choice.indexOf("|",p);
params=choice.substring(a,p);
p=a+1;
}
h1=makehash(form.pass.value,3);
h2=makehash(form.pass.value,10)+" ";
if (h1!=params[1]) {
alert("Incorrect Password!"
; return; };
var page="";
for (var i=0;i<8;i++) {
letter=params[2].substring(i,i+1)
ul=letter.toUpperCase();
a=alpha.indexOf(ul,0);
a-=(h2.substring(i,i+1)*1);
if (a<0) a+=26;
page+=alpha.substring(a,a+1); };
top.location=page.toLowerCase()+".html";
}
function makehash(pw,mult) {
pass=pw.toUpperCase();
hash=0;
for (i=0;i<8;i++) {
letter=pass.substring(i,i+1);
c=alpha.indexOf(letter,0)+1;
hash=hash*mult+c;
}
return(hash);
}
// End -->
</script>
</center>
I have found this one on the net and modified it.
I think it is much harder to crack?
I have put up a test page here -
Gold star for anyone that cracks it
The code is below:
<center><form name=login>
<input type="hidden" value='John Smith|59364|OEIPPFGF' name="memlist" value="">
<input type=password size=10 maxlength=8 name=pass>
<input type=button value="Submit" onclick="check(this.form)">
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var params=new Array(4);
var alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI";
function check(form) {
which=form.memlist;
choice = form.memlist.value+"|";
p=0;
for (i=0;i<3;i++) {
a=choice.indexOf("|",p);
params=choice.substring(a,p);
p=a+1;
}
h1=makehash(form.pass.value,3);
h2=makehash(form.pass.value,10)+" ";
if (h1!=params[1]) {
alert("Incorrect Password!"
var page="";
for (var i=0;i<8;i++) {
letter=params[2].substring(i,i+1)
ul=letter.toUpperCase();
a=alpha.indexOf(ul,0);
a-=(h2.substring(i,i+1)*1);
if (a<0) a+=26;
page+=alpha.substring(a,a+1); };
top.location=page.toLowerCase()+".html";
}
function makehash(pw,mult) {
pass=pw.toUpperCase();
hash=0;
for (i=0;i<8;i++) {
letter=pass.substring(i,i+1);
c=alpha.indexOf(letter,0)+1;
hash=hash*mult+c;
}
return(hash);
}
// End -->
</script>
</center>