...
Wiki Markup |
---|
[CryptGenRandom()|http://msdn.microsoft.com/en-us/library/aa379942.aspx] does not run the risk of not being properly seeded. The reason for that is that its arguments serve as seeders. From the Microsoft Developer Network {{CryptGenRandom()}} reference \[MSDN\]: |
The CryptGenRandom function fills a buffer with cryptographically random bytes.
Syntax
BOOL WINAPI CryptGenRandom(
__in HCRYPTPROV hProv,
__in DWORD dwLen,
__inout BYTE *pbBuffer
);Parameters
Wiki Markup hProv \[in\] Handle of acryptographic service provider(CSP) created by a call toCryptAcquireContext. dwLen \[in\] Number of bytes of random data to be generated. pbBuffer \[in, out\] Buffer to receive the returned data. This buffer must be at leastdwLenbytes in length. Optionally, the application can fill this buffer with data to use as an auxiliary random seed. \\
...