List of usage examples for org.bouncycastle.crypto.prng.drbg DualECSP800DRBG DualECSP800DRBG
public DualECSP800DRBG(Digest digest, int securityStrength, EntropySource entropySource, byte[] personalizationString, byte[] nonce)
From source file:org.codice.ddf.platform.util.RandomNumberGenerator.java
License:Open Source License
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);//ww w . jav a 2s .com return seed; }