[Python-de] urandom "suitable for cryptographic use"?

Vinzent Hoefler 0439279208b62c95f1880bf0f8776eeb at t-domaingrabbing.de
Mi Mai 9 20:23:55 CEST 2012


Thomas Rachel wrote:

> in der Python-Dokumentation unter
> http://docs.python.org/library/os.html#miscellaneous-functions las ich
> folgendes:
>
> Return a string of n random bytes suitable for cryptographic use.

"Cryptographic use" ist natürlich sehr weitläufig. ;)

> [...] The returned data should be unpredictable enough for cryptographic
> applications, [...] On a UNIX-like system this will query /dev/urandom,
> [...]
>
> Das verwundert mich ein wenig; ich dachte eigentlich, /dev/urandom sei
> gerade nicht für "cryptographic use" geeignet, wegen des potentiell
> leeren Entropiepols,

Der eigentlich nur direkt nach dem ersten Start des Systems wirklich "leer"
sein kann.

> und daß man für diese Einsatzwecke where
> /dev/random nehmen sollte.

Nein. Es sei denn, Du willst One-Time-Pads erzeugen. Dafür ist /dev/urandom
tatsächlich keine geeignete Quelle. Als Startwert für einen CPRNG reicht es
allemal.


Vinzent.

-- 
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
      -- Nathaniel Borenstein


Mehr Informationen über die Mailingliste python-de