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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: colin at easydns dot com
New email:
PHP Version: OS:

 

 [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: Tue Nov 30 03:03:16 2021 UTC