note 13261 deleted from ref.mcrypt by sander

From: Date: Sun, 07 Apr 2002 11:05:11 +0000
Subject: note 13261 deleted from ref.mcrypt by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-28817@lists.php.net to get a copy of this message
There was much activity over the instability of mcrypt in php 4.05 recently. See http://marc.theaimsgroup.com/?l=php-cvs&m=99021946326583&w=2 for example. The source of most problems is from the crappy example in the manual above. There is a bug, which has been fixed in the 4.0.6 Release Candidate 1, which gracefully returns an error if you try to use a key length greater than that *supported* for the algorithm. In other words, you must not use a key size larger than the algorithm (obviously), but also not larger than that supported. Take a look at the man page for mcrypt, which lists all the modes and key sizes, or check out the Core PHP book, which has very good examples. If you: tail /usr/local/apache/logs/error_log using the example above, you'll see a segfault. The solution: $key="smaller key"; Finally, Derek Rethans (the lead PHP developer for mcrypt) recommends using the libmcrypt-2.4.11.tar.gz version, as it apparently is the most stable. After having stress-tested this for several days, I think he's right on target. I've had no luck with versions .12 - .14, but using version 11 and PHP 4.05 on RH 6.2 (*with* the proper key sizes) has been very robust so far. -kenn

« previous php.notes (#28817) next »