array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.openssl-cipher-iv-length.php', 1 => 'openssl_cipher_iv_length', ), 'up' => array ( 0 => 'ref.openssl.php', 1 => 'OpenSSL 関数', ), 'prev' => array ( 0 => 'ref.openssl.php', 1 => 'OpenSSL 関数', ), 'next' => array ( 0 => 'function.openssl-cipher-key-length.php', 1 => 'openssl_cipher_key_length', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/openssl/functions/openssl-cipher-iv-length.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.3.3, PHP 7, PHP 8)
openssl_cipher_iv_length — 初期化ベクトル iv の長さを取得する
cipher_algo
暗号化方式。指定できる値は openssl_get_cipher_methods() を参照ください。
成功した場合は暗号の長さ、失敗した場合には false
を返します。
暗号アルゴリズムが未知の場合、
E_WARNING
レベルのエラーが発生します。
例1 openssl_cipher_iv_length() の例
<?php
$method = 'AES-128-CBC';
$ivlen = openssl_cipher_iv_length($method);
echo $ivlen;
?>
上の例の出力は、 たとえば以下のようになります。
16