Results 1 to 4 of 4

Thread: Encrypted password script help

  1. #1
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Encrypted password script help

    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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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>

  4. #4
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nevermind, I have resolved this issue.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •