FazBrowse Wikipedia Viewer | Main Page |
Search Wikipedia:
|
Viewing: https://en.wikipedia.org/wiki/CryptGenRandom

CryptGenRandom

CryptGenRandom is a cryptographically secure pseudorandom number generator function that is included in Microsoft CryptoAPI. In Win32 programs, Microsoft recommended its use anywhere random number generation is needed (it has since been replaced by BCryptGenRandom, see below). The kernel32 equivalent is RtlGenRandom.

A 2007 paper from Hebrew University suggested security problems in the Windows 2000 implementation of CryptGenRandom (assuming the attacker has control of the machine). Microsoft later acknowledged that the same problems exist in Windows XP, but not in Vista. Microsoft released a fix for the bug with Windows XP Service Pack 3 in mid-2008.

CryptGenRandom is deprecated as it belongs to the deprecated Windows CryptoAPI. The modern Cryptography API: Next Generation (CNG) replacement is BCryptGenRandom (and the underlying functions ProcessPrng and SystemPrng).

CryptGenRandom, currently based on an internal function called ProcessPrng, which returns bytes from the process's per-processor PRNG. The PRNG always uses the AES-CTR-DRBG algorithm as specified by FIPS SP800-90. Although advapi32.dll) can be called to generate secure random data, as shown below. If this is not an issue, the program should use the newer RtlGenRandom to generate cryptographically secure random numbers.
  • the Python function urandom in the os module, which uses /dev/urandom on Unix-like systems, calls CryptGenRandom on Windows systems.
  • the "RtlGenRandom function (ntsecapi.h)". Microsoft Learn. Microsoft. 22 February 2024. Retrieved 7 November 2024.
  • ↑ "CNG Algorithm Identifiers (Bcrypt.h) - Win32 apps". learn.microsoft.com. 13 April 2023. Note: Beginning with Windows Vista with SP1 and Windows Server 2008, the random number generator is based on the AES counter mode specified in the NIST SP 800-90 standard. [...] Windows 10: Beginning with Windows 10, the dual elliptic curve random number generator algorithm has been removed. Existing uses of this algorithm will continue to work; however, the random number generator is based on the AES counter mode specified in the NIST SP 800-90 standard.
  • ↑ "The Random Number Generator Validation System (RNGVS)" (PDF). National Institute of Standards and Technology Computer Security Division. 31 January 2005. Archived from the original (PDF) on 24 February 2013. Retrieved 18 June 2013.
  • ↑ "Archived copy". Archived from the original on 2006-09-08. Retrieved 2007-08-27.{{cite web}}: CS1 maint: archived copy as title (link)
  • ↑ Crypto API Next Generation (Windows)
  • ↑ BCryptGenRandom (Windows)
  • ↑ https://docs.python.org/2/library/os.html#os.urandom Python Library Reference, OS module
  • ↑ http://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunMSCAPI Oracle Java SE 8 technical documentation, Sun Providers
  • External links

    edit

    View original on Wikipedia | Back | FazBrowse Home