automate gpg with perl

K

Kai Schlamp

Hello ...

I want to automate GnuPG via a Perl Script. (I am aware of the security
risk).

The problem is, when I execute the stated below script, i always get the
output "Reading passphrase from file descriptor 3 ..." and gnupg waits
for an input.
If I just press return, I get an encrypted file, but if try to decrypt
it with the password in the pass.txt, it fails.

Here is my little test script:

open(FILE, "./pass.txt") || die($!) ;
$fd = fileno(FILE) ;
system("c:/gnupg/gpg.exe --output test.gpg --passphrase-fd $fd
--symmetric test.txt") ;
close(FILE) || die($!) ;

And another question:
Is there a way to directly pass the password, perhaps in a perl pipe
funktion or something like that? I mean only using perl functions,
without the use of the shell pipe ("|").

greets,
Kai
 
M

Matthew Braid

Kai said:
Hello ...

I want to automate GnuPG via a Perl Script. (I am aware of the security
risk).

The problem is, when I execute the stated below script, i always get the
output "Reading passphrase from file descriptor 3 ..." and gnupg waits
for an input.
If I just press return, I get an encrypted file, but if try to decrypt
it with the password in the pass.txt, it fails.

Here is my little test script:

open(FILE, "./pass.txt") || die($!) ;
$fd = fileno(FILE) ;
system("c:/gnupg/gpg.exe --output test.gpg --passphrase-fd $fd
--symmetric test.txt") ;
close(FILE) || die($!) ;

And another question:
Is there a way to directly pass the password, perhaps in a perl pipe
funktion or something like that? I mean only using perl functions,
without the use of the shell pipe ("|").

greets,
Kai

See my response in comp.security.pgp.discuss
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top