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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 13:01:30 2025 UTC