|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-08-17 13:03 UTC] jo at feuersee dot de
Description:
------------
If crypt() is executed with MD5 salts, the return value conists of the salt only.
DES and BLOWFISH salts work as expected.
I tested with php from openSUSE PHP5 repository
> php -v
PHP 5.3.7RC6-dev (cli)
> rpm -q php5
php5-5.3.6.201108112132-94.1.x86_64
Test script:
---------------
printf("MD5: %s\n", crypt('password', '$1$U7AjYB.O$'));
Expected result:
----------------
MD5: $1$U7AjYB.O$L1N7ux7twaMIMw0En8UUR1
Actual result:
--------------
MD5: $1$U7AjYB.O
Patches80 (last revision 2011-09-20 04:05 UTC by michaeloses_18 at hotmail dot com)Pull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 09:00:02 2025 UTC |
Verified for PHP5.3.7 > php -v PHP 5.3.7 (cli) > php -r 'printf("%s\n", crypt("password"));' $1$p4uaO1jN Note that only the salt is returned. AFAIK MD5 is the default encryption type. The big problem is that if an application stores this hashes in a database and uses them for authentication, the problem with this bug is that $valid = crypt($pw, $crypt); will always be TRUE regardless of $pw We do have a serious problem here. I suggest recalling 5.3.7 and go for a 5.3.7pl1