James
James

Reputation: 1490

Random number and Microsoft CNG

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.

Upvotes: 1

Views: 1675

Answers (1)

rossum
rossum

Reputation: 15693

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

Upvotes: 0

Related Questions