passphrases in batchmode
Jack McKinney
jackmc-gnupg-users@lorentz.com
Mon, 13 Nov 2000 12:24:33 -0600
--azLHFNyN32YCQGCU
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,
>=20
> 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).
>=20
> I can do this with PGP ("pgp +batchmode -z$pwd"), but I'd prefer to use
> GnuPG.
>=20
> 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." jackmc@lorentz.com
-Former NSA employee http://www.lorentz.com
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 http://www.gnupg.org
iEYEARECAAYFAjoQMeAACgkQimeon9aPLAevwACgrHBlq2/iuJ96pikVJEOeKl4W
NLsAn0s4myMQX7b1umkmrvaJe+bldfYk
=9pn3
-----END PGP SIGNATURE-----
--azLHFNyN32YCQGCU--
--
Archive is at http://lists.gnupg.org - Unsubscribe by sending mail
with a subject of "unsubscribe" to gnupg-users-request@gnupg.org