Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: My Encrypted Password Script :)

  1. #1
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default My Encrypted Password Script :)

    Hi,

    I've been working on this script for AGES.. it uses a series of numbers to figure out what the password is, and then verifies. It's almost like.. it's too good to be true, but that's exactly what I'm trying to figure out. I think there may be something wrong with it.

    The password is "password"

    So go ahead, I'm ready for insults.

    Code:
    <html>
    <head>
    <script>
    function securepass() {
    var alpha=new Array("","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
    var combo=new Array('',16,1,19,19,23,15,18,4)
    var notCorrect=false
    for (i=1;i<=combo.length-1;i++) {
    inputH.value=inputH.value.substring(0,i)+alpha[combo[i]]
    if (input.value==inputH.value) {alert("Correct Password");notCorrect=false;input.value=''}
    else {notCorrect=true}
    }
    if (notCorrect==true) {alert("Invalid Password");inputH.value='';input.value=''}
    }
    </script>
    </head>
    <body>
    <input id="input">
    <br><input type="button" value="Log In" onclick="securepass()">
    <input id="inputH" style="display:none">
    <br>Type in "password", and then try other combinations.
    </body>
    </html>
    - Mike

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    To be more specific, I'm looking for someone to verify this script.
    - Mike

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I'm no crypto expert, but I think this is reversible. It would certainly be possible to figure it out from the value of inputH...
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Thanks, I'll try to make it better. I honestly didn't know how to improve, so that's why I posted this thread.
    - Mike

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Ah, I see. The key here is to come up with an algorithm that, will take any data given to it and transform it in such a way that it can't be transformed back, and gives no clue as to the original data.

    Or, you could nick someone else's, like I did.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    So, I would create a number/letter pattern for a single letter, which would be hard to crack. Anyways, I'll be working on it for a while, so thanks for all your help
    - Mike

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    What I originally had as a password thingy was this: (it's horrible)

    Code:
    <script>
    function testPass() {
    if (input.value=="password") {alert("Correct")}
    else {alert("Incorrect")}
    }
    </script>
    So I kept trying to come up with a way to make it more secure. Then I came across a number/letter system to convert numbers to letters.

    I'll try to upgrade from here.
    - Mike

  8. #8
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    But I'm still not sure on how to do this.. I know I have to search a string for letters, and translate it into a series of characters. But that's pretty much it. Any help would be appreciated
    - Mike

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You have to do it in such a way that it can't be reversed.

    Look at Rob Heslop's for an idea (although not a role model): his script takes the ASCII value of each character and multiplies it in with the rest. That's irreversible, since there are quite a few possibilities that would yield the same result.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Could you provide a link to this?
    - Mike

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
  •