Doc #54299 [NEW]: Error in a comment about salt generation (crypto)
| From: | krewecherl at gmail dot com | Date: | Fri, 18 Mar 2011 03:56:17 +0000 |
| Subject: | Doc #54299 [NEW]: Error in a comment about salt generation (crypto) | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-6101@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Error in a comment about salt generation (crypto)
Description:
------------
The comment by "thegreatall at gmail dot com" on the manual page for
mt_rand() describes a method for quickly generating a pseudo-random salt
for password hashes. One of the constants given in the example is incorrect
and can lead a smaller range from which the random numbers will be
selected.
The line -
base_convert(mt_rand(0x1679616, 0x39AA3FF, 10, 36);
- should be changed to either -
base_convert(mt_rand(1679616, 0x39AA3FF, 10, 36);
- or, if we want to keep the hex format, to -
base_convert(mt_rand(0x19A100, 0x39AA3FF, 10, 36);
Rationale: the number 0x19A100 (= 1679616 in decimal) will be represented
as 10000 in base-36, which is the intended value, whereas the given number
0x1679616 will be represented as e13iu in base-36.
Comment ID: 102318
Link: http://php.net/manual/en/function.mt-rand.php#102318
--
Edit bug report at http://bugs.php.net/bug.php?id=54299&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54299&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54299&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54299&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54299&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54299&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54299&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54299&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54299&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54299&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54299&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54299&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54299&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54299&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54299&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54299&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54299&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54299&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54299&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54299&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54299&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54299&r=mysqlcfg