php.net |  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
 [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:
#/usr/local/bin/php
<?php
print crypt("salt")."\n";
print crypt("thesame")."\n";
print crypt("again")."\n";
?>

Output:
i3lCe7C6q27tM
i3vw3zP1zAXbk
i3DLFUqiVZx.U

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-03 00:00 UTC] sniper@php.net
This is fixed in CVS. 
Please try this: http://www.php.net/distributions/php-4.0.4RC3.tar.gz 

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC