mcrypt_enc_get_iv_size not working



mcrypt_enc_get_iv_size is not randomizing the vector. I have tried to
randomize the seed in various ways but it always returns the same output.

My current code as follows:

for($i = 1; $i < 5; $i++)
{
list($usec, $sec) = explode(' ', microtime());
srand((float) $sec + ((float) $usec * 100000));

$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->CryptRes),
MCRYPT_RAND);
echo $iv."<br/>\n";
}

It outputs the same string each time.


Any ideas?

Thanks,
Jon


.