speed up key generation with artificial entropy

February 9, 2010

in linux

Quick Tip:

If you’re waiting forever when doing:

gpg --gen-key

or something similar, you’re not alone. I often have to do this on a remote machine, which doesn’t have physically attached HID’s to help increase the system entropy level. Because of how often I had to regen keys for some testing, I had to find a better way — and I did.

There’s a neat tool, “rngd”, which will essentially pump artificial randomness into your system. On Ubuntu (and debian, I presume), it’s part of the rng-tools package. It runs as a daemon, so you can just start it with something like:

rngd -r /dev/urandom

Then generate your keys. You can kill the rngd process when you’re done, but it doesn’t take up a large amount of resources when idle. You’ll be amazed at how much of a time saver this is…

Cheers!

{ 1 comment… read it below or add one }

julien April 6, 2011 at 5:47 am

Nice trick, but this makes you use the unsecure /dev/urandom when you call the secure /dev/random. All in all, you reduce the security of your crypto application which might not be such a good idea.

Leave a Comment

Previous post:

Next post: