I'm currently generating a new gpg cryptographic key, and I'm using a new laptop for this. I can notice that the key generation step, which involves the random generation, is extremely quick, while I can recall that, on my old laptop, this process required a certain amount of time.

For a normal operation this should be reasonable, as I'm working on a more recent computer, but for this operation I would expect that much more time is needed. The software asks me to "type on the keyboard, move the mouse, utilize the disks", but everything terminates before I can do anything.

Yes, probably there's some other source of entropy besides the user input, and I don't know which one are taken in account by the kernel. But to be sincere, in the light of the recent revelations about global surveliance, I became even more paranoid, and the idea that my brand new laptop could be tampered by design to yield weak random cyphers popped out of my mind.

So the question is: is it safer to generate the keys using old hardware?

1 Answer 1


New laptop, new software. For proper randomness, enough entropy must be gathered from hardware events, but nothing forces this gathering not to begin before the launch of the key generation process. In modern operating systems, the OS kernel is the piece of software which gathers hardware-related data, and it centralizes this process. Once sufficiently much entropy has been gathered (roughly speaking, at least 128 bits), it suffices to extend it with cryptographically secure PRNG, and you will get randomness by the megabyte (at least, pseudorandomness computationally indistinguishable from true randomness, and that's good enough for cryptography).

In Linux terms, this is the difference between /dev/random and /dev/urandom. Possibly, the OS and GnuPG version you have on your new laptop do the sensible thing and use /dev/urandom, while the previous version indulged in some weird but widespread randomness fetish and irrationally insisted on "true randomness" for some notion of "true".

Be assured that if your laptop hardware and software had been tampered with, you would not notice it with something as crude as faster key generation. Competent spies know better.

  • 1
    "Competent spies know better." This may very well prove false. ;)
    – user10211
    Jul 28, 2013 at 13:55
  • 1
    @TerryChia But would we still call them competent then?
    – Luc
    Jul 28, 2013 at 16:17

You must log in to answer this question.

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