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_sizeRetourne la taille de la clé de chiffrement

Description

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

La première syntaxe utilise libmcrypt 2.2.x, et la seconde libmcrypt 2.4.x ou plus récent.

mcrypt_get_key_size() sert à lire la taille de clé du chiffrement cipher.

Il est plus intéressant d'utiliser la fonction mcrypt_enc_get_key_size() sachant qu'elle utilise la ressource retournée par la fonction mcrypt_module_open().

Exemples

Exemple #1 Exemple avec mcrypt_get_key_size()

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

L'exemple ci-dessus montre l'utilisation de la fonction lorsqu'elle a été compilée avec la bibliothèque 2.4.x ou 2.5.x.

L'exemple ci-dessus va afficher :

24

Voir aussi



add a note add a note User Contributed Notes mcrypt_get_key_size
Robin 09-Mar-2010 01: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 | stats | sitemap | contact | advertising | mirror sites