I am creating an application which runs on a mobile node with Ubuntu, which does not generate enough entropy bytes to the /dev/random, and does not always stay connected on the Internet to use typical socket entropy-gathering solutions such as EGD.

Are there any good tools for gathering the needed entropy in my situation?

Just to clarify, trying to get 1024 bytes (which seems to be the recommended value by the OpenSSL book) via /dev/random took nearly two hours...

1 Answer 1


The proper way is to use /dev/urandom, not /dev/random. There are very few cryptographic algorithm for which /dev/random is even theoretically better than /dev/urandom (this would be information-theoretic secure algorithms, not mundane things like AES or RSA). /dev/urandom produces randomness of cryptographic quality provided that it could get at some point at least 20 bytes or so of "true randomness", something which the OS took care of during installation. /dev/urandom happily extends that initial seed into megabytes of pseudo-alea which is computationally indistinguishable from true randomness (that's all you need), and it will never block.

  • Thanks, this at least worked. If someone has anything to add regarding the strength/entropy of the bytes produced I would apreciate it, as it only seems to be (at least) 20 byte entropy to me (from your statement?)
    – efr4k
    Commented Apr 23, 2011 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .