php.net |  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
 [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);

//display 
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
http://teaconcepts.net/test.php?a=peanut&b=butter

//this shouldnt result to a match, but did
http://teaconcepts.net/test.php?a=peanut&b=butterasdasdaa
(or whatever you add after "butter")


3)Here's my php info
http://teaconcepts.net/info.php


Hope this helps the PHP community!

Sincerely

Tea J

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

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

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC