dcooldude_1
03-02-04, 01:02 AM
In addition to my last post in this bored about an unbreakable security script.... I was informed that it is possible to by-pass it and find the username and password.... Could some on please review my script and tell me how to make it unbreakable?!
P.S. It's not PHP... It's Javascript... I put the tags to color code it...
//<!--Hide from old browsers
function passcheck()
{
numarr = 0
access = "no";
whereto = "no";
// Do Not change this block of code!
user = prompt("Input your username:","username");
pass = prompt("Input password for "+user+":","");
who = user+","+pass;
// Read instructions below on how to change this line!
valid = new Array(1);
// Change only the stuff in the quotes!
// Don't forget that the username,password must be in that form!
valid[0] = "tester,testing";
// Do NOT change the code below!
if (who == valid[0]){ checksout(); whereto = "test.html"; }
// Do NOT change the following unless you know what you are doing!
if (access == "no")
{
alert("Wrong username/password!");
alert("Access: Denied");
window.location="invalid.html";
}
if (access == "yes")
{
NewWindow('valid', '475', '475', 'no');
window.location="loggedin.html";
}
}
function NewWindow(myname, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scrollbars='+scroll+',resizable=0'
win = window.open(whereto, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function checksout()
{
alert("Access: Granted");
access = "yes";
}
// stop hiding script -->
PLEASE HELP ME OUT!!! I WILL GIVE YOU CREDIT EVERYWHERE FOR IT!!!!!
P.S. It's not PHP... It's Javascript... I put the tags to color code it...
//<!--Hide from old browsers
function passcheck()
{
numarr = 0
access = "no";
whereto = "no";
// Do Not change this block of code!
user = prompt("Input your username:","username");
pass = prompt("Input password for "+user+":","");
who = user+","+pass;
// Read instructions below on how to change this line!
valid = new Array(1);
// Change only the stuff in the quotes!
// Don't forget that the username,password must be in that form!
valid[0] = "tester,testing";
// Do NOT change the code below!
if (who == valid[0]){ checksout(); whereto = "test.html"; }
// Do NOT change the following unless you know what you are doing!
if (access == "no")
{
alert("Wrong username/password!");
alert("Access: Denied");
window.location="invalid.html";
}
if (access == "yes")
{
NewWindow('valid', '475', '475', 'no');
window.location="loggedin.html";
}
}
function NewWindow(myname, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scrollbars='+scroll+',resizable=0'
win = window.open(whereto, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function checksout()
{
alert("Access: Granted");
access = "yes";
}
// stop hiding script -->
PLEASE HELP ME OUT!!! I WILL GIVE YOU CREDIT EVERYWHERE FOR IT!!!!!