3 ms·
Does it really? From https://bugs.openjdk.java.net/browse/JDK-4705093 https://bugs.openjdk.java.net/browse/JDK-4705093 : > If you call: new SecureRandom() on L
by viraptor 11y ago
Does it really? From https://bugs.openjdk.java.net/browse/JDK-4705093 https://bugs.openjdk.java.net/browse/JDK-4705093 :
> If you call: new SecureRandom() on Linux and the default values are used, it will read from /dev/urandom and not block. (By default on Solaris, the PKCS11 SecureRandom is used, and also calls into /dev/urandom.)
- jcranmer 11y agoI ran strace on both OpenJDK 7 and 8. It appears to open both /dev/random and /dev/urandom, but it only read from /dev/urandom. From reading the source code, it appears that /dev/random is used if you call SecureRandom::generateSeed, but /dev/urandom is used for SecureRandom::next. Of course, you can change a whole heck of a lot of stuff by setting properties on the command line or changing $JAVA_HOME/lib/security/java.security.
- Freaky 11y agoYep, shouldn't have second-guessed myself. Teach me to comment at 4am. http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/solaris/classes/sun/security/provider/NativePRNG.java http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/s...