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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bool at boolsite dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Oct 31 23:01:28 2024 UTC