I accidentally messed up months ago by keytocard'ing a seret key before making an offline locked-away backup of it. I failed at reading comprehension and did not know that this would delete the key material after a successful move, and leave my backup without the actual key material. The key is structured as a signing key with an encryption and an authentication subkey. I still have access to the card where things were moved to, but I of course want to rectify the case of not having backups.

Doing --list-packets on my secret key backup gives

:secret key packet:
        version 4, algo 1, created REDACTED, expires 0
        pkey[0]: [4096 bits]
        pkey[1]: [17 bits]
        skey[2]: [v4 protected]
        keyid: REDACTED
:secret sub key packet:
        version 4, algo 1, created REDACTED, expires 0
        pkey[0]: [4096 bits]
        pkey[1]: [17 bits]
        gnu-divert-to-card S2K, algo: 0, simple checksum, hash: 0
        serial-number:  REDACTED
        keyid: REDACTED
:secret sub key packet:
        version 4, algo 1, created REDACTED, expires 0
        pkey[0]: [4096 bits]
        pkey[1]: [17 bits]
        gnu-divert-to-card S2K, algo: 0, simple checksum, hash: 0
        serial-number:  REDACTED
        keyid: REDACTED

(after some trimming and redactions).

The fact that only the subkeys (the E and A caps) are missing from the backup, and that in fact the main (signing) key can be salvaged.

  • How can I verify the above suspicion? I don't understand how to tell GPG to stop using the card if secret key material is present off-card.
  • If the main key backup is intact, is it sound course of action to generate new E and A subkeys, decrypt all secret data I have while the old E key is still available on the card, re-encrypt it all with the new E key, make new backup key material, then keytocarding the new subkeys?
  • Have you distributed this key? If you're the only one using it it might be simpler to decrypt everything (as you suggest in your second bullet) and just start over with a new master keypair. – user8675309 Oct 12 at 14:34
  • Sadly the master (signing) key has been distributed. I'd rather not loose the signatures on it. – gspr Oct 12 at 17:14
  • I believe you could make a new key, sign (endorse) it with the master key in question, then revoke your original master key to 'pass on' the signatures on your original master key (others see "I trust key A, key A trusts key B, so I can trust key B"). I'm not 100% up on the web of trust stuff though so you might ought to wait for a better answer. – user8675309 Oct 22 at 17:41

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.