Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3490290
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:29:54+00:00 2026-05-18T11:29:54+00:00

I have a new application being written in .Net. I also have a legacy

  • 0

I have a new application being written in .Net. I also have a legacy version of the application that must be maintained (for the meantime), which has been written in VB6 and utilizes C++ DLLs. Certain C++ native DLLs must continue to be utilized and shared by the new .Net application via P/Invoke.

The legacy app currently utilizes a random number generator, which will be replaced to use CryptGenRandom() function available through Win32 APIs. The new .Net app has the same need and can utilize the RNGCryptoServiceProvider class.

Question:
Under the hood does the .Net RNGCryptoServiceProvider class utilize the Win32 CryptGenRandom() function? If so, I would be interested in any links on available documentation in regards to this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:29:54+00:00Added an answer on May 18, 2026 at 11:29 am

    Actually, the .Net RNGCryptoServiceProvider class obtains random data from a “Cryptographic Service Provider” (CSP) (so says the documentation). In the CryptoAPI, a CSP is a loadable DLL which provides some cryptographic services, mainly private key storage, signature computations… and also random number generation. A CSP can be used only if it has been signed (by Microsoft) and registered (by writing in some specific registry keys).

    The CryptGenRandom() function uses the default CSP (the one registered as to be used by default, normally one of the CSP which come with the operating system itself) and invokes the CPGenRandom() function on that CSP. RNGCryptoServiceProvider does the same. Hence, it does not call CryptGenRandom(), but it feeds on the same cryptographically strong source.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a new solution that is an ASP.NET MVC 2.0 application. I have
I have created a new ActionFilter for an ASP.NET MVC application that I'm creating.
I have written a wrapper application in .Net that starts another WinForms application with
I have a forum like web application written in Asp.net MVC. I'm trying to
I have a simple standalone application written in Visual Basic that I'm porting to
I have an windows service that monitors a folder for new files being created.when
This is odd, but we have written an asp.Net web application (all's well there)
I have written a c# win forms application that allows the user to open
A new client of mine has a small VB/Access database application written in 2002
We have several .NET applications that monitor a directory for new files, using FileSystemWatcher.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.