PHP 4.0 Bug #9163: mcrypt_list_algorithms doesn't work

From: Date: Wed, 07 Feb 2001 21:09:48 +0000
Subject: PHP 4.0 Bug #9163: mcrypt_list_algorithms doesn't work
Groups: php.dev 
Request: Send a blank email to php-dev+get-45984@lists.php.net to get a copy of this message
From: rusty@socrates.berkeley.edu Operating system: solaris 7 PHP version: 4.0.4pl1 PHP Bug Type: mcrypt related Bug description: mcrypt_list_algorithms doesn't work I'm using libmcrypt-2.4.8. Compiled everything with gcc-2.95.2. Here is the sample script. Everything works except the mcrypt_list_algorithms() and mcrypt_list_modes() at the end. They both generate the error "Warning: No algorithms found in module dir in /grunt_a/apache/htdocs/grunt/idrive/test1.php on line 34" <script language="php"> if (mcrypt_module_self_test(MCRYPT_DES) == FALSE) { echo "mcrypt_module_self_test(MCRYPT_DES) failed<br>"; } else { echo "mcrypt_module_self_test(MCRYPT_DES) passed<br>"; } $key = "the password is: xyzzy"; $input = "encrypt this, sucker"; $td = mcrypt_module_open(MCRYPT_DES, "", MCRYPT_MODE_CBC, ""); $ivs = mcrypt_enc_get_iv_size($td); $iv = mcrypt_create_iv($ivs, MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); if (mcrypt_enc_self_test($td)) { echo "mcrypt_enc_self_test() failed<br>"; } $enc = mcrypt_generic($td, $input); echo "encrypted data: " . bin2hex($enc) . "<br>"; $dec = mdecrypt_generic($td, $enc); echo "decrypted data: " . $dec . "<br>"; echo "algorithm: " . mcrypt_enc_get_algorithms_name($td) . "<br>"; echo "mode: " . mcrypt_enc_get_modes_name($td) . "<br>"; echo "block size: " . mcrypt_enc_get_block_size($td) . "<br>"; echo "key size: " . mcrypt_enc_get_key_size($td) . "<br>"; $algs = mcrypt_list_algorithms(); $mods = mcrypt_list_modes(); mcrypt_generic_end($td) </script> -- Edit Bug report at: http://bugs.php.net/?id=9163&edit=1

« previous php.dev (#45984) next »