php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49311 WAKE, enigma and arcfour ciphers fail to initialize
Submitted: 2009-08-20 15:06 UTC Modified: 2009-09-27 01:00 UTC
Votes:5
Avg. Score:4.2 ± 1.0
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:3 (75.0%)
From: c58999 at tyldd dot com Assigned:
Status: No Feedback Package: mcrypt related
PHP Version: 5.3.0 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: c58999 at tyldd dot com
New email:
PHP Version: OS:

 

 [2009-08-20 15:06 UTC] c58999 at tyldd dot com
Description:
------------
The arcfour algoritm fails to initialize on PHP 5.3.0 win32. This also appears to happen with the wake and enigma ciphers. I could also reproduce this behaviour on PHP 5.2.6-2ubuntu4.2.

Reproduce code:
---------------
$algs = mcrypt_list_algorithms();

foreach($algs as $alg){
	echo "$alg\n";
	$td = mcrypt_module_open($alg, '', 'ecb', '');
	echo "\n";
}

Expected result:
----------------
I would expect this code to execute without any errors.

Actual result:
--------------
C:\php>php mcrypt.php
cast-128
gost
rijndael-128
twofish
cast-256
loki97
rijndael-192
saferplus
wake
PHP Warning:  mcrypt_module_open(): Could not open encryption module in C:\php\mcrypt.php on line 6
blowfish-compat
des
rijndael-256
serpent
xtea
blowfish
enigma
PHP Warning:  mcrypt_module_open(): Could not open encryption module in C:\php\mcrypt.php on line 6
rc2
tripledes
arcfour
PHP Warning:  mcrypt_module_open(): Could not open encryption module in C:\php\mcrypt.php on line 6

Patches

enigma (last revision 2013-07-02 21:11 UTC by pacodumas2010 at yahoo dot es)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-19 14:48 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-09-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2011-11-07 19:20 UTC] vseticka dot martin at gmail dot com
http://stackoverflow.com/questions/8040901/how-to-encrypt-with-mcrypt-arcfour-in-wamp/8041271 - this question shows that the bug seems to be still present.
 [2015-05-15 19:46 UTC] dewi at dewimorgan dot com
Still extant in 5.4.16
 [2015-05-15 20:38 UTC] dewi at dewimorgan dot com
Still extant in:
PHP 5.6.9 (cli) (built: May 13 2015 19:28:50)
Downloaded as latest stable from windows.php.net as:
VC11 x86 Thread Safe (2015-May-14 18:29:57)

The link above to snaps.php.net is unable to connect, so I cannot test it.

The version at http://windows.php.net/snapshots/ also shows this behavior.

I am testing using the following code:
<?php
foreach(mcrypt_list_algorithms() as $alg) {
    printf("\n%15s:  ", $alg);
    foreach(mcrypt_list_modes() as $mode) {
        $mc = @mcrypt_module_open($alg, null, $mode, null);
        if(is_resource($mc)) echo "Y:$mode  ";
        else echo "N:$mode  ";
    }
}
echo "\n";

I run it as:
php crypttest.php | sort
The output is:
N:cbc  N:cfb  N:ctr  N:ecb  N:ncfb  N:nofb  N:ofb  Y:stream  arcfour
N:cbc  N:cfb  N:ctr  N:ecb  N:ncfb  N:nofb  N:ofb  Y:stream  enigma
N:cbc  N:cfb  N:ctr  N:ecb  N:ncfb  N:nofb  N:ofb  Y:stream  wake
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  blowfish
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  blowfish-compat
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  cast-128
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  cast-256
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  des
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  gost
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  loki97
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  rc2
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  rijndael-128
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  rijndael-192
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  rijndael-256
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  saferplus
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  serpent
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  tripledes
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  twofish
Y:cbc  Y:cfb  Y:ctr  Y:ecb  Y:ncfb  Y:nofb  Y:ofb  N:stream  xtea

This may mean that it's working as expected: that the first three (arcfour, enigma, and wake) are stream-only cyphers, and that all the other cyphers work only in non-stream modes?

If so, this is possibly a documentation issue rather than a real issue.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC