WinRandom for Python

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:

winrandom-ctypes

If you are looking for a ctypes based implementation, have a look at Gregory Taylor's winrandom-ctypes. Advantages are obvious - no need to compile anything, ctypes module is included in Python starting from 2.5.

Downloads

ZałącznikRozmiar
winrandom-1.2.zip3.46 KB
winrandom-1.2.win32-py2.7.exe197.25 KB
winrandom-1.2.win32-py2.7.exe_.sig490 bajtów
winrandom-1.2.zip_.sig490 bajtów