use of org.bouncycastle.crypto.prng.EntropySourceProvider in project ddf by codice.
the class RandomNumberGenerator method createSeed.
public static byte[] createSeed() {
EntropySourceProvider esp = new BasicEntropySourceProvider(new SecureRandom(), true);
byte[] nonce = new byte[256];
new SecureRandom().nextBytes(nonce);
DualECSP800DRBG bcRbg = new DualECSP800DRBG(new SHA256Digest(), 256, esp.get(256), null, nonce);
byte[] seed = new byte[256];
bcRbg.generate(seed, null, true);
return seed;
}
Aggregations