Hi folks,

This code:

$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,

Takes just over a minute to run on my laptop and roughly 45 seconds on a
capable server, any idea why?

time php test-iv.php
string(32) "????'???H??y?PJ?U?1O;6???ѧ"

real 0m44.917s
user 0m0.024s
sys 0m0.036s

Also, I've noticed the mcrypt_encypt & mcrypt_decrypt complain with

The IV parameter must be as long as the blocksize

when not using mcrypt_create_iv, however, if the value of the IV parameter
is consistent in both calls, the decryption seems to succeed despite the

So wondering:
* can the call to mcrypt_create_iv be sped up
* is there an alternative (faster) way to create a proper iv
* how big a risk is it to 'ride dirty' here and not use mcrypt_create_iv



Reply via email to