array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.mcrypt-get-cipher-name.php', 1 => 'mcrypt_get_cipher_name', ), 'up' => array ( 0 => 'ref.mcrypt.php', 1 => 'Mcrypt 函数', ), 'prev' => array ( 0 => 'function.mcrypt-get-block-size.php', 1 => 'mcrypt_get_block_size', ), 'next' => array ( 0 => 'function.mcrypt-get-iv-size.php', 1 => 'mcrypt_get_iv_size', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/mcrypt/functions/mcrypt-get-cipher-name.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)
mcrypt_get_cipher_name — 获取加密算法名称
本函数已自 PHP 7.1.0 起废弃并将自 PHP 7.2.0 起移除。强烈建议不要使用本函数。
mcrypt_get_cipher_name() 用来获取加密算法名称。
libmcrypt 2.2.x 中,mcrypt_get_cipher_name()
接受整数表达的加密算法,
libmcrypt 2.4.x 及更高版本中,它接受字符串表达的加密算法名称,
返回的都是字符串表达的名称,如果算法不存在则返回 false
。
cipher
MCRYPT_ciphername
常量中的一个,或者是字符串值的算法名称。
本函数返回加密算法名称,
如果算法不存在返回 false
。
示例 #1 mcrypt_get_cipher_name() 示例
<?php
$cipher = MCRYPT_TripleDES;
echo mcrypt_get_cipher_name($cipher);
?>
以上示例会输出:
3DES