On Nov 9, 2009, at 4:18 PM, madhuri godade wrote:
> Hello,
>
> I want decrypt a password which is encrypted by MD5.
> there are 4 functions which i am using :
>
> # Encrypts some data with the salt.
> def self.encrypt(password, salt)
> Digest::SHA1.hexdigest("--#{salt}--#{password}--")
> end
* Chop *
Madhuri, this is list is called "Rails Core", meaning code, problems and issues
relating to Rails code itself. Perhaps, you should try some other lists for your code
which is unrelated to Rails itself in the future.
In any case, MD5 is a hashing algorithm and a one-way function. Meaning, once
you get a hash, there is no way to get the original data back.
Also, in the code snippets that you gave, you are using SHA1: which is completely
different from MD5.
Cheers,
Amol Hatwar