"--passphrase-fd n" not working

pd pd4953@myrealbox.com
Tue Oct 2 20:44:01 2001


Thank you both!

At 01:26 PM 10/2/2001 -0400, Michael H. Warfield wrote:

>On Tue, Oct 02, 2001 at 12:35:23PM -0400, pd wrote:
>
> > However, with your help and others I have found that both of the following
> > work for me:
>
> > gpg --decrypt -r george --passphrase-fd 0 <pass.txt encrypted.txt
>
> > gpg --decrypt -r george --passphrase-fd 3 3<pass.txt encrypted.txt
>
> > Is there any way to do this with pipes instead of an actual file? I
> have a
>
> echo "Passphrase" | gpg --decrypt --passphrase-fd 0 encrypted.txt
>
> Or... Equivalent to previous file based command...
>
> cat pass.txt | gpg --decrypt --passphrase-fd 0 encrypted.txt
I *almost* had that figured out. I see that the ">" and "<" operators apply to opening *files* whereas the *pipe* can be used with values and commands. I was getting ready to try it with a "1" instead of "0" for the file descriptor. That obviously does not work since the pipe is taking stdout and piping it to stdin of the next command. stdin of the gpg command segment is file descriptor 0 instead of 1. Thanks for setting me straight! Paul
> > number of encrypted texts encrypted with the same key. I'd like to have a
> > perl program prompt for the passphrase once and decrypt the texts without
> > storing it in a file on the hard drive.
>
> This snippet of code is taken from a working perl script...
>
>=========================
> open GPG, "|gpg --passphrase-fd 0 --quiet --no-tty -o msg.txt
> msg.asc > gpg.out 2> gpg.err";
>
> print GPG "$KEY";
> close GPG;
>=========================
>
> > If I replace "pass.txt" with the password or with `echo password_text` it
> > tells me it can't find the file by that name. Another basic Unix script
> > problem I think - making a string look like file contents. There has
> to be
> > a way to do it, I just haven't been able to come up with it yet. Any help
> > would be appreciated.
>
> Nope... You can't just replace the name of the file. You have
>to change to the pipe operator as well.
>
> > Thanks,
> >
> > Paul
> >
> > >Hth,
> > >
> > > Werner
> > >
> > >
> > >--
> > >Werner Koch Omnis enim res, quae dando non deficit, dum habetur
> > >g10 Code GmbH et non datur, nondum habetur, quomodo habenda est.
> > >Privacy Solutions -- Augustinus
>
> Mike
>--
> Michael H. Warfield | (770) 985-6132 | mhw@WittsEnd.com
> (The Mad Wizard) | (678) 463-0932 | http://www.wittsend.com/mhw/
> NIC whois: MHW9 | An optimist believes we live in the best of all
> PGP Key: 0xDF1DD471 | possible worlds. A pessimist is sure of it!
>
>
>_______________________________________________
>Gnupg-users mailing list
>Gnupg-users@gnupg.org
>http://lists.gnupg.org/mailman/listinfo/gnupg-users