securerandom

Base class for cryptographic secure random number generation :authors: Gary Belvin

class securerandom.OpenSSLRand[source]

Bases: securerandom.SecureRandom

Uses the OpenSSL PRNG for random bits

getRandomBits(length)[source]
getRandomBytes(length)[source]
class securerandom.SecureRandom[source]

Bases: object

addSeed(seed)[source]

Add randomness to the generator. Always increases entropy

getRandomBytes(length)[source]

Returns a random bit string of length bytes

class securerandom.SecureRandomFactory[source]

Bases: object

This class provides a central place to swap out the randomness engine used by the charm framework. Classes should call rand = SecureRandomFactory.getInstance() to acquire a randomnesss generator

classmethod getInstance()[source]
class securerandom.WeakRandom[source]

Bases: securerandom.SecureRandom

addSeed(seed)[source]
getRandomBytes(length)[source]
classmethod myrandom(length, printable=False)[source]

This method does NOT provide cryptographically secure random numbers. This should NOT be used for production code