includes/rijndael.php
changeset 472 bc4b58034f4d
parent 461 717e71109645
child 518 2b826f2640e9
equal deleted inserted replaced
471:7906fb190fc1 472:bc4b58034f4d
   907     $key = '';
   907     $key = '';
   908     for($i=0;$i<$len;$i++)
   908     for($i=0;$i<$len;$i++)
   909     {
   909     {
   910       $key .= chr(mt_rand(0, 255));
   910       $key .= chr(mt_rand(0, 255));
   911     }
   911     }
   912     if ( file_exists('/dev/urandom') && is_readable('/dev/urandom') )
   912     if ( @file_exists('/dev/urandom') && @is_readable('/dev/urandom') )
   913     {
   913     {
   914       // Let's use something a little more secure
   914       // Let's use something a little more secure
   915       $ur = @fopen('/dev/urandom', 'r');
   915       $ur = @fopen('/dev/urandom', 'r');
   916       if ( !$ur )
   916       if ( !$ur )
   917         return $key;
   917         return $key;