note 74144 deleted from function.md5 by tularis
| From: | tularis@php.net | Date: | Thu, 14 Jul 2011 22:53:48 +0000 |
| Subject: | note 74144 deleted from function.md5 by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-181532@lists.php.net to get a copy of this message | ||
Note Submitter: jlinkels at linkels dot net
----
The PHP MD5() function does not encrypt a string in the same way as the standard *nix MD5SUM
function.
If you want to access an encrypted string in a MySQL database from different programs in *nix, and
also from PHP, use the MySQL MD5() function, as in:
UPDATE users SET pwd=md5('mypass') WHERE user='myuser';
This will generate the same encrypted string as in PHP md5('mypass').
I am sure it has some security issues, especially if the traffic between the other application and
MySQL can be eavesdropped, but for simple encrypted storage it works fine.