views:

805

answers:

3

Is there a Windows equivalent of Linux's /dev/random?

+2  A: 

Yes, it's called CryptoAPI.

Bill the Lizard
A: 

Kind of... Look in here for some details. http://en.wikipedia.org/wiki/CryptGenRandom#Using_RtlGenRandom You are going to be better off using the programming languages random generator functions.

EDIT - Can I ask what is the goal you are trying to achieve?

StingyJack
−1. `/dev/random` is a cryptographically secure RNG. Advising people to blindly use the programming-language-supplied PRNG is a terribly bad idea.
Joey
So I give a crypto friendly answer, and advice to look into the PL's rand functions to see if there is an equivalent (would you blindly trust one MS has supplied?) and thats bad?
StingyJack
A: 

If you're doing .NET development you can use the RandomNumberGenerator class.

tvanfosson