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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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:
#/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: Fri Apr 26 07:01:32 2024 UTC