Bug #66874 [NEW]: Hashing gives same output for a specific string
| From: | amish dot mhatre dot 1993 at gmail dot com | Date: | Mon, 10 Mar 2014 01:53:00 +0000 |
| Subject: | Bug #66874 [NEW]: Hashing gives same output for a specific string | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-184671@lists.php.net to get a copy of this message | ||
From: amish dot mhatre dot 1993 at gmail dot com
Operating system: Windows 7
PHP version: 5.4.26
Package: hash related
Bug Type: Bug
Bug description:Hashing gives same output for a specific string
Description:
------------
---
From manual page: http://www.php.net/function.crypt
---
Test script:
---------------
<?php
echo "Using Salt: tRySalTIng@free ";
echo "<br><br>";
$pwd="1234567890";
$ped=crypt($pwd,'tRySalTIng@free');
echo "1234567890: ".$ped."<br><br>";
$pwd="123456789123";
$ped=crypt($pwd,'tRySalTIng@free');
echo "123456789123: ".$ped."\n";
echo "<br><br>";
echo "<br><br>";
echo "Using Salt: BLA&ZE11005!@98 ";
echo "<br><br>";
$pwd="1234567890";
$ped=crypt($pwd,'BLA&ZE11005!@98');
echo "1234567890: ".$ped."<br><br>";
$pwd="123456789123";
$ped=crypt($pwd,'BLA&ZE11005!@98');
echo "123456789123: ".$ped."\n";
?>
Expected result:
----------------
Got following output:
Using Salt: tRySalTIng@free
1234567890: tRIrkXjwVoQ4E
123456789123: tRIrkXjwVoQ4E
Using Salt: BLA&ZE11005!@98
1234567890: BLBaYGP/QWoPM
123456789123: BLBaYGP/QWoPM
Both gave same hashed values for above strings. Well try to checkout
this bug asap because it is not at all safe regarding security point of
view.
--
Edit bug report at https://bugs.php.net/bug.php?id=66874&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66874&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66874&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66874&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66874&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66874&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66874&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66874&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66874&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66874&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66874&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66874&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66874&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66874&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66874&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66874&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66874&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66874&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66874&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66874&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66874&r=mysqlcfg