mardi 23 décembre 2014

SecureRandom with NativePRNG vs SHA1PRNG

I need to generate cryptographically strong random numbers and byte arrays. For this purpose, I'm using Java's SecureRandom class. But I'm not sure to choose which PRNG algorithm in terms of their cryptographic strength.


Which of the following instances generates a more unpredictable numbers? Or are they equal?



SecureRandom nativePrng = SecureRandom.getInstance("NativePRNG")
SecureRandom sha1Prng = SecureRandom.getInstance("SHA1PRNG")


Moreover, we are able to generate these instances with "SUN" provider (e.g. SecureRandom.getInstance("SHA1PRNG", "SUN")). Do this make a difference?


Thanks in advance.





Aucun commentaire:

Enregistrer un commentaire