I forgot my GPG key passphrase.
I know my computer is storing it somewhere because I decrypt strings with it, without a password, for example:
$ gpg --decrypt -r me@example.com ~/.password-store/gmail.gpg
You need a passphrase to unlock the secret key for
user: "Example <me@example.com>"
2048-bit RSA key, ID 02BFF027, created 2014-10-04 (main key ID 410A4C4A)
gpg: NOTE: secret key 02BFF027 expired at Thu 4 Oct 17:30:49 2018 EDT
gpg: encrypted with 2048-bit RSA key, ID 02BFF027, created 2014-10-04
"Example <me@example.com>"
princess
The above output manages to decrypt ~/.password-store/gmail.gpg; it knows my key is expired and it knows it needs a passphrase, but somehow it manages to decrypt the string nonetheless (my password is not "princess", this is just for illustration purposes).
I am assuming GPG Agent is being used to pass the passphrase to gpg.
Is it possible to do something like:
gpg-agent --display-passphrase 02BFF027
?
gpg --passwd 02BFF027