mcrypt_list_algorithms
(PHP 4 >= 4.0.2, PHP 5)
mcrypt_list_algorithms — Gets an array of all supported ciphers
Описание
array mcrypt_list_algorithms
([ string
$lib_dir
= ini_get("mcrypt.algorithms_dir")
] )
Gets the list of all supported algorithms in the
lib_dir
parameter.
Список параметров
-
lib_dir
-
Specifies the directory where all algorithms are located. If not specified, the value of the mcrypt.algorithms_dir php.ini directive is used.
Возвращаемые значения
Returns an array with all the supported algorithms.
Примеры
Пример #1 mcrypt_list_algorithms() Example
<?php
$algorithms = mcrypt_list_algorithms("/usr/local/lib/libmcrypt");
foreach ($algorithms as $cipher) {
echo "$cipher<br />\n";
}
?>
The example above will produce a list with all supported algorithms in the "/usr/local/lib/libmcrypt" directory.
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Криптографические расширения
- Mcrypt
- mcrypt_cbc
- mcrypt_cfb
- mcrypt_create_iv
- mcrypt_decrypt
- mcrypt_ecb
- mcrypt_enc_get_algorithms_name
- mcrypt_enc_get_block_size
- mcrypt_enc_get_iv_size
- mcrypt_enc_get_key_size
- mcrypt_enc_get_modes_name
- mcrypt_enc_get_supported_key_sizes
- mcrypt_enc_is_block_algorithm_mode
- mcrypt_enc_is_block_algorithm
- mcrypt_enc_is_block_mode
- mcrypt_enc_self_test
- mcrypt_encrypt
- mcrypt_generic_deinit
- mcrypt_generic_end
- mcrypt_generic_init
- mcrypt_generic
- mcrypt_get_block_size
- mcrypt_get_cipher_name
- mcrypt_get_iv_size
- mcrypt_get_key_size
- mcrypt_list_algorithms
- mcrypt_list_modes
- mcrypt_module_close
- mcrypt_module_get_algo_block_size
- mcrypt_module_get_algo_key_size
- mcrypt_module_get_supported_key_sizes
- mcrypt_module_is_block_algorithm_mode
- mcrypt_module_is_block_algorithm
- mcrypt_module_is_block_mode
- mcrypt_module_open
- mcrypt_module_self_test
- mcrypt_ofb
- mdecrypt_generic
Коментарии
$algorithms = mcrypt_list_algorithms();
var_dump($algorithms);
// sample output from PHP 5.3.3 on Mac OS X (Snow Leopard)
array(19) {
[0]=>
string(8) "cast-128"
[1]=>
string(4) "gost"
[2]=>
string(12) "rijndael-128"
[3]=>
string(7) "twofish"
[4]=>
string(7) "arcfour"
[5]=>
string(8) "cast-256"
[6]=>
string(6) "loki97"
[7]=>
string(12) "rijndael-192"
[8]=>
string(9) "saferplus"
[9]=>
string(4) "wake"
[10]=>
string(15) "blowfish-compat"
[11]=>
string(3) "des"
[12]=>
string(12) "rijndael-256"
[13]=>
string(7) "serpent"
[14]=>
string(4) "xtea"
[15]=>
string(8) "blowfish"
[16]=>
string(6) "enigma"
[17]=>
string(3) "rc2"
[18]=>
string(9) "tripledes"
}