Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i decrypt a password that had already encrypted using MD5 format in ASP.NET?
Posted

"... encrypted using MD5 format ...": No way, is encryption the same as a chryptographic hash. MD5[^] is a hashing algorithm and it works strictly one way. Once something has been hashed it can not be reconstructed from the hash.

Regards,

Manfred

[Edit - fixed your link - lewax00]
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 22-May-12 15:05pm    
That is correct, but I voted 4. First, the point is: decryption is not required -- lewax00 made a point. Also, it's important to warn against MD5 (and SHA-1) -- both algorithms are found broken, not suitable for security. I recommend SHA-1 family. Please see my answer.
--SA
Espen Harlinn 22-May-12 19:06pm    
5'ed!
You should never need to decrypt a password. What you should do is make a hash of the password (as stated in Manfred's answer, MD5 is a hashing algorithm) and store that. To verify a password, hash it and see if it matches the previously hashed password.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 22-May-12 15:04pm    
Good point, but I voted 4, because it's important to warn against MD5 (and SHA-1) -- both algorithms are found broken, not suitable for security. I recommend SHA-1 family. Please see my answer.
--SA
In addition to the answers by Manfred and lewax00: never use MD5 or SHA-1 for any security purposes. MD5 was proven to be broken in 2008, and SHA-1 flaw was found in 2005. Please see:
http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.mediaended%28v=vs.100%29.aspx[^],
http://en.wikipedia.org/wiki/SHA1[^].

Instead, I would advice using one of the algorithms from the SHA-2 family:
http://en.wikipedia.org/wiki/SHA2[^].

You will find implementation of all those algorithm in .NET:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.hashalgorithm.aspx[^].

—SA
 
Share this answer
 
Comments
Espen Harlinn 22-May-12 19:07pm    
Good points :-D
Sergey Alexandrovich Kryukov 22-May-12 19:44pm    
Thank you, Espen.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900