Mailinglist Archive: opensuse (4570 mails)

< Previous Next >
Re: [SLE] sample command lines to encrypt/decrypt via gpg
  • From: Steve Graegert <graegerts@xxxxxxxxx>
  • Date: Sun, 13 Nov 2005 14:23:21 +0000 (UTC)
  • Message-id: <6a00c8d50511130623w5c68acdtc2f7481480bb52c9@xxxxxxxxxxxxxx>
On 11/13/05, Steve Graegert <graegerts@xxxxxxxxx> wrote:
> On 11/13/05, John R. Sowden <jsowden@xxxxxxxxxxxxxxxxxx> wrote:
> > I am trying to create scripts to encrypt and decrypt text files, but the man
> > pages, as most man pages do, take me about 80% of the way there.
> > Is there a place on the net that explains these commands clearly, or is this
> > part of the open source system to sell books?
>
> Here is what I do from time to time:
>
> % gpg --output f.txt.gpg -e -r '<name>' f.txt
> % gpg --output f.txt --decrypt f.txt.gpg
>
> The first command encrypts file f.txt and writes the encrypted text to
> f.txt.gpg. 'name' should be the name you used to create your private
> key. The second command decrypts the same file. --output lets you
> specify a name for the output file.
>
> The same procedure also works with files encrypted by someone else, as
> long as you have imported the keys:

Oops, there has been a mistake. This does __not__ work. Can't
decrypt files encrypted by others, but you can __encrypt__ files with
the public key of someone else (what I actually wanted to say):

% gpg --output f.txt.gpg -e -r 'trusted@xxxxxxxxx' f.txt

Sorry for the confusion.

\Steve

< Previous Next >