Automating Decryption using gpg --batch --passphrase-file or gpg --batch --passphrase-fd 0

guk guk gukgukcommunity at
Thu Jun 5 05:13:52 CEST 2008

Hi Hardeep!
Thanks for your reply.
I did try your suggestion and It didn't work.
It still throwing the same error .
Can you tell more about the key setup?
What kind of procedure i need to follow so i can run gpg in SQL Job?

----- Original Message ----
From: Hardeep Singh <hs2412 at>
To: guk guk <gukgukcommunity at>
Sent: Wednesday, June 4, 2008 6:27:09 PM
Subject: Re: Automating Decryption using gpg --batch --passphrase-file or gpg --batch --passphrase-fd 0


The first method is incorrect. Correct usage of --passphrase-fd is as below:

gpg --batch --decrypt --passphrase-fd 0 --output output.csv
output.csv.pgp <passphrase.txt

The second seems ok. Yet, since its not working it could be a problem
with the key setup. Can the file be decrypted in the interactive mode
on the same machine without problems?


On 6/4/08, guk guk <gukgukcommunity at> wrote:
> Hi !
> I tried to automate decryption of pgp files by running this command line in
> windows xp
> gpg --batch --passphrase-fd 0 < passphrase.txt --output "OUTPUT.CSV"
> --decrypt "OUTPUT.CSV.pgp"
> or
> gpg --batch  --passphrase-file passphrase.txt --output "OUTPUT.CSV"
> --decrypt "OUTPUT.CSV.pgp"
> but it's always failed.
> It always throw an error
> gpg: encrypted with 2048-bit RSA key, ID , created 2008-05-08
> gpg: public key decryption failed: bad passphrase
> gpg: decryption failed: secret key not available
> I'm using gnupg 1.4.9.
> Can anybody help me please?
> Thanks
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at

Hardeep Singh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20080604/f64cde1a/attachment.htm>

More information about the Gnupg-users mailing list