Code: Select all
<?php
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CFB, ''); // open module
srand(12345);
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
echo 'iv1 = ', base64_encode($iv), 'rand=', rand(), '<br />';
srand(12345);
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
echo 'iv2 = ', base64_encode($iv), 'rand=', rand(), '<br />';
mcrypt_module_close($td); // close module
?>