GPG with GPUs

Peter Lebbing peter at
Mon Jun 18 17:37:41 CEST 2012

On 18/06/12 10:49, Werner Koch wrote:
> On Mon, 18 Jun 2012 05:31, rjh at said:
>> results can check for themselves.  Warning: if you ever write Python
>> code like this in the real world your programming team will beat you to
>> death.
> To me this awk script is more readable, although most other will
> disagree:
>   $ gpg2 --gen-random 0 262144 | time gpg2 --always-trust --batch -ea \
>     $(gpg2 --with-colons -k | awk -F: \
>     '$1=="pub" && $2~/[fmu]/ && $12~/[E]/ {print "-r "$5;if(++cnt>50){exit}}')\
>      >/dev/null
> resulting in
>   0.32user 0.03system 0:01.00elapsed 
> On a slower machine but likely with another state of the entropy pool.

Just as a datapoint: I have a VIA Nano L2200 @ 1.6 GHz, which is a slow
processor (competition for the Intel Atom), but which has a hardware RNG hooked
up to /dev/random through rngd. I'm fairly sure that it's configured correctly
and that /dev/random will not starve.

It encrypts to the first 50 pubkeys in my ring as follows:

1.51user 0.14system 0:02.02elapsed 81%CPU (0avgtext+0avgdata 12992maxresident)k
0inputs+16outputs (0major+894minor)pagefaults 0swaps

It's a 64-bit Debian testing. I had to install the "time" package[1]. I also had
to remove the "$2~/[fmu]/" test as I have only 47 valid keys :).

System load was low when performing the test. Less than 10 percent CPU usage by
other processes.


[1] The bash keyword "time" can only be at the start of a command line. It can't
be used in the middle of a pipe. It's a keyword, not a builtin.

I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at

More information about the Gnupg-users mailing list