php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36954 crypt() always use DES with "php -r" option
Submitted: 2006-04-03 10:23 UTC Modified: 2006-04-03 12:29 UTC
From: bool at boolsite dot net Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 4.4.2 OS: Debian Sarge AMD64
Private report: No CVE-ID: None
 [2006-04-03 10:23 UTC] bool at boolsite dot net
Description:
------------
Hello,

while "CRYPT MD5" works with php-cli, it seems to doesn't works with "php -r" parameter.

I tried this :
> houyo:~# php -r "echo crypt( 'php.net', '$1$12345678$' ), \"\\n\";"
> 23ISkhbvMi6ZY

So it used DES.

Same code, in a file :
> houyo:~# echo "<?php echo crypt( 'php.net', '\$1\$12345678$' ), \"\\n\"; ?>" > test.php
> houyo:~# php test.php
> $1$12345678$6ezUvDWwuPAu0b27daqPC1

So MD5 works...


I checked this too :
> houyo:~# php -r "echo CRYPT_MD5;"
> 1

and "MD5 CRYPT" is available...

I add : it is the Debian package 4.3.10-16... I can't really check with source version.


Reproduce code:
---------------
houyo:~# php -r "echo crypt( 'php.net', '$1$12345678$' ), \"\\n\";"


Expected result:
----------------
$1$12345678$6ezUvDWwuPAu0b27daqPC1

Actual result:
--------------
23ISkhbvMi6ZY

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-03 12:20 UTC] mike@php.net
The bash replaces the apparent variables.
 [2006-04-03 12:29 UTC] bool at boolsite dot net
erf... sorry...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 04:01:28 2024 UTC