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

  • SEARCH
  • Home
  • 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 8830273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:02:25+00:00 2026-06-14T08:02:25+00:00

I keep getting these warnings: Warning: mcrypt_generic_init(): mcrypt_generic_init(): 1 is not a valid MCrypt

  • 0

I keep getting these warnings:

Warning: mcrypt_generic_init(): mcrypt_generic_init(): 1 is not a
valid MCrypt resource in C:\Users\dever\Desktop\web
code\HeloWorld\HeloWorld\Crypt.php on line 123, column 9.

Warning: mdecrypt_generic(): mdecrypt_generic(): 1 is not a valid
MCrypt resource in C:\Users\dever\Desktop\web
code\HeloWorld\HeloWorld\Crypt.php on line 124, column 9.

Warning: mcrypt_generic_deinit(): mcrypt_generic_deinit(): 1 is not a
valid MCrypt resource in C:\Users\dever\Desktop\web
code\HeloWorld\HeloWorld\Crypt.php on line 125, column 9.

Warning: mcrypt_generic_init(): mcrypt_generic_init(): 1 is not a
valid MCrypt resource in C:\Users\dever\Desktop\web
code\HeloWorld\HeloWorld\Crypt.php on line 100, column 9.

Warning: mcrypt_generic(): mcrypt_generic(): 1 is not a valid MCrypt
resource in C:\Users\dever\Desktop\web
code\HeloWorld\HeloWorld\Crypt.php on line 105, column 9.

Warning: mcrypt_generic_deinit(): mcrypt_generic_deinit(): 1 is not a
valid MCrypt resource in C:\Users\dever\Desktop\web
code\HeloWorld\HeloWorld\Crypt.php on line 107, column 9.

Since it is a warning and the strings “seem” to be encrypted I have ignored it till now. However it seems that the remote server I am working with is not liking the encrypted string and returning errors to me stating as much.

Here is the code generating those warnings:

    mcrypt_generic_init($this->_td, $this->_key, $iv);
    $data = mdecrypt_generic($this->_td, $data);
    mcrypt_generic_deinit($this->_td);

and

$iv = mcrypt_create_iv(self::AES_BLOCK_SIZE, $random_source);
    $s = mcrypt_generic_init($this->_td, $this->_key, $iv);
    if( ($s < 0) || ($s === false))
        die( "Really an error" );
    $data = mcrypt_generic($this->_td, $data);
    $data = $iv.$data;
    mcrypt_generic_deinit($this->_td);

I have researched but could not find out what these warnings meen, if they are effecting the encryption/decryption or what exactly is the problem? Im pretty sure its not the code (as I have it working on a different server).

  • 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-06-14T08:02:27+00:00Added an answer on June 14, 2026 at 8:02 am

    Here is a test I’ve performed, that reproduces the values you’re seeing in your var_dumps:

    $td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '/usr/lib/mcrypt-modes');
    var_dump($td);
    mcrypt_module_close($td);
    var_dump($td);
    

    It prints:

    resource(4) of type (mcrypt)
    resource(4) of type (Unknown)
    

    Since you’re seeing the same behavior (resource id remains the same, but loses its mcrypt association), it seems that you’re closing your module resource at some point between initializing $this->_td and actually calling mcrypt_generic_init.

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

Sidebar

Related Questions

I keep getting these 2 errors in my code In function 'int main()': error:
When my code is stored and saved and out putted I keep getting these
Ever since I updated to Kobold2d 2.0.4 I keep getting these warnings in the
Keep getting the error Arguments are not sufficiently instantiated for the multiplication by addition
I keep getting an error saying that @android:style/Widget.Holo.Light.Button.Borderless is not public and so can't
I keep getting warnings only in XCode about some macros in glm being redefined.
In Eclipse, I'm getting warnings for not having a start tag ( <div> )
I am having a little trouble with my web-app, essentially I keep getting an
I'm running unit tests on Rails 2.3 and I keep getting errors along these
I keep getting this warning: timezone of object (UTC) is different than current timezone

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.