Terminal asks for passphrase even when passphrase is cached by gpg-agent

Hauke Laging mailinglisten at hauke-laging.de
Tue Oct 28 19:06:08 CET 2014

Am Di 28.10.2014, 22:06:36 schrieb Sudhir Khanger:

> I have gpg-agent cache passphrase. When I run gpg -c text.txt it asks
> for passphrase twice like it normally would but Kgpg or KMail don't.

You probably mean that Kgpg asks just once. KMail isn't capable of 
creating symmetrically encrypted mails thus I don't know what you mean 

I have created a wishlist entry to change that:

> What am I suppose to do to make both terminal and GUI apps use cached
> passphrase instead of asking for one?

That is not possible AFAIK because a passphrase used in symmetric 
encryption is not a passphrase in the usual gpg-agent sense. gpg-agent 
is used for asking those just because it's already there.

You can call gpg in batch mode (which probably is what Kgpg does):

gpg --batch --passphrase foo --symmetric file.txt

Note that this way everyone on the system can see the passphrase in the 
argument list. You may use something like

echo -n foo | gpg --batch --passphrase-fd 0 --symmetric file.txt

instead (where echo is a shell builtin or something else that does not 
show its arguments in the process list).

Crypto für alle: http://www.openpgp-schulungen.de/fuer/unterstuetzer/
OpenPGP: 7D82 FB9F D25A 2CE4 5241 6C37 BF4B 8EEF 1A57 1DF5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: </pipermail/attachments/20141028/b14cec74/attachment.sig>

More information about the Gnupg-users mailing list