php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26956 Fatal error: Call to undefined function: mcrypt_generic_deinit()
Submitted: 2004-01-18 14:20 UTC Modified: 2004-01-18 14:45 UTC
From: ronan at ronanmcnulty dot co dot uk Assigned:
Status: Not a bug Package: mcrypt related
PHP Version: * OS: Windows XP
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ronan at ronanmcnulty dot co dot uk
New email:
PHP Version: OS:

 

 [2004-01-18 14:20 UTC] ronan at ronanmcnulty dot co dot uk
Description:
------------
This is from the example code on :

Fatal error: Call to undefined function: mcrypt_generic_deinit()

PHP version 4.3.3 with php-4.3-mcrypt



Reproduce code:
---------------
<?php
   /* Open the cipher */
   $td = mcrypt_module_open('rijndael-256', '', 'ofb', '');

   /* Create the IV and determine the keysize length */
   $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_DEV_RANDOM);
   $ks = mcrypt_enc_get_key_size($td);

   /* Create key */
   $key = substr(md5('very secret key'), 0, $ks);

   /* Intialize encryption */
   mcrypt_generic_init($td, $key, $iv);

   /* Encrypt data */
   $encrypted = mcrypt_generic($td, 'This is very important data');

   /* Terminate encryption handler */
   mcrypt_generic_deinit($td);

   /* Initialize encryption module for decryption */
   mcrypt_generic_init($td, $key, $iv);

   /* Decrypt encrypted string */
   $decrypted = mdecrypt_generic($td, $encrypted);

   /* Terminate decryption handle and close module */
   mcrypt_generic_deinit($td);
   mcrypt_module_close($td);

   /* Show string */
   echo trim($decrypted) . "\n";
?> 

Expected result:
----------------
I expect it to work (encrypt and decrypt the data)

Actual result:
--------------
Nothing but : Fatal error: Call to undefined function: mcrypt_generic_deinit() in c:\apache\apache\htdocs\test2.php on line 19

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-18 14:26 UTC] helly@php.net
You haven't loaded the mcrypt extension dll. To do so change yout php.ini.
 [2004-01-18 14:30 UTC] derick@php.net
Wrong answer Marcus, it's the same as bug #24052 though which I just reopened.
 [2004-01-18 14:32 UTC] helly@php.net
This is actually a duplicate of #24052.
 [2004-01-18 14:45 UTC] derick@php.net
Duplicate should not be used anymore :-)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC