how to add a passphrase to a keypair

Robert J. Hansen rjh at sixdemonbag.org
Sun Oct 3 18:53:54 CEST 2021


> gpg -k and gpg -K both show my main key.  I compiled a copy of gpg1 (not 
> installed to the system) to try to use locally, since it doesn't enforce 
> the use of a passphrase for the secret key.  Unfortunately, without 
> secring.gpg, it doesn't see the secret key at all.

I haven't tried this, but it might be exactly what you want to do:

/path/to/gpg2 --export-secret-keys 0xMY_KEY_ID > secret.gpg
/path/to/gpg1 --import secret.gpg

When you import the secret key, secring.gpg will be recreated, and the 
corresponding public key will be automatically imported into 
pubring.gpg.  (A copy of the public key is embedded into each secret key.)

At that point you'll have the necessary pubring.gpg/secring.gpg files, 
and should be able to change the passphrase at a GPG1 command line.




More information about the Gnupg-users mailing list