Doc #75772 [NEW]: Incorrect limit specified on blowfish passwords
| From: | Thomas_Gnandt at gmx dot net | Date: | Sun, 07 Jan 2018 11:55:28 +0000 |
| Subject: | Doc #75772 [NEW]: Incorrect limit specified on blowfish passwords | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-15319@lists.php.net to get a copy of this message | ||
From: Thomas_Gnandt at gmx dot net
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Incorrect limit specified on blowfish passwords
Description:
------------
The documentation states
"Using the PASSWORD_BCRYPT as the algorithm, will result in the password
parameter being truncated to a maximum length of 72 characters."
This is not true. The password is being truncated to a maximum length of
72 bytes. Since passwords should contain special characters, a lot of
which are multi-byte, this should be clarified.
This is incorrect both on the documentation for password_hash() as well
as the documentation for crypt().
Test script:
---------------
$pw = str_pad("", 71, 'a');
$salt = ['salt' => 'N9qo8uLOickgx2ZMRZoMye'];
echo password_hash($pw . 'a', PASSWORD_DEFAULT, $salt ) . PHP_EOL;
echo password_hash($pw . 'ä', PASSWORD_DEFAULT, $salt ) . PHP_EOL;
echo password_hash($pw . 'ö', PASSWORD_DEFAULT, $salt ) . PHP_EOL;
Expected result:
----------------
Three differnt hashes
Actual result:
--------------
$2y$10$N9qo8uLOickgx2ZMRZoMye5mlC/WoAmNnGP3YkHGchsBkco85S4ZC
$2y$10$N9qo8uLOickgx2ZMRZoMyeWZPaNHNhngTN.zngPxYMmerH0ZknF7.
$2y$10$N9qo8uLOickgx2ZMRZoMyeWZPaNHNhngTN.zngPxYMmerH0ZknF7.
--
Edit bug report at https://bugs.php.net/bug.php?id=75772&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75772&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75772&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75772&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75772&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75772&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75772&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75772&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75772&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75772&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75772&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75772&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75772&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75772&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75772&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75772&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75772&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75772&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75772&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75772&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75772&r=mysqlcfg