出于某种原因,无论我所尝试的是什么法典,该法典总是产生一种产出。
Exception in thread "main" java.lang.IllegalStateException: generator not seeded
error. I have included my test code at the bottom of the message. Also, I have been unable to find documentation for this generator. And I am not using the gnu classpath, I just imported the classes that the Fortuna.java wanted.
public class derp {
public static void main(String[] args) throws IllegalStateException, LimitReachedException{
Fortuna rand = new Fortuna();
Map<Object,String> mp=new HashMap<Object, String>();
String derpherpderp="gafibdawhid";
String key = Crypto.MD5(derpherpderp);
byte[] key2 = key.getBytes();
mp.put(new Integer(1), key);
int five = key2.length;
rand.addRandomBytes(key2,0,five);
rand.setup(mp);
rand.addRandomBytes(key2,0,five);
System.out.println(rand.nextByte());
}
}