/cracking-prngs

Toy program illustrating how easy it is to crack pseudo-random number generators

Primary LanguageJavaThe UnlicenseUnlicense

Cracking java.util.Random

This is a very simple program demonstrating how easy it is to predict the output of the java.util.Random class.
I take zero credit for this; the code was lifted and adapted from this blog entry and its comments:

This program works successfully in Java 8, and I believe also in Java 7 but I haven't checked. I'm pretty certain it won't work on Java 6, because some of the constants in the java.util.Random class have changed, but it should be trivial to adapt it to that (the original blog entry used the Java 6 values after all).