Pros and cons of RNGCryptoServiceProvider

A cryptographically strong RNG will be slower — it takes more computation — and will be spectrally white, but won’t be as well suited to simulations or Monte Carlo methods, both because they do take more time, and because they may not be repeatable, which is nice for testing.

In general, you want to use a cryptographic PRNG when you want a unique number like a UUID, or as a key for encryption, and a deterministic PRNG for speed and in simulation.

Leave a Comment