Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
decrypt sql binay password to string password in asp.net
Posted

1 solution

No, sorry, that doesn't make a lot of sense. But I will try to work out what you are trying to do...

MD5 doesn't have a password and can't be de-crypted. So what I think you are doing is working out the MD5 hash of a password, and storing it in an SQL Binary field.
Now, you want to either check if the user has entered the right password, or tell him what the password he entered is.

1) Check password. Do not attempt to work back from the SQL stored version to a string and compare them. Instead, generate the MD5 hash in exactly the same way that you did when you stored the password in the first place, and compare the two binary arrays. (there is a Tip covering some of this here: Password Storage: How to do it.[^]

2) Forget it. MD5 is not an encryption algorithm. It is a Hashing algorithm. The big difference is that encryption can be reversed: you can decrypt to get back to the one and only original. Hashing cannot - it is a one way process and you cannot get back to the one and only original from the MD5 value.
 
Share this answer
 

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