RandomBytes uses deprecated API (CryptAcquireContext) in Windows (use BCryptGenRandom) · Issue #524 · PQClean/PQClean · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The RandomBytes implementation for Windows uses CryptAcquireContext/CryptGenRandom which has been deprecated for years and has been claimed to have security risks. Microsoft has also specified in it's documentation that this API may be removed from newer version of Windows. (details below)
thomwiggers
changed the title
RandomBytes uses insecure and deprecated API (CryptAcquireContext) in Windows (use BCryptGenRandom)
RandomBytes uses deprecated API (CryptAcquireContext) in Windows (use BCryptGenRandom)
Nov 22, 2023
I don't think any known security problems exist in the currently supported versions of Windows, so I'm removing "insecure" from the title of this issue.
The RandomBytes implementation for Windows uses CryptAcquireContext/CryptGenRandom which has been deprecated for years and has been claimed to have security risks. Microsoft has also specified in it's documentation that this API may be removed from newer version of Windows. (details below)
https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecontexta
https://en.wikipedia.org/wiki/CryptGenRandom
BCryptGenRandom is the recommended option as per Microsoft
https://learn.microsoft.com/en-us/windows/win32/seccng/cng-portal
https://learn.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom
An example implementation at (not production tested):
https://github.com/DogeProtocol/hybrid-pqc/blob/main/random/randombytes.c
The text was updated successfully, but these errors were encountered: