Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6775149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:52:21+00:00 2026-05-26T15:52:21+00:00

I’m trying to use ARCFOUR algorithm in my PHP code: $td = mcrypt_module_open(MCRYPT_ARCFOUR, ”,

  • 0

I’m trying to use ARCFOUR algorithm in my PHP code:

$td = mcrypt_module_open(MCRYPT_ARCFOUR, '', MCRYPT_MODE_CBC, '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$output = mcrypt_generic($td, $input);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);

and the problem is that the first line returns warning:

mcrypt_module_open(): Could not open encryption module

My settings:

  • From php_info() output:

    command configure: … “–with-mcrypt=static” …

    If I’m correct it means I do not need a DLL for mcrypt extension.

    Supported ciphers: cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes

  • PHP version 5.3.8

  • Wamp 2.2a (32 bits)

Thank you for help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:52:21+00:00Added an answer on May 26, 2026 at 3:52 pm

    As of PHP 5.3.6 and 5.4.0 RC6, the arcfour, wake and enigma mcrypt ciphers require the use of stream mode. They will not initialize any of the other modes, nor can any of the other ciphers use stream mode.

    This may be true of earlier PHP versions as well.

    Demo code, with the @ present to silence the “can’t open module” warning:

    foreach(mcrypt_list_algorithms() as $alg) {
        printf("\n%20s:", $alg);
        foreach(mcrypt_list_modes() as $mode) {
            $mc = @mcrypt_module_open($alg, null, $mode, null);
            if(is_resource($mc)) echo "\t$mode";
            else echo "\t!!FAIL!!:$mode";
        }
    }
    echo "\n";
    

    Demo output:

            cast-128:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
                gost:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
        rijndael-128:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
             twofish:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
             arcfour:   !!FAIL!!:cbc    !!FAIL!!:cfb    !!FAIL!!:ctr    !!FAIL!!:ecb    !!FAIL!!:ncfb   !!FAIL!!:nofb   !!FAIL!!:ofb    stream
            cast-256:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
              loki97:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
        rijndael-192:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
           saferplus:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
                wake:   !!FAIL!!:cbc    !!FAIL!!:cfb    !!FAIL!!:ctr    !!FAIL!!:ecb    !!FAIL!!:ncfb   !!FAIL!!:nofb   !!FAIL!!:ofb    stream
     blowfish-compat:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
                 des:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
        rijndael-256:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
             serpent:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
                xtea:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
            blowfish:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
              enigma:   !!FAIL!!:cbc    !!FAIL!!:cfb    !!FAIL!!:ctr    !!FAIL!!:ecb    !!FAIL!!:ncfb   !!FAIL!!:nofb   !!FAIL!!:ofb    stream
                 rc2:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
           tripledes:   cbc cfb ctr ecb ncfb    nofb    ofb !!FAIL!!:stream
    

    It looks like you (and I) are seeing PHP bug 49311, which was closed after no feedback in 2009. RC4, WAKE and Enigma are broken. Code to demonstrate the problem:

    foreach(mcrypt_list_algorithms() as $algo) {
        echo $algo; 
        $td = mcrypt_module_open($algo, '', MCRYPT_MODE_CBC, '');
        echo "\n";
    }
    

    Output on my system, from the PHP interactive prompt:

    cast-128
    gost
    rijndael-128
    twofish
    arcfourPHP Warning:  mcrypt_module_open(): Could not open encryption module in php shell code on line 1
    PHP Stack trace:
    PHP   1. {main}() php shell code:0
    PHP   2. mcrypt_module_open() php shell code:1
    
    cast-256
    loki97
    rijndael-192
    saferplus
    wakePHP Warning:  mcrypt_module_open(): Could not open encryption module in php shell code on line 1
    PHP Stack trace:
    PHP   1. {main}() php shell code:0
    PHP   2. mcrypt_module_open() php shell code:1
    
    blowfish-compat
    des
    rijndael-256
    serpent
    xtea
    blowfish
    enigmaPHP Warning:  mcrypt_module_open(): Could not open encryption module in php shell code on line 1
    PHP Stack trace:
    PHP   1. {main}() php shell code:0
    PHP   2. mcrypt_module_open() php shell code:1
    
    rc2
    tripledes
    

    Until (unless) they fix this bug or a workaround is found, you’ll want to choose a different encryption algorithm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to loop through a bunch of documents I have to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.