|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-02-07 16:09 UTC] rusty at socrates dot berkeley dot edu
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>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 16:00:01 2025 UTC |
That looks all ok to me. I'll check it out and report later, i~t might be a problem in the functions. Can you try using mcrypt_list_algorithms ("/usr/local/bin/lib") ?As per your request I tried it with mcrypt_list_algorithms ("/usr/local/bin/lib") Also tried it with "/usr/local/lib" and "/usr/local/lib/libmcrypt". No cigar.