title: Difference between CryptGenRandom and CNG BCryptGenRandom APIs
body: <p>One of our products is currently using the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa379942(v=vs.85).aspx" rel="noreferrer">CryptGenRandom</a> API for random number generation. Recently, I came across the Cryptography API: Next Generation (CNG) that provides a new API <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa375458(v=vs.85).aspx" rel="noreferrer">BCryptGenRandom</a> (in bcrypt.h) for the same. As per the description provided in MSDN - both APIs comply with the NIST SP800-90 standard in Windows Vista with Service Pack 1 (SP1) and later.</p>
  
  <ol>
  <li>If I go with the default Microsoft provider, is there any difference in the random number generation process between the two APIs?</li>
  <li>If there isn't any difference, should I move to the CNG API because CNG is the long-term replacement for the CryptoAPI?</li>
  </ol>