PHP Doku:: Mcrypt - book.mcrypt.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzKryptografische ErweiterungenMcrypt

Ein Service von Reinhard Neidl - Webprogrammierung.

Kryptografische Erweiterungen





5 BenutzerBeiträge:
- Beiträge aktualisieren...
ghoffman at salientdigital dot com
23.11.2010 22:23
If you want a quick way to see what ciphers, modes, key, block and iv sizes are supported on your server, try something like the following.

Note: I used this simple bash: `locate libmcrypt` from terminal on Mac OS X to determine the install paths to the algorithms and modes directories. Lots of function calls generate warnings for certain ciphers, hence the use of error suppression.


= mcrypt_list_modes();
$algorithms = mcrypt_list_algorithms();
$algorithms as $cipher)
"<h1 style=\"border-top:1px solid black;\">".$cipher."</h1>\n";
$modes as $mode)
$td = mcrypt_module_open(
$key_size = mcrypt_enc_get_key_size($td);
$block_size = mcrypt_get_block_size($cipher,$mode);
$iv_size = mcrypt_get_iv_size($cipher, $mode);
            key_size: "
. ($key_size?$key_size:'n/a')
"    block_size: ". ($block_size?$block_size:'n/a')
"    iv_size: ". ($iv_size?$iv_size:'n/a')
"  </pre>\n";

28.08.2010 17:25
for Suse Linux Enterprise 11  I had used this to resolve the issue (as root)

 # yast -i  php5-mcrypt
 # rcapache2 restart

hope this helps
28.08.2010 17:24
for Suse Linux Enterprise 11  I had used this to resolve the issue (as root)

 # yast -i  php5-mcrypt
 # rcapache2 restart

hope this helps
Maarten Malaise
11.04.2010 14:38
people using phpmyadmin are redirected to this manual if they don't have mcrypt installed. If you want to install mcrypt on debian, first check your php version:

yourserver# php --version

Then install the appropriate version of mcrypt (php5-mcrypt if your php version is 5.x)

yourserver# apt-get install php4-mcrypt
yourserver# apt-get install php5-mcrypt
16.10.2009 5:11
When using 3DES between PHP and C#, it is to be noted that there are subtle differences that if not strictly observed, will result in annoying problem encrypt/decrypt data.

1), When using a 16 bytes key, php and c# generates total different outcome string. it seems that a 24 bytes key is required for php and c# to work alike.
2), php doesnt have a "padding" option, while c# has 3 (?). My work around is to add nulls i.e. chr(0) to the end of the source string to make its size times of 8, while in c#, PaddingMode.Zeros is required.
3) the key size has to be times of 8, in php, to make it work for c#.

PHP Powered Diese Seite bei
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)