|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23386 2 Crypt() with different 'salt' - matched!
Submitted: 2003-04-28 12:13 UTC Modified: 2003-04-28 16:53 UTC
From: tea at teaconcepts dot net Assigned:
Status: Not a bug Package: *Encryption and hash functions
PHP Version: 4.3.1 OS: Windows and Unix
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: tea at teaconcepts dot net
New email:
PHP Version: OS:


 [2003-04-28 12:13 UTC] tea at teaconcepts dot net
I was comparing results from 2 crypt() functions with slightly different arguments.. Both of them returned the same results:

1)Here's the script:

//for the record
$code1= crypt('peanut','butter');
//for user input
$code2= crypt($a,$b);

echo "code1: $code1 <br>code2: $code2";

if ($code1 == $code2){
echo "<br>OK";

2)Here's the link to the script on my server:

//this should result to a match

//this shouldnt result to a match, but did
(or whatever you add after "butter")

3)Here's my php info

Hope this helps the PHP community!


Tea J


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-28 16:53 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

And just type \"man crypt\" to see the manpage of crypt(3).

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Jul 12 10:01:25 2020 UTC