Question

I need to use the Microsoft CNG API to generate secure random numbers for cryptography.

Am I supposed to generate all the numbers using this API, or just obtain a seed value for another random generator from it?

Any help appreciated! Thanks.

Was it helpful?

Solution

How many random numbers do you want? There is only a limited amount of entropy in the MS CNG entropy pool. For just a single number/key then it is fine. For multiple keys, then you are better off using the CNG to seed a separate crypto quality PRNG.

There is a description of the MS CNG in section 7.1.3 of RFC 4086

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top