PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi,
Is it possible to "unMD5" a srting?
for example:
$password=md5('123')
// $password will be "202cb962ac59075b964b07152d234b70"
So,is it possible to know $password is "123" by "unMD5" the string "202cb962ac59075b964b07152d234b70"?? Sorry for my english!
$userpasswd; // Password provided by user
$dbpassword; // Password in database, as md5 checksum.
if($dbpassword == md5($userpass){
// Wheee, we had the right pass.
} else {
// Sorry, no access here.
}
This is how unix make it. You can't check what a user password is. It's a oneway crypto algorithm.
I don't know how it got this label, but md5 is not actually encryption, it's a simple checksum to verify data. That's why it's only a one way algorithm. Look into libs such as mcrypt or openssl to get two way (encrypt/decrypt) encyption.
you loose data on md5. It would be amazing to keep all information of a 5GB file in a 32-digit-number
The 'only' purpose of md5 is to guarantee that even a small change in the source (how big the source may be) will result in a change of the md5-checksum