List of usage examples for org.bouncycastle.crypto.prng ThreadedSeedGenerator generateSeed
public byte[] generateSeed(int numBytes, boolean fast)
From source file:org.crypto.sse.CryptoPrimitives.java
License:Open Source License
public static byte[] randomBytes(int sizeOfSalt) { byte[] salt = new byte[sizeOfSalt]; ThreadedSeedGenerator thread = new ThreadedSeedGenerator(); SecureRandom random = new SecureRandom(); random.setSeed(thread.generateSeed(20, true)); random.nextBytes(salt);//from www. ja v a 2 s. co m return salt; }