R
Roedy Green
What happens when you seed your Random number generator with the
current time?
If I knew for example that you did that between 12:00 and 12:05, there
are only
5*60*1000 = 300,000 possible seeds you could have used, each of which
starts off a predetermined chain of "random" numbers.
If I know a few of your results, I can with brute force figure out
which seed you used, and hence PREDICT your entire stream of random
numbers.
This is one reason you use SecureRandom instead of Random for any sort
of process where you don't want people guessing the seed, e.g. in
generating lottery results or generating passwords.
see http://mindprod.com/products1.html#PASSWORD
current time?
If I knew for example that you did that between 12:00 and 12:05, there
are only
5*60*1000 = 300,000 possible seeds you could have used, each of which
starts off a predetermined chain of "random" numbers.
If I know a few of your results, I can with brute force figure out
which seed you used, and hence PREDICT your entire stream of random
numbers.
This is one reason you use SecureRandom instead of Random for any sort
of process where you don't want people guessing the seed, e.g. in
generating lottery results or generating passwords.
see http://mindprod.com/products1.html#PASSWORD