You are here: mcrypt_enc_get_iv_size not working « PHP Programming Language « IT news, forums, messages
mcrypt_enc_get_iv_size not working

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация