How do I flush a bad symmetric password from gpg-agent?

Doug Barton dougb at
Fri Aug 21 07:12:56 CEST 2009

Daiki Ueno wrote:
>>>>>> In <4A8C5344.4060701__17863.5451746688$1250713354$gmane$org at> 
>>>>>> 	Doug Barton <dougb at> wrote:
>>>> Today I mis-typed a passphrase for a symmetrically encrypted file and
>>>> was surprised to discover that gpg-agent had stored the bad passphrase
>>>> and would not let me access the file. I have occasionally in the past
>>> This is a new and probably not too well tested feature.  I'll check whey
>>> this is going wrong.
>> Fair enough, thanks.
> That's my fault, sorry.  The attached patch should fix the problem.
> Could you try it?

Thanks! This produces the following output with the wrong passphrase:

gpg --decrypt file.gpg
gpg: DBG: cleared passphrase cached with ID: ABCD1234567890
gpg: decryption failed: Bad session key

Then when I try to decrypt the file again I get reprompted for the
passphrase which is a huge improvement. If I had the chance to choose
I would prefer the same sort of UI as the private key or ssh key uses
when the wrong passphrase is entered (e.g., "Invalid passphrase;
please try again") but the change in your patch is definitely a huge

Thanks again,


More information about the Gnupg-users mailing list