From:             ronan at ronanmcnulty dot co dot uk
Operating system: Windows XP
PHP version:      Irrelevant
PHP Bug Type:     mcrypt related
Bug description:  Fatal error: Call to undefined function: mcrypt_generic_deinit() 

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

-- 
Edit bug report at http://bugs.php.net/?id=26956&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26956&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26956&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26956&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26956&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26956&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26956&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26956&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26956&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26956&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26956&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26956&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26956&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26956&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26956&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26956&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26956&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26956&r=float

Reply via email to