php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27118 PHP 4.3.4 Crashes with mcrypt_decrypt but mcrypt_encrypt works perfectly.
Submitted: 2004-02-02 00:50 UTC Modified: 2004-02-04 05:00 UTC
From: php-bug at ulterium dot com Assigned:
Status: Closed Package: mcrypt related
PHP Version: 4.3.4 OS: Win2000 OR Win2003
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php-bug at ulterium dot com
New email:
PHP Version: OS:

 

 [2004-02-02 00:50 UTC] php-bug at ulterium dot com
Description:
------------
Note: Also seen on Apache from a user's report on another web page. No solutions found from searching web.


Using latest libmcrypt.dll and all permissions set correctly.

If the mcrypt_decrypt line is // out then it will complete but only do the encrypt.

Any ideas?

Reproduce code:
---------------

   $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
   $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
   $key = "This is a key";
   $text = "This is a test string.";
   echo strlen($text) . "<br>";
   echo $text."<br>";

   $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
   echo strlen($crypttext) . "<br>";
   echo $crypttext."<br>";

   $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv);
   echo strlen($decrypttext) . "<br>";
   echo $decrypttext."<br>";


Expected result:
----------------
Should DeCrypt String

Actual result:
--------------
PHP has encountered an Access Violation at 6C1994EB42


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-03 23:48 UTC] php-bug at ulterium dot com
It works perfectly with build (php4-win32-STABLE-200402020930\sapi).

Is this safe to use in production environment?


Thank you,

Richard
 [2004-02-04 05:00 UTC] edink@php.net
Yes. Or you could use just released 4.3.5RC2.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 21:01:33 2025 UTC