Windows equivalent of /dev/random [closed]

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


Solution 1:

Yes, it's called Microsoft CryptoAPI.

Solution 2:

This link from StingyJack's answer is good: http://en.wikipedia.org/wiki/CryptGenRandom

Microsoft C++ Visual Studio since 2005 offers rand_s() which works on Windows XP and up. It is based on RtlGenRandom (as are CryptoAPI's PRNG functions), whose inner workings are not made public. It seems in XP there were some weaknesses that have since been fixed.

Personally, I use rand_s() as an additional source of randomness to seed a PRNG of my choice.