PDA

View Full Version : Resolved Encrypted password script help



javanewb
11-24-2008, 02:23 PM
I am trying to use the encrypted password for multiple logins. If I use just one login, it works wonderfully. I want to be able to have a multi-level access for about 100 different users. I'm sure it's something very simple in modifying the code, but I just don't know how. Any help would be greatly appreciated.

jscheuer1
11-24-2008, 03:42 PM
There are no secure encrypted passwords using just javascript (there are some that can be used with the server, but at that point, might as well do it all on the server). What code are you using? Does it need to be secure?

javanewb
11-24-2008, 08:46 PM
Thanks for the reply...it DOES NOT need to be secure. I just want to be able to assign different people different logins to access various places on the site. Here is the code that I am using, thanks for your help!

//Encrypted Password script- By Rob Heslop
//Script featured on Dynamic Drive
//Visit http://www.dynamicdrive.com

function submitentry(){
password = document.password1.password2.value.toLowerCase()
username = document.password1.username2.value.toLowerCase()
passcode = 1
usercode = 1
for(i = 0; i < password.length; i++) {
passcode *= password.charCodeAt(i);
}
for(x = 0; x < username.length; x++) {
usercode *= username.charCodeAt(x);
}
//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(usercode==12211815000&&passcode==3875481215424000)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location=password+".htm"}
else{
alert("Wrong Username/Password")}
}
</script>

</font>

<form name="password1">
<font face="Gill Sans MT" color="#FFFFFF">
<strong>Enter username: </strong>
<input type="text" name="username2" size="13">
<br>
<strong>Enter password:&nbsp; </strong>
<input type="password" name="password2" size="15">

<input type="button" value="submit" onClick="submitentry()" style="font-family: Gill Sans MT; color: #002244; font-variant: small-caps; font-weight: bold">
</font>
</form>

javanewb
11-25-2008, 10:30 PM
Nevermind, I have resolved this issue.