passphrases in batchmode

Jack McKinney
Mon, 13 Nov 2000 12:24:33 -0600

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Big Brother tells me that Mark Koek wrote:

> Hello all,
> Something I've been unable to find in the documentation is how to feed
> gpg a passphrase from a script (i.e., without having to enter it on the
> command line).
> I can do this with PGP ("pgp +batchmode -z$pwd"), but I'd prefer to use
> GnuPG.
> But how?
You can pass it on a file descriptor. With zsh, this can easily be done from the command line: gpg --passphrase-fd 3 -c 3<<< "My passphrase" < unencrypted > encrypted If your file does not need to be piped, then you could use: echo "My passphrase" | gpg --passphrase-fd 0 -o encrypted -c encrypted I haven't tried this, though, as with zsh it is not necessary. -- "In God We Trust. Jack McKinney Everyone else we monitor." -Former NSA employee 1024D/D68F2C07 4096g/38AEF076 --azLHFNyN32YCQGCU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see iEYEARECAAYFAjoQMeAACgkQimeon9aPLAevwACgrHBlq2/iuJ96pikVJEOeKl4W NLsAn0s4myMQX7b1umkmrvaJe+bldfYk =9pn3 -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU-- -- Archive is at - Unsubscribe by sending mail with a subject of "unsubscribe" to