I am wondering if Windows provides an equivalent of /dev/urandom from linux ? Or any kind of system entropy pool ?

  • 3
    $\begingroup$ The CryptGenRandom function is probably what you're looking for. $\endgroup$ – Stephen Touset Jan 20 '15 at 22:13
  • 4
    $\begingroup$ I think this may be off-topic because questions about specific security implementations that do not relate to the underlying cryptographic algorithms should be asked on Security Stack Exchange $\endgroup$ – cpast Jan 21 '15 at 3:30

So far as I know, Windows does not (but you never know, it has an endless series of APIs so anything is possible). However, Intel hardware does. The Microsoft C/C++ compiler (and the Intel compiler) has intrinsics for obtaining a hardware generated random value. That value is obtained by running two circuits backwards so that are unstable. They generate a ton of very random bits which are then cleaned up. Intel has some white papers on it. I don't know if AMD processors have the same thing. I don't have either the name of the functions or the white paper handy, but you can find them with a web search (or, for the functions, look in the header files).

  • $\begingroup$ It is not a good idea to use the raw output from hardware RNG instructions; best practice is to mix this with other independent sources of entropy. That said, Windows does have an API for this, as I mentioned in my comment. $\endgroup$ – Stephen Touset Jan 20 '15 at 23:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.