473,804 Members | 3,019 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
http://www.planetthoughtful.org
Building a thoughtful planet,
One quirky comment at a time.
Jul 17 '05 #1
1 2809

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
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1670
by: Arthur M. Kang | last post by:
Can somebody concur or verify the following? I'm having this problem on all of my installations. I've got Apache 2.0.40 and PHP 4.2.2 installed and configured from RedHat RPMs. Nothing out of the ordinary. In the httpd.conf file, PHP files are called with the following: <Files *.php> SetOutputFilter PHP;INCLUDES SetInputFilter PHP
1
3384
by: watayoune | last post by:
Hi, My apache (on win) crash when i start it, after i had oci8 extensions in php.ini ! 1. i had extension phph_oci8.dll in php.ini 2. i've got a php_oci8.dll in my php extensions dir 3. my exetnsion dirs are c:\php\extensions\ in php.ini 4. i've installed oci8 client 5. i've put my oci.dll (from oracle_home) in my windows dir (tips found
0
3319
by: Christopher | last post by:
I am running: Fedora Core 1 Python 2.4 Apache 1.3.3 mod_python 2.7.11 When I try to access the test mptest.py file I receive: > Internal Server Error
10
3517
by: Alex Vinokur | last post by:
GNU g++ 3.3.3, Cygwin // Stuff static char* mbuffer = NULL; // Stuff void doit()
1
1639
by: John C | last post by:
Importing DBase files I get to the screen titled "Select Source Table and Views" And none appear in the list. (I can get the list displayed about once in ten tries) From that screen anything causes a crash of the wizard and Enterprise Manager. This happens on my deveopment installation of Enterprise Manager Version 8.0. Any Ideas/ Please John Cooper
5
2178
by: comp.lang.php | last post by:
Has anyone had any luck with file zipping utilities for PHP 4-5 and Windows XP with Apache 2.0.53? Following is my code snippet: PHP Code: if ($this->isSuccessful) { // RUN ZIP COMMAND BASED UPON STRING $zipName = ($album) ? "${section}s_$album" : "${section}s"; $zipName .= '.zip';
8
6464
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable .mdb. The query below query runs correctly and without error, but any attempt to save it causes Access to crash without a message, leaving the .ldb file. Opening the DB reveals it saved a blank "query1". I've upgraded to Jet SP 8, and I'm running...
4
3194
by: Vincent | last post by:
Hello, Does anyone have a problem with Apache2 crashing after executing a PHP script with session_start()? I notice if session_start() is placed anywhere except at the start of the file, APache will crash. Can anyone explain to me why? I don't want session_start to be at the start of the file because I need to override some session methods. So session_start has to happen after the declaration of custom session methods. Can anyone...
3
6843
by: solinem | last post by:
Hi: I am trying to find a solution for an error that consequentially leads to Apache Server crash. Following is the message, as seen in the error.log file: PHP Fatal error: Out of memory (allocated 786432) (tried to allocate 32768 bytes) SERVER CHARACTERISTICS: * Windows 2008 Enterprise Server * PHP 5.2.6 * Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9575
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10564
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10073
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.