List of usage examples for org.bouncycastle.crypto.prng ThreadedSeedGenerator ThreadedSeedGenerator
ThreadedSeedGenerator
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);/* ww w . ja v a2 s. c o m*/ return salt; }