php code to convert password from md5 to the normal set password

Recommended Answers

All 6 Replies

md5 is function you can use one way only, you can not find the password by any reverse kind of function.

better you regenerate new password in case user forget password.

If you are trying to validate stored password with user entered password, just convert the user entered password with md5 and compare.

if(md5($userJustEnteredPassword) == $storedMD5String)
{
    // Passwords match
}
else
{
   // Passwords does not match
}
Member Avatar for diafol

You should NEVER reverse a modified password. The whole point of it is that NOBODY (including the site owner) can access the original string. New passwords should be set and sent along with a one-time reactivation link via e-mail. The user should then be prompted (or forced) to change the 'temporary' password.

I believe he is looking for an algorithm that can reverse md5 hashes which I can easily provide and a computer which can process the algorithm. To have a computer to process the algorithm, you would need to invent the zero point module (zpm) to power a computer which is the size of Jupiter if using today’s technology and it would take a lot of money to build the computer the size of the planet Jupiter powered by a zero point module along with the lengthy time to get a network cable from earth to Jupiter. Theoretically possible but very hard to do.

@cwarn23: Nice idea :D :D

I believe he is looking for an algorithm that can reverse md5 hashes which I can easily provide and a computer which can process the algorithm. To have a computer to process the algorithm, you would need to invent the zero point module (zpm) to power a computer which is the size of Jupiter if using today’s technology and it would take a lot of money to build the computer the size of the planet Jupiter powered by a zero point module along with the lengthy time to get a network cable from earth to Jupiter. Theoretically possible but very hard to do.

You didn't hear about the vulnerabilities of MD5 the were discovered back in 1996? And how it can be cracked in minutes with one laptop? In the PHP world, it's just another layer of security in case someone gains access to the machine on which the file containing the passwords resides. The MD5'd version of the password doesn't go across the network since the comparison takes place on the server, so for PHP password checking it's fine.

A computer the size of Jupiter? Seriously dude? I doubt that you'll be providing the algorithm anytime soon either. Other than those issues, cool post, bro.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.