2

I intend to start using GnuPG respective mail encryption with GnuPG. So I created a key pair with a short expiry date to gain some understanding.

I read some stuff about removing the secret masterkey from the keyring and just work with subkeys. After doing this (following some explanations in two blogs) I still have a question.

If I just remove the secret-masterkey and my PC gets stolen or something, then what can I actually do with only the secret-masterkey? I think I can revoke the subkeys, but can I create a new public-key and public-subkeys with the secret-key?

Or: is the idea doing a backup of the ~/.gnupg folder and removing the secret masterkey from the PC afterwards? So in case the PC gets stolen I still have all the keys for revocation?

1

The idea behind an offline OpenPGP primary (master) key is that an attacker getting access to your computer will not be able to perform key management operations (creating/revoking new user IDs and subkeys, revoking your key, certifying other's keys). Furthermore, the primary key is the target of certifications between keys -- if you lose it (have to revoke it), you lose all connections in the web of trust. The primary private key is the most important entity in OpenPGP, and should protected accordingly. By removing the primary private key, you reduce the key's exposition to possible attacks, as it during the time the attacker has access to the computer.

Some people go even further and put the primary private key on a separate, dedicated machine not connected to any network, which further prevents attacks to this air-gapped computer.

If I just remove the secret-masterkey and my PC gets stolen or something, then what can I actually do with only the secret-masterkey? I think I can revoke the subkeys, but can I create a new public-key and public-subkeys with the secret-key?

There is no reason of not putting a public key next to the private key. In fact, the OpenPGP standard does not even consider private keys without the public keys stored together (OpenPGP smart cards are an exception here). Also make sure to have a backup of the private key, of course (which should be kept separately, but with the same security level as the private key itself)!

Or: is the idea doing a backup of the ~/.gnupg folder and removing the secret masterkey from the PC afterwards? So in case the PC gets stolen I still have all the keys for revocation?

This seems like the most reasonable way to go, but keep the backup safe. If the PC gets stolen/compromised/..., you can still revoke the primary key itself, or only rotate the subkeys (which is much easier to handle in terms of key management).

I for myself created the primary key on my old laptop, which is also used to create the subkeys and has all of them. This old laptop has the secret key imported and ready-to-use in the GnuPG keyring, but is not used for any other work but key management and certifications. For the daily-use machines, I export the respective secret subkeys individually as required.

A revocation key is readily available at several places, among them my daily-use laptop. The worst thing that might happen is the key gets revoked, but no further damage can be performed while I have additional protection against loss of the primary private key without being able to revoke it on the key servers.

  • If the PC gets stolen/compromised/..., you can still revoke the primary key itself Would that be the same as start from zero? E.i. the old keypair is unusable and I've to create a new keypair, getting new signatures, signing other keys, etc. – prankenandi Jan 15 '16 at 19:53
  • Yes, this is what you want to mitigate. But there's one thing even worse than "starting from scratch": there's a public key left on the key servers, without you being able to change anything about that. – Jens Erat Jan 15 '16 at 21:40
0

Your second idea is the right one. You generally should back up all your important data, and your GnuPG keys definitely are important.

The idea is not about keeping just the master key, but about making sure an attacker is unable to get the master key while you are still able to do your daily business with GnuPG on that machine.

As soon as the master key is compromised, you have to start at zero, generate a new key, get new signatures and so on. On the other hand, if just your subkeys are compromised, you can revoke them and generate new ones, keeping the signatures on your master key.

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.