[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Decode password

Mitesh Jain

4/27/2007 8:51:00 AM

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-....

3 Answers

chris.hulbert

4/27/2007 9:07:00 AM

0

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 <mitijain...@gmail.com> 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-....


ChrisKaelin

4/27/2007 5:59:00 PM

0

On 27 Apr., 11:06, chris.hulb...@gmail.com 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...

Leslie Viljoen

4/27/2007 8:31:00 PM

0

On 4/27/07, Mitesh Jain <mitijain123@gmail.com> 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.


--
If you could create a machine that copies hamburgers — you put one
hamburger in and two equally good hamburgers come out the other side —
it would be unethical not to do so and make it freely available.