Open altf4 opened 9 years ago
On my Linux system, pid_max is 32768:
cat /proc/sys/kernel/pid_max
32768
We might be able to safely include all possible PIDs, or maybe just some on the lower end. 32k isn't that many.
time(0) can be limited to a reasonably likely window, too. Maybe just the last year or so.
PHP apps that implicitly seed their mt_rand do so according to the algorithm here:
http://lxr.php.net/xref/PHP_5_4/ext/standard/php_rand.h#46
There's not a whole lot of entropy in the unix timestamp of the server start plus PID. This would make breaking PHP apps that use implicit seeding a lot easier.