Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 17th, 2005, 03:35 AM
M Wells
Guest
 
Posts: n/a
Default 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_query($myq);
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$key = "This is a very secret key";

while ($myqr = mysql_fetch_array($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
http://www.planetthoughtful.org
Building a thoughtful planet,
One quirky comment at a time.
  #2  
Old July 17th, 2005, 10:10 AM
Sir-Alucard
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles