Skip to content

Instantly share code, notes, and snippets.

@banterCZ
Created October 19, 2020 19:30
Show Gist options
  • Save banterCZ/36712a9741fa7ff5a819e7009c148270 to your computer and use it in GitHub Desktop.
Save banterCZ/36712a9741fa7ff5a819e7009c148270 to your computer and use it in GitHub Desktop.
public class SecureRandomTest {
public static void main(String[] args) {
System.out.println("SecureRandom Test");
final SecureRandom random = new SecureRandom(); // Default: Win - SHA1PRNG, Linux/maxOS - NativePRNG
// final SecureRandom random = SecureRandom.getInstance("NativePRNGNonBlocking");
System.out.println("Algorithm: " + random.getAlgorithm());
for (int i = 0; i < 100; i++) {
System.out.print('.');
final byte[] seed = random.generateSeed(2 * 8);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment