Passphrase in Perl script and Windows

Marcus lists@wordit.com
Fri, 15 Dec 2000 23:02:04 +0100


Replying to my own question.
I was given a simple way to send the passphrase for use in Perl
scripts. Here it is for the archives if nobody else needs it at the
moment:

open(PIPE, "| gpg.exe -o $file.gpg --passphrase-fd 0 -c $file") or die
$!;
print PIPE $passphrase;

Alternatively, Windows will pipe, it just wants an "echo" first. The
following is a system command via Perl.

echo $passphrase | gpg.exe -o $file.gpg --passphrase-fd 0 -c $file

You can adjust the variable syntax for other uses.

Btw, how about adding these kinds of examples to a FAQ document?

Marcus Friedlaender


-- 
Archive is at http://lists.gnupg.org - Unsubscribe by sending mail
with a subject of  "unsubscribe"  to gnupg-users-request@gnupg.org