What are the pros and cons of using System.Security.Cryptography.RNGCryptoServiceProvider
vs System.Random
are. I know that RNGCryptoServiceProvider
is 'more random', i.e. less predictable for hackers. Any other pros or cons?
UPDATE:
According to the responses, here are the pros and cons of using RNGCryptoServiceProvider
so far:
Pros
RNGCryptoServiceProvider
is a stronger cryptographically random number, meaning it would be better for determining encryption keys and the likes.
Cons
Random
is faster because it is a simpler calculation; when used in simulations or long calculations where cryptographic randomness isn't important, this should be used.