Bug #69707 [NEW]: Crypt outputs different hash depending on PHP version

From: Date: Mon, 25 May 2015 20:01:52 +0000
Subject: Bug #69707 [NEW]: Crypt outputs different hash depending on PHP version
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192885@lists.php.net to get a copy of this message
From: jdavis at outlook dot com Operating system: Linux PHP version: Irrelevant Package: hash related Bug Type: Bug Bug description:Crypt outputs different hash depending on PHP version Description: ------------ Using the crypt function, identical code will result in an output that will vary depending on the PHP version. Test script: --------------- <?php $salt = "KFtIFW1vulG5nUH3a0Mv"; $password = "testtest"; $key = '$2y$07$'; $key = $key.$salt."$"; echo crypt($password, $key); ?> Expected result: ---------------- I expect the result to be the same for every version, as this function can be used for login/passwords and updating PHP can result in an unusable login. Actual result: -------------- An example can be seen here: http://3v4l.org/qqHUe -Output for 5.3.7 - 5.4.41, 5.5.21 - 5.5.25, 5.6.5 - 5.6.9: $2y$07$KFtIFW1vulG5nUH3a0Mv$.0imhrNa/laTsN0Ioj5m357/a8AxxF2q -Output for 5.5.0 - 5.5.20, 5.6.0 - 5.6.4: $2y$07$KFtIFW1vulG5nUH3a0Mv$e0imhrNa/laTsN0Ioj5m357/a8AxxF2q -- Edit bug report at https://bugs.php.net/bug.php?id=69707&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69707&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69707&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69707&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69707&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69707&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69707&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69707&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69707&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69707&r=support Expected behavior: https://bugs.php.net/fix.php?id=69707&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69707&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69707&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69707&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69707&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69707&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69707&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69707&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69707&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69707&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69707&r=mysqlcfg

« previous php.bugs (#192885) next »