use of --passphrase-fd in batch symmetric encryption

William Binkley cbinkle1@tampabay.rr.com
Wed Jul 11 02:48:02 2001


	I am apparently too dumb to figure this out -> I've tried reading the man 
page, faq, and other docs at the gnupg site, to no useful avail. I can't seem 
to figure out how to symmetrically encrypt a batch of files at once, using 
the same passphrase, and entering the passphrase only once for the whole 
batch. I tried the following (and I am no pearl programmer, beware):
==============================

#!/usr/bin/perl -w

open ( FILE  , '</home/cbinkle1/.gnupg/pass' ) or die "Can't find passfile\n";
$j = fileno FILE;
@files = glob "$ARGV[0]";
$numberofelements = @files;
for  ( $i = 0; $i <= $numberofelements - 1; $i++) {
	system ( "gpg --passphrase-fd $j -c $files[$i]" );
}
close  FILE;
exit
===============================
	when I run this script, bash states:
Reading passphrase from file descriptor 3 ...
  (and then stops for me to enter the passphrase from the xterm, for each 
file passed thru to the perl script - it is not being read from the file 
opened and specified in the --passphrase-fd file descriptor argument).  
Apparently I do not grasp the subtleties of using this argument.
	Any suggestions as to how to do this, or a simpler way to proceed? 
PS- I don't really want to use public key encryption for this task, and I 
know I will need to encrypt the password file ("pass") except when being 
actively used for encryption / decryption.  I have gnupg V 1.04, which came 
with my mandrake 8.

--Bill   -thanks!