How to generate a secure random number bit length is 256 bits using Java. What is the different between:
SecureRandom random = new SecureRandom();
and
SecureRandom prng = SecureRandom.getInstance("SHA1PRNG");
|
|
|
With the first line, you let the JVM use the "secure random" implementation which is registered as default implementation in that JVM, whereas the second line forces the use of a specific implementation. It is recommended to use the default ( |
|||
|