2

For some reason, no matter what code I try, this code always outputs a

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());

}
}
natman3400
  • 27
  • 5

0 Answers0