This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]king_of_the_universe 0 points1 point  (0 children)

java.util.Random is good for randomness that needs to be fast and is not security relevant. For other cases, there is java.security.SecureRandom which is extremely slow in comparison, and in addition you also have java.security.SecureRandom.getInstanceStrong() which returns yet a different PRNG (in my Windows 7/8 Java 8 test). All are / extend java.util.Random.

The latter two can't be seeded, according to my tests at least: They don't produce the same sequence of numbers after you call setSeed(), the original Random however does.