_almost_ working, now a command line question...

John Clizbe JPClizbe at tx.rr.com
Tue Mar 4 06:29:47 CET 2008

SeidlS at schneider.com wrote:
> Can you try it when streaming data to GnuPG?  The following command did not
> work for me:
> echo TEST |gpg --clearsign -a --passphrase-file passfile
> Output:
> Reading passphrase from file descriptor 3
> You need a passphrase to unlock the secret key for
> user: "XXXXXXX"
> 1024-bit DSA key, ID XXXXXXX, created 2008-01-29
> gpg: no default secret key: bad passphrase
> gpg: [stdin]: clearsign failed: bad passphrase


I had the same type of passfile error when I created the file using Windows ECHO
which sticks <CR><LF> on the end.

Does running DIR or ls -l on the passphrase file show it to be longer than it
actually is? (Add one byte for end-of-file plus one for CR and another for LF)

You can run a hex dump utility such as dump from the cygutils package to verify
this. The last bytes will be 0D 0A for CR-LF. You can get cygutils from :

If so, running dos2unix on passfile /may/ solve things. It's available from a
variety of sources. The GnuWin32 project is a handy source - it's also in the
cygutils package. It worked for me with the other batch decrypt problem
yesterday, but not yours today.

Using the Gnu version of echo with the suppress newline option 'echo -n' to
create passfile is also an option, probably the best. echo is part of the
coreutils package and is also available from the GnuWin32 project:

Using 'echo -n' to create passfile is what worked for me using your command from
above. passfile was created with

   <drive>:\path\to\echo -n passphrase > passfile

DIR showed passfile to be exactly the same length as the passphrase.

C:\WINDOWS\Temp>echo TEST |gpg --clearsign -a --passphrase-file passfile
Reading passphrase from file descriptor 3

You need a passphrase to unlock the secret key for
user: "John P. Clizbe <JPClizbe at Earthlink.net>"
1024-bit DSA key, ID 608D2A10, created 2003-03-06

Hash: SHA1

Version: GnuPG v1.4.8 (WinXP Pent3)
Comment: When cryptography is outlawed, b25seSBvdXRsYXdzIHdpbGwgdXNlIG
Comment: Be part of the ú33t ECHELON -- Use Strong Encryption.
Comment: It's YOUR right - for the time being.


John P. Clizbe                   Inet:   JPClizbe (a) tx DAWT rr DAHT con
Ginger Bear Networks             hkp://keyserver.gingerbear.net or
Send email with subject HELP to  pgp-public-keys at keyserver.gingerbear.net

"Be who you are and say what you feel because those who mind don't matter
and those who matter don't mind." - Dr Seuss, "Oh the Places You'll Go"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 658 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20080303/2c1f3457/attachment-0001.pgp>

More information about the Gnupg-users mailing list