note 15068 added to function.mcrypt-create-iv.php
| From: | sgtruck at whiterose dot net | Date: | Mon, 27 Aug 2001 06:12:56 +0000 |
| Subject: | note 15068 added to function.mcrypt-create-iv.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17177@lists.php.net to get a copy of this message | ||
The example above does not work on my system as mcrypt_get_block_size() requires 2 arguments: the
following works instead (insert the appropriate cipher and mode for your code)...
$cipher = 'twofish';
$mode = 'ecb';
$block_size = mcrypt_get_block_size ($cipher,$mode);
$iv = mcrypt_create_iv ($block_size, MCRYPT_DEV_RANDOM);
http://www.php.net/manual/en/function.mcrypt-create-iv.php