php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6844 Automtic salt for crypt() does not seem to work
Submitted: 2000-09-22 00:57 UTC Modified: 2000-11-03 12:35 UTC
From: johanp at aditus dot nu Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.2 OS: Linux 2.2.16
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
34 + 44 = ?
Subscribe to this entry?

 
 [2000-09-22 00:57 UTC] johanp at aditus dot nu
The following demonstrates the problem with automtic salt crypt() function. Note: There is a different behaviour here between 4.0.1pl2 and 4.0.2 not sure what can be considered correct.

<?php

$orgstr="abc123";
$cryptstr=crypt($orgstr);

echo "orgstr=$orgstr, cryptstr=$cryptstr<p>";
echo "Salt length=".CRYPT_SALT_LENGTH."<p>";

?>

This will return the same $cryptstr no matter how many times you call the script. It seems like the automatic salt isn't generated for each call of crypt(). Not sure what the real behavious should be but it's diffrent from 4.0.1pl2 (My machine will use a DES crypt() so that the salt length is 2.)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-03 12:35 UTC] sniper@php.net
This is fixed in CVS now.

--Jani
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 21:01:26 2019 UTC