Decode password

Discussion in 'Ruby' started by Mitesh Jain, Apr 27, 2007.

  1. Mitesh Jain

    Mitesh Jain Guest

    Hi All,
    i had encoded the password using,

    Digest::SHA1.hexdigest("change-me--#{pass}--")

    i got the password in the encoded form and i want to decode this string.

    How can i do this?

    --
    Posted via http://www.ruby-forum.com/.
    Mitesh Jain, Apr 27, 2007
    #1
    1. Advertising

  2. Mitesh Jain

    Guest

    Thats impossible, basically. A hash is a one-way function.
    You could brute force it if you wanted, good luck waiting for
    eternity...

    Cheers

    On Apr 27, 6:51 pm, Mitesh Jain <> wrote:
    > Hi All,
    > i had encoded the password using,
    >
    > Digest::SHA1.hexdigest("change-me--#{pass}--")
    >
    > i got the password in the encoded form and i want to decode this string.
    >
    > How can i do this?
    >
    > --
    > Posted viahttp://www.ruby-forum.com/.
    , Apr 27, 2007
    #2
    1. Advertising

  3. Mitesh Jain

    ChrisKaelin Guest

    On 27 Apr., 11:06, wrote:
    > Thats impossible, basically. A hash is a one-way function.
    > You could brute force it if you wanted, good luck waiting for
    > eternity...
    >


    What a luck for us unix-administrators ;-)

    That's why unix-passwords are so safe since many years. Even if
    someone else than root can read (/etc/shadow) you can only brute-force
    that stuff and that can take some time, because even if the password
    is very short, the hash always is at least 13 characters long...
    ChrisKaelin, Apr 27, 2007
    #3
  4. On 4/27/07, Mitesh Jain <> wrote:
    > Hi All,
    > i had encoded the password using,
    >
    > Digest::SHA1.hexdigest("change-me--#{pass}--")
    >
    > i got the password in the encoded form and i want to decode this string.


    Perhaps you are trying to do authentication like this? The usual
    method is to encode the password on the other side in the same way and
    compare the hashes. You send the hash over the wire so that anyone
    capturing the hash cannot get the password.

    You may want to google and read up on Challenge Response
    authentication, there are many great articles.


    --=20
    If you could create a machine that copies hamburgers =97 you put one
    hamburger in and two equally good hamburgers come out the other side =97
    it would be unethical not to do so and make it freely available.
    Leslie Viljoen, Apr 27, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. feng
    Replies:
    4
    Views:
    1,287
  2. Luqman
    Replies:
    5
    Views:
    845
  3. AAaron123
    Replies:
    2
    Views:
    2,090
    AAaron123
    Jan 16, 2009
  4. AAaron123
    Replies:
    1
    Views:
    1,310
    Oriane
    Jan 16, 2009
  5. PerlFAQ Server
    Replies:
    0
    Views:
    107
    PerlFAQ Server
    Mar 2, 2011
Loading...

Share This Page