php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50093 Crypt function with distinct behavior in servers
Submitted: 2009-11-05 18:54 UTC Modified: 2009-11-05 19:16 UTC
From: vitor dot reus at gmail dot com Assigned:
Status: Not a bug Package: *Encryption and hash functions
PHP Version: 5.3.0 OS: Windows & Linux
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:
36 - 7 = ?
Subscribe to this entry?

 
 [2009-11-05 18:54 UTC] vitor dot reus at gmail dot com
Description:
------------
I have tried to use the crypt function using a 1 char length salt in different servers and the output went different.

When I use a 2 char length salt, the output is the same.

The architecture of the servers who gave the different output is 32 bits, i think this could be a hint.

Reproduce code:
---------------
<?php
echo  CRYPT_STD_DES . CRYPT_EXT_DES . CRYPT_MD5. CRYPT_BLOWFISH."<br>";
echo crypt('1234','Z');
?>

Expected result:
----------------
Linux (several distributions) 64 bits:
1010
Z$pzJXrYhCQNg

Actual result:
--------------
Windows 32bit:
1010
Z$qZF7.jfwpCE

Debian 5 32 bits:
1111
Z$qZF7.jfwpCE

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-05 18:57 UTC] pajoye@php.net
Duplicate of #50093 and #49954, which are fixed in SVN.
 [2009-11-05 19:02 UTC] pajoye@php.net
meant #50052, not #50093.
 [2009-11-05 19:16 UTC] vitor dot reus at gmail dot com
I think its #49954 and #50052, becouse the same wrong output occours in windows + php 5.2.10 and linux + php 5.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC