|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8080 crypt() does not generate random salts
Submitted: 2000-12-02 20:37 UTC Modified: 2000-12-03 00:00 UTC
From: joel dot jacobson at mobigym dot se Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.3pl1 OS: Linux 2.4.0-test11
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: joel dot jacobson at mobigym dot se
New email:
PHP Version: OS:


 [2000-12-02 20:37 UTC] joel dot jacobson at mobigym dot se
When I use the crypt() function to generate hashes the salts are not randomly generated.

An example:
print crypt("salt")."\n";
print crypt("thesame")."\n";
print crypt("again")."\n";


(Adding srand ((double) microtime() * 1000000); in the beginning didn't help)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-03 00:00 UTC]
This is fixed in CVS. 
Please try this: 

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Dec 05 16:01:29 2023 UTC