Generating random bytes for GPG

When generating a new GPG key random data is used, the larger the key size the more data that is needed. If you find your system waiting for more random data with the following message:

Not enough random bytes available.  Please do some other work to give the OS a chance to collect more entropy! (Need 282 more bytes)

The following command can be used to speed up this process:

dd if=/dev/zero of=/tmp/5gb.tmp bs=1G count=5

The above command will create a 5Gb file in /tmp which can be deleted after the GPG key generation is complete. A smaller file size may also work if space is limited, or the command can be run multiple times.

Last updated: 19/02/2012