Pergunta

I know to use the RNGCryptoServiceProvider, but is there anything special that I need to do to ensure that it's not using the same seed each time (such as at start-up)? Do I need to pull some data from outside sources on initialization? Or does the system do this for me?

Foi útil?

Solução

Great Microsoft documentation, could not find anything about the algorithm or the seeding.

Wikipedia to the rescue:

Windows developers have several alternative means of accessing the CryptGenRandom functionality; these alternatives invoke the same algorithm and share the same security characteristics, but may have other advantages.

...

Using RNGCryptoServiceProvider

Programmers using .NET should use the RNGCryptoServiceProvider Class

Note that Wikipedia seems outdated, for more up to date information, check the Microsoft pages of the CryptGenRandom function


Note that this answer is only valid if you actually get the Microsoft CSP that uses the CryptGenRandom function. If you are on a non-Windows platform, or if you are refering to a different CSP, then check out those specific runtime configurations.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top