mcrypt でサポートされている暗号アルゴリズムとモードを調べる
PHP の mcrypt でサポートされている暗号アルゴリズムとモードを調べてみました。コードは PHP のマニュアルページのサンプル、ほぼそのままです(;^ω^)
<?php echo "サポートされているアルゴリズム\n"; $algorithms = mcrypt_list_algorithms(); sort($algorithms); foreach ($algorithms as $algorithm) { echo "$algorithm\n"; } echo "サポートされているモード\n"; $modes = mcrypt_list_modes(); sort($modes); foreach ($modes as $mode) { echo "$mode\n"; } ?>
手元の環境で実行した結果は次のようになりました。(CentOS 6.2 64bit, php-mcrypt-5.3.3-1.el6.x86_64, libmcrypt-2.5.8-9.el6.x86_64)
$ php mcrypt.php サポートされているアルゴリズム arcfour blowfish blowfish-compat cast-128 cast-256 des enigma gost loki97 rc2 rijndael-128 rijndael-192 rijndael-256 saferplus serpent tripledes twofish wake xtea サポートされているモード cbc cfb ctr ecb ncfb nofb ofb stream
なんと enigma がサポートされててビックリしました(笑)
■参考にしたページ
PHP: mcrypt_list_algorithms - Manual
PHP: mcrypt_list_modes - Manual