How to generate a secure random number bit length is 256 bits using Java. What is the different between:
SecureRandom random = new SecureRandom(); and SecureRandom prng = SecureRandom.getInstance("SHA1PRNG");
With the first line, you let the JVM use the "secure random" implementation which is registered as default implementation in that JVM, whereas the second line forces the use of a specific implementation.
It is recommended to use the default (
Okay I like to correct a few things about SecureRandom I guess my version was different from the current one it's actually does get it's seeds from a pretty unpredictable location something with thread yield sleep intervals. Still it always keeps reusing the same 20 seeds over and over yes it seems impossible at this point to figure it out and probably is due to the fact most people will give up, but now it's like a deck of RNG's if someone is crazy enough and you don't re-seed it ever they can still figure out all the seeds.
The only difference between
But only a extra 1 million attempts or so loops to figure it out and synchronize the random number generator.
You should just re-seed your RNG every few calls and even this could be predicted if someone studies it long enough you can't re-seed them with a similar RNG since it also has the flaw. Because if someone studies it long enough they will figure it out although it's very delicate this point and pretty luck related but hey there are people who do this, just requires getting the timings just right.
Although I know you didn't ask about