Encrypting a file for anyone to read if having my public key.

David Shaw dshaw@jabberwocky.com
Mon Dec 2 19:13:02 2002


On Mon, Dec 02, 2002 at 11:45:54AM -0600, Alex Watson wrote:
> 1. I'd like to encrypt a file preferably in batch mode (no questions asked)
> such that I can send it to anyone having my public key and they can decrypt
> it.
> 
> I thought I read somewhere that this could be done by encrypting to my
> secret key, rather than directly to my public key (which only I could
> decrypt).   However, I can't determine the command syntax/options to do
> this.
> 
> 2.  Likewise, once the file is encrypted as such would the syntax for anyone
> having my public key to decrypt this file simply be:
> gpg --output output.txt --decrypt input.cry
> where decrypted output filename is output.txt
> and file being decrypted is input.cry and gpg simply scans/tries any key
> till it is able to decrypt.
> or do I need something similar to --recipient or like --sender and my name
> as associated with my public key to indicate which key should decrypt it.

I'm not quite sure what you're trying to do here, or why.  If you want
a message decryptable by your public key (which is presumably public,
then why bother to encrypt it at all?

David

-- 
   David Shaw  |  dshaw@jabberwocky.com  |  WWW http://www.jabberwocky.com/
+---------------------------------------------------------------------------+
   "There are two major products that come out of Berkeley: LSD and UNIX.
      We don't believe this to be a coincidence." - Jeremy S. Anderson