GPG encrypting and decrypting files

Neil Williams linux at
Sat Feb 28 14:32:22 CET 2004

Hash: SHA1

On Friday 27 February 2004 11:56 pm, Craig Gardner wrote:
> Hello,
> I'm trying to encrypt a file and ftp it to another machine only to have

Linux / windows machines?

> it decrypted on that machine, but I can't seem to get the files
> decrypted.
> When I go to encrypt the file, I use :
> gpg --output [encrypted file] --encrypt --recipient [recipient] [file]

What kind of file and how are you transferring it - ASCII or Binary FTP?

You are encrypting to a binary format (by not using -a ASCII armour) so 
transferring the file by ASCII FTP could be the source of the problem. 

If it's a text based file, try encrypting using:

$ gpg -ar [recipient] -e [unencryptedfile]

Then send by ASCII FTP. (type A).

To make sure it has transferred correctly, use a detached signature ( -b ) and 
send that by FTP. Verify the signature on the other machine before attempting 
to decrypt. The detached signature can also be in ASCII by adding -a.

> and it works just fine until I transfer the file to the other machine
> for decrypting.  I have exported and imported the what I thought were
> the proper keys, but it doesn't seem to want to decrypt on the other
> machine, while testing (encrypting and decrypting) it on one machine
> works just fine.
> When I decrypt, I use :
> gpg --output [decrypted file] --decrypt [encrypted file]

I don't usually specify an output file, gnupg will use the same filename 
without the .gpg or .asc.

> It seems like it should be correct, but for some reason, it just isn't
> working.  The error message I receive is :
> gpg: can't open `[filename]'
> gpg: decrypt_message failed: file open error

Which filename is being refused - the encrypted file or the specified output 

(Assuming you've checked the permissions.)

- -- 

Neil Williams
Version: GnuPG v1.2.4 (GNU/Linux)


More information about the Gnupg-users mailing list