mcrypt_decrypt causes Apache to crash?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • M Wells

    mcrypt_decrypt causes Apache to crash?

    Hi All,

    I'm trying to implement encryption to protect data in my database. I
    started by experimenting with the following code, just to make sure I
    know how to encrypt and then decrypt but for some reaqson when I add
    the line "$plaintext = mcrypt_decrypt( ..." etc Apache crashes.

    I'm using:

    - PHP 4.3.2
    - Apache 1.3.24
    - Windows XP

    Following is an except of my code:

    $myqs=mysql_que ry($myq);
    $iv_size = mcrypt_get_iv_s ize(MCRYPT_RIJN DAEL_256, MCRYPT_MODE_ECB );
    $iv = mcrypt_create_i v($iv_size, MCRYPT_RAND);
    $key = "This is a very secret key";

    while ($myqr = mysql_fetch_arr ay($myqs)){

    $text = $myqr["entry"];
    $crypttext = mcrypt_encrypt( MCRYPT_RIJNDAEL _256, $key, $text,
    MCRYPT_MODE_ECB , $iv);
    $plaintext = mcrypt_decrypt( MCRYPT_RIJNDAEL _256, $key,
    $crypttext, MCRYPT_MODE_ECB );
    echo $plaintext."<p> ";
    }

    If I remove the line "$plaintext = mcrypt_decrypt( .." Apache doesn't
    crash.

    Anyone have any idea why this might be crashing?

    Many thanks in advance!

    Much warmth,

    Murray

    Building a thoughtful planet,
    One quirky comment at a time.
  • Sir-Alucard

    #2
    Re: mcrypt_decrypt causes Apache to crash?


    Hi, i have experienced the same problem. In my situation it was easy.
    was using apache 1.3x.x but then i found that you can avoid thes
    crashes using mcrypt with apache 2.0 and up. Hope this helps.
    (Sorry by my english

    --
    Sir-Alucard

    Comment

    Working...