GPG encrypting and decrypting files

Neil Williams linux at codehelp.co.uk
Sat Feb 28 14:32:22 CET 2004


-----BEGIN PGP SIGNED MESSAGE-----
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 
filename?

(Assuming you've checked the permissions.)

- -- 

Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/

http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAQKZ4iAEJSii8s+MRAvTyAKDsVwOr3oby07ZIF6Qc9GBDlim+1QCg11DC
hSl+zqT/tpo8svRu0j1GlVg=
=5aXz
-----END PGP SIGNATURE-----




More information about the Gnupg-users mailing list