I've read quite a few different articles on how to setup PGP keys with an offline master key. I own multiple YubiKey NEO hardware smart cards which I intend on using for PGP and as an SSH key. One of the hardware keys will be my daily driver, the others kept in secure locations elsewhere in case of a loss of the key. The master key, as recommended elsewhere will exist offline in a secure location, as I'll only need to access it when I need to revoke subkeys.

I see that there are three types of keys that I'll need to maintain:

  1. Offline master key.
    • Only one.
    • Responsible for signing and revoking subkeys.
    • Exists completely offline in a secure location.
  2. Shared encryption key.
    • Only one.
    • Responsible for encryption and decryption.
    • Exists simultaneously on all hardware smart cards and offline in a secure location.
  3. Shared authentication key.
    • Only one.
    • Responsible for SSH authentication.
    • Exists simultaneously on all hardware smart cards and offline in a secure location.
  4. Signing keys.
    • One per hardware smartcard.
    • Responsible for signing things.
    • Only exists on a single hardware smartcard, no need for an offline backup.

Is this the general idea behind having subkeys? As I'll primarily be using my smart cards for SSH authentication first, and PGP encryption/decryption second, does this setup make sense?

I've not heard of people using a shared encryption key, is this possible? For each card, I suppose I'd do something where I'd do gpg --card-edit and import the encryption/decryption keypair and then generate and import the new signing keypair, signing it with the offline master key. Is there a guide on how to do this somewhere?

I'm new to subkeys and I'm still trying to learn the ropes of what's possible and what would be "best" for security.


Your approach seems reasonable; I'd add that the master key is also used for managing user IDs (which makes it important for maintaining trust in the web of trust).

The idea behind having a single encryption key is the fact OpenPGP lacks a way to couple a given subkey to a device or user ID. For signing subkeys, on the other hand, this does not matter, an available key is used instead.

A shared encryption key is well possible to achieve also with OpenPGP smartcards (a Yubikey in the end simply acts as one) using the keytocard command in the --edit-key (not --card-edit) menu. The FSFE wiki page on OpenPGP smartcards hosts an in-depth tutorial, covering pretty much all possible scenarios of using OpenPGP smartcards (the FSFE membership card is an OpenPGP smartcard).

  • 1
    Do note that the FSFE card can only perform 2048-bit RSA, so it can't store 4096-bit PGP keys. – Diti May 13 '15 at 9:31
  • have you actually seen a shared key work on multiple yubikeys and if so what version of gnupg are you using? – Arthur Ulfeldt Aug 18 '15 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.