Suppressing passphrase prompt

Steve Butler
Fri Jun 21 18:16:01 2002

Oops.  I gave my decrypt script which has the passphrase stuff.  Here is my
encrypt script which does not do signing.  However, feel free to merge the
two scripts for your purposes:

# COPYRIGHT (c) 1995-2002 Stephen M. Butler dba XRG
# This information may be copied, distributed and/or modified under
# certain conditions, but it comes WITHOUT ANY WARRANTY.
# See the Design Science License for more details
# =================================================================
# gpg_script PK_ID source
#   Interface script for edi and ftpexec to encrypt files vi GnuPG


homedir=$($xrgbin/default gpg_home)

if [[ $# -ne 2 ]]; then
  echo "gpg_script: Must supply 2 parameters" >&2
  exit 99

rm -f "$2.pgp" > /dev/null

gpg --homedir $homedir --no-tty --always-trust --recipient $1 \
    --output "$2.pgp" --encrypt "$2"
if [ $x -ne 0 ]; then
  echo "gpg_script: gpg failure code '$x'" >&2
echo "$2.pgp"
exit $x


-----Original Message-----
From: Frank Tobin []
Sent: Friday, June 21, 2002 9:01 AM
To: Steven Handleman
Subject: Re: Suppressing passphrase prompt

Steven Handleman, on 2002-06-21, wrote:

> I am a new user to GPG and I am hoping that someone on this list can
> provide an easy answer to this.  When I try to sign & encrypt a file
> (--sign -- encrypt --armor), gpg prompts me for a passphrase for my
> secret key.  Is there any way to suppress this prompt?  I need to
> suppress it because the encryption is going to become part of an
> automated batch file.

Use --passphrase-fd then for automated entering.

Frank Tobin

Gnupg-users mailing list

CONFIDENTIALITY NOTICE:  This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.