mcrypt_create_iv always returns same value?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

 

Just beginning to experiment with encryption using the mcrypt library and
I'm wondering if anyone can tell me if it's normal that the following code
always seems to return exactly the same value whenever executed on my
system:

 

                        $td =
mcrypt_module_open('rijndael-256','','cbc','');

                        srand((double) microtime() * 1000000); 

                        $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),
MCRYPT_RAND);

 

I was under the impression that the value in $iv should be different each
time this code is called, but for some reason it isn't?

 

Any help appreciated.

 

Much warmth,

 

Murray

 <http://www.planetthoughtful.org/> http://www.planetthoughtful.org

Building a thoughtful planet,

One quirky comment at a time.

 


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux