downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mcrypt_list_algorithms> <mcrypt_get_iv_size
[edit] Last updated: Fri, 25 May 2012

view this page in

mcrypt_get_key_size

(PHP 4, PHP 5)

mcrypt_get_key_size指定した暗号のキーの長さを得る

説明

int mcrypt_get_key_size ( int $cipher )
int mcrypt_get_key_size ( string $cipher , string $module )

最初のプロトタイプは libmcrypt 2.2.x とリンクした場合であり、2 番目の ものは libmcrypt 2.4.x あるいは 2.5.x とリンクした場合です。

mcrypt_get_key_size() は、 cipher で(暗号化モードとあわせて)指定した キーの長さを得るために使用されます。

mcrypt_enc_get_key_size() 関数を使用するほうが より有用です。これは mcrypt_module_open() が返すリソースを使用します。

例1 mcrypt_get_key_size() の例

<?php
    
echo mcrypt_get_key_size('tripledes''ecb');
?>

この例では、libmcrypt 2.4.x および 2.5.x とリンクした場合の この関数の使用法を示します。

上の例の出力は以下となります。

24

参考



add a note add a note User Contributed Notes mcrypt_get_key_size
Robin 09-Mar-2010 04:43
While not specified in the description, this function, just like mcrypt_enc_get_key_size(), returns the cipher's largest key size in BYTES.

 
show source | credits | sitemap | contact | advertising | mirror sites