Skip to main content

Python interface to Intel hardware rng

Project description


A module to use Intel's hardware RNG with python's random class


#easy_install rdrand

>>>from rdrand import RdRandom
>>>r = RdRandom()

At this point, ``r`` will behave just like ``random``

``RdRandom`` is a subclass of ``random.Random``, and behaves like ``random.Random``,
but it uses inline assembly to access the hardware RNG. This should be
a cryptographically secure drop in replacement for ``random``, if the Intel random number
generator is valid. No mitigation is done to modify the output of the hardware to prevent problems with Intel's implementation. Caveat Emptor.

Also, it includes the function ``r.getrandombytes(i)`` where ``i`` is a positive int. This returns a string
of length ``i`` filled with random bytes, which is ideal for generating a key or using directly in a protocol.

Please note, as with any security solution, it is possible to subvert this. Please understand the full context before deploying. I am not liable for misuse or clever hackers.

Please note, that is also currently works on 64 bit builds. I will extend this to 32 bits in the future.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rdrand, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size rdrand-0.2.2.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page