Encrypting a file in a non -interactive mode

David Shaw dshaw at jabberwocky.com
Wed Dec 14 16:00:33 CET 2005


On Mon, Dec 12, 2005 at 02:17:52PM -0800, amit bhalerao wrote:
> HI ,
> 
>     COuld anyone please tell me how to encrypt a file in a non- 
> interactive mode or batch mode ?

Sure, just do something like this:

 gpg --batch -r (recipient) --output (name-for-encrypted-file) --encrypt (file-to-encrypt)

However, this assumes that the recipient is trusted by you.  If not,
then you also need to add "--trust-model always" to override that.

This also assumes that name-for-encrypted-file doesn't exist.  GPG
won't overwrite it if it exists.  To force GPG to overwrite the
existing file, add "--yes".

David



More information about the Gnupg-users mailing list