sending multiple passwords

Adam M. adamm at
Sun Jun 29 21:16:00 CEST 2008

It seems to me that it is impossible to send multiple passwords to GPG
without direct user interaction on a TTY. I've been trying to write a
GPGME-like library for .NET, but am running up against what seem to be
hard limitations in this area.

The documentation says that --passphrase-fd, --passphrase, etc accept
only a single password. I tried parsing the --status-fd stream and
writing the passwords to STDIN, but that didn't work because GPG reads
directly from the TTY, which seemingly can't be redirected.

This prevents signing symmetrically-encrypted data (since both the
signing and the encryption prompt for a password), as well as signing
data with multiple signatures.

It would be very nice if GPG supported a simple method of sending
multiple passwords, for instance reading the passwords from STDIN after
sending the NEED_PASSPHRASE message, if --no-tty and --batch and
--status-fd are specified and --passphrase-fd and --passphrase are not
specified, or something like that.

Is there any hope of having this implemented? (I might even volunteer to
write the code if nobody else will, assuming that the patch would be

-- Adam

Encrypt your email! Use GnuPG ( along with:
* Enigmail ( for Thunderbird
* FireGPG ( for GMail, Hotmail, etc.
* GPGOE ( for Outlook Express
* GData ( for Outlook
My public key is available at

More information about the Gnupg-devel mailing list