how to add a passphrase to a keypair

Jack ostroffjh at users.sourceforge.net
Sun Oct 3 01:12:45 CEST 2021


Is it possible to add a passphrase to a secret key originally created  
without one?  If so, please tell me how.  I'll be happy with either  
instructions or pointer to the fine manual I either missed or misread.

I have tried lots of variations.  Attempts using gpg-agent fail because  
pinentry (I've tried text and gui versions) refuses to accept a blank  
passphrase.  Variants using --passphrase or --passphrase-fd don't work  
because they only allow passing one passphrase, and I need to provide  
the old one and the new one.  I've also tried --export-secret-key,  
which also fails with "error receiving key from agent: No passphrase  
given - skipped" when using --passphrase-fd.

I do have a copy of gpg-1.4.23 available, but simply copying .gnupg to  
a new user and using the old gpg doesn't help because gpg1 doesn't see  
the secret keys from gpg2, and I haven't been able to export them.

Is there a way to do this, or is revoking the old key and creating new  
keys from scratch the only solution?

Thanks for any information.

Jack



More information about the Gnupg-users mailing list