title: Pros and cons of RNGCryptoServiceProvider
body: <p>What are the pros and cons of using <code>System.Security.Cryptography.RNGCryptoServiceProvider</code> vs <code>System.Random</code>. I know that <code>RNGCryptoServiceProvider</code> is 'more random', i.e. less predictable for hackers. Any other pros or cons?</p>
  
  <hr>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>According to the responses, here are the pros and cons of using <code>RNGCryptoServiceProvider</code> so far:</p>
  
  <h3>Pros</h3>
  
  <ul>
  <li><code>RNGCryptoServiceProvider</code> is a stronger cryptographically random number, meaning it would be better for determining encryption keys and the likes.</li>
  </ul>
  
  <h3>Cons</h3>
  
  <ul>
  <li><code>Random</code> 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. Note: see <a href="https://stackoverflow.com/a/54847919/9536">Kevin's answer</a> for details about simulations - <code>Random</code> is not necessarily random enough, and you may want to use a different non-cryptographic PRNG.</li>
  </ul>