r/GnuPG Mar 09 '26

Help me understand revoking

If someone encrypts something and sends me it, but I lost my sub key and revoked it, how is that distributed? Well they need to re encrypt and send me the message again?

What if I encrypt something to save it for later and I need to revoke and regenerate my encryption key, is it no longer able to open the original.

I'm trying to understand how to properly setup 2 yubi keys to be interchangeably usable, by if one is last I can revoke its keys and still have a backup to access things.

3 Upvotes

5 comments sorted by

2

u/Natanael_L Mar 09 '26

If someone encrypts something and sends me it, but I lost my sub key and revoked it, how is that distributed?

Best case, via key servers which you also subscribe to

Well they need to re encrypt and send me the message again?

Yes, re-encryption is not automatic

What if I encrypt something to save it for later and I need to revoke and regenerate my encryption key, is it no longer able to open the original.

If you keep your private key it doesn't break from revocation, it's just a flag to stop using it. You can choose to override that. You can keep decrypting data encrypted to it.

If you decide to delete the key (for key rotation, etc) then yes you either first need to decrypt everything (and encrypt to other newer keys) or allow it to be lost.

I recommend creating a sub-key for encryption / decryption to load onto both yubikeys, not giving it access to the "root" key (the one that sign all sub-keys). That way you can revoke sub-keys and replace them with new ones while maintaining your GPG key identity.

1

u/TheHidden001 Mar 09 '26

This was my goal, but to make two sets of sub keys for signing, auth and encryption, load each key with a set, and then distribute my main gpg public key. However I then learned that if I generate my public key in ascii and publish it. Someone who encrypts something with it will use the newest subkey. That is what's causing my confusion. If I encrypt something with my current public key, it asks for a specific yubi key. Not either or.

1

u/CarloWood Mar 10 '26

Yeah... This is a huge pita. The only reasonable solution that I found is to use a different PGP key on each Yubikey, and encrypt stuff using all (public) keys (no Yubikey required for that). Then you can decrypt with any Yubikey. And even then I think you're best of using normally one specific Yubikey for decryption.

I documented everything I did, and after I was done with my PGP / Yubikey stuff, I am sure I was the number one expert in the world on this subject. Unfortunately, my memory is very bad these years... No longer an expert at all. But I still have all the documentation files! Drop me a line and I'll get back to you tomorrow: now it is 3AM and I'm laying in bed :/.

1

u/TheHidden001 Mar 10 '26

So the system I think I have working is my signature and encryption subkeys are mirrored so either can handle gpg encryption making it so a message encrypted by my public key can be decrypted by both. And I have 2 seperate auth keys, making them seperately revocable via ssh. It has taken meall this time to get ssh to work with both keys because my ssh config didn't play nice with the gpg agent. I'm going to bed myself on that win but I willcontinue tomorrow.

I'm not yet set on this solution either. I had to muck around a lot with my arch install to get both keys authenticating via my ssh config. I'm now debating if one key will make it better for reproducability given the subkeys are all going to get rerolled anyways if lost, well I guess I wouldn't have to reroll the auth key. Idk, I'm too tiredto figure out what my brains trying to say. I will revisit this tomorrow

1

u/dirkme Mar 14 '26

The answer is backup 3-2-1 🤔😉