Package Crypto :: Package Random :: Package OSRNG :: Module nt :: Class WindowsRNG
[frames] | no frames]

Class WindowsRNG

      object --+    
               |    
rng_base.BaseRNG --+
                   |
                  WindowsRNG

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
 
flush(self)
Work around weakness in Windows RNG.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from rng_base.BaseRNG
 
__del__(self)
 
__enter__(self)
 
__exit__(self)
PEP 343 support
 
close(self)
 
read(self, N=-1)
Return N bytes from the RNG.
Class Variables
  name = "<CryptGenRandom>"
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

flush(self)

 
Work around weakness in Windows RNG.

The CryptGenRandom mechanism in some versions of Windows allows an
attacker to learn 128 KiB of past and future output.  As a workaround,
this function reads 128 KiB of 'random' data from Windows and discards
it.

For more information about the weaknesses in CryptGenRandom, see
_Cryptanalysis of the Random Number Generator of the Windows Operating
System_, by Leo Dorrendorf and Zvi Gutterman and Benny Pinkas
http://eprint.iacr.org/2007/419

Overrides: rng_base.BaseRNG.flush