Command to decrypt the file

Sven Radde email at
Tue Mar 4 07:21:47 CET 2008


Elmer Espinosa schrieb:
> I used the command gpg -s file to encrypt the file.
First of all, I am not quite sure whether you just spelled it wrongly 
here or whether you made a potentially serious mistake.

"gpg -s" does *not* encrypt. It signs your file. "gpg -e" encrypts.
While the outputs of both operations result in a "scrambled" file (that 
look pretty "encrypted" for a newbie), the signed one can be opened by 
anyone with access to your public key. An encrypted one can be opened 
only by using the private keys of the intended recipient(s). You may 
have noticed that you were not asked for your passphrase during your 
decryption attempts...
> to decrpyt the file I used gpg -d file, but the output appear only in 
> the command prompt I was to save it in my local disk
Try "gpg -d $file > $filename-to-save-it-under". Or "gpg -d -o 
$filename-to-save-it-under $file".
You don't have to use the "-d" at all, as GnuPG defaults to the right 
operation (decrypting an encrypted file, verifying a signature, ...). 
Just try "gpg file".

HTH, Sven

More information about the Gnupg-users mailing list