I have saved user passwords in MD5 form in my database, now I want to send password to users in plaintext, is there any way I can convert an MD5 string to plaintext?
You cannot reverse the MD5 function, so your only option is to generate a new password and send that to the user (preferably over some secure channel).
Hash functions are not reversible in general. MD5 is a 128-bit hash, and so it maps any string, no matter how long, into 128 bits. Obviously if you run all strings of length, say, 129 bits, some of them have to hash to the same value.
It is pretty feasible if your passwords are hashed without a salt. Show activity on this post. MD5 is a hashing algorithm, you can not revert the hash value. You should add "change password feature", where the user gives another password, calculates the hash and store it as a new password.
Md5 is a hashing algorithm. There is no way to retrieve the original input from the hashed result.
If you want to add a "forgotten password?" feature, you could send your user an email with a temporary link to create a new password.
Note: Sending passwords in plain text is a BAD idea :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With