WinRandom for Python

2008-09-19 00:00:00 +0100


This module gives direct access to Windows Cryptographic API CryptGetRandom() function. The range() function uses B.5.1.1 Simple Discard Method from NIST SP800-90 with FIPS 140-2 p. 44 Continuous random number generator test. Example of winrandom usage:

>>> import winrandom >>> print winrandom.long() 2141228967 >>> print repr(winrandom.bytes(10)) '\xe6C\xfe\xbeRA\xfck"f' >>> print winrandom.range(1000) 123

Resources: