|  | Posted by Jon Slaughter on 05/31/07 18:13 
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
  Navigation: [Reply to this message] |