|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: colin at easydns dot com
New email:
PHP Version: OS:


 [2000-11-24 12:02 UTC] colin at easydns dot com

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";


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

- Colin


Add a Patch

Pull Requests

Add a Pull Request


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

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 05:01:28 2024 UTC