[PYTHON-CRYPTO] /dev/random vs. /dev/urandom

Andrew Kuchling akuchlin at mems-exchange.org
Tue Jun 11 19:50:31 CEST 2002

On Tue, Jun 11, 2002 at 10:27:31AM -0500, Mark McEahern wrote:
>Nonetheless, I noticed in the recently released pycrypto-1.0a2
>(http://www.amk.ca/python/code/crypto.html), the randpool.py initializes
>with /dev/urandom rather than /dev/random.  That leads to two questions:

It uses /dev/urandom simply because urandom won't block; using
/dev/random, the test suite could just hang, waiting for enough
entropy to accumulate.

>1.  Should the selection of which random device to use be optional?

Quite possibly; this is after all a choice of mechanism that users
might not agree with.  I haven't yet come to a decision on this, and
it might well change in 1.9alpha4.  (1.9alpha3 will be coming out
tonight, in order to fix a refcounting error in 1.9a2 that causes core

--amk                                                             (www.amk.ca)
HAMLET: Let me not think on't -- Frailty, thy name is woman!
    -- _Hamlet_, I, ii

More information about the python-crypto mailing list