From: robert at peakepro dot com Operating system: RH Linux, Mac OS X PHP version: 4.3.4 PHP Bug Type: mcrypt related Bug description: mdecrypt_generic() fails all but 'ecb' with mcrypt_module_close()
Description: ------------ I noticed all the examples in the online documentation do not actually close out the mcrypt module, they simply deinit. This is not an accurate simulation of a real- world use, where an encrypted string may be stored and later retreived long after the module has been closed. I encountered this potential bug when running the loop I posted on the mcrypt main page. It seems that in all modes except ecb, mcrypt fails to decrypt encrypted strings after the module has been closed. At first I thought it was just my system or my libmcrypt, but I have tried this on multiple machines with the same results. Reproduce code: --------------- http://www.peakepro.com/workbench/mcrypt Expected result: ---------------- The same results as in the source code posted in mcrypt_module_open() i.e. the original string. Actual result: -------------- Garbled output that varies with each new call. -- Edit bug report at http://bugs.php.net/?id=27455&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27455&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27455&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27455&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27455&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27455&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27455&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27455&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27455&r=support Expected behavior: http://bugs.php.net/fix.php?id=27455&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27455&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27455&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27455&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27455&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27455&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27455&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27455&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27455&r=float