php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7964 crypt() destroys randomness of rand() ?
Submitted: 2000-11-24 12:02 UTC Modified: 2000-11-27 04:09 UTC
From: colin at easydns dot com Assigned:
Status: Closed Package: Math related
PHP Version: 4.0.3pl1 OS: RH6.2
Private report: No CVE-ID: None
 [2000-11-24 12:02 UTC] colin at easydns dot com
<PRE><?

srand ((double) microtime() * 1000000);

for ($i=0;$i<100;$i++) {
        $rand = rand();     
        echo $rand;
# try this script with and without the next line commented
#       echo ":".crypt($rand);
        echo "\n";
} 

?></PRE>

Also, crypt() seems to always use "i3" as a salt.  I'm guessing this is somehow related.

- Colin

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-27 04:09 UTC] sniper@php.net
Fixed in CVS already. Reopen this bug report if problem
still exists using latest snapshot from http://snaps.php.net/

--Jani
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Nov 28 15:03:14 2021 UTC