automating gnupg decryption

John Maher john.e.maher at gmail.com
Fri Nov 11 23:20:04 CET 2005


Sean, in Linux you could create a script file (e.g., decrypt_file) that
would do the following:

    gpg --output "$1_`date +%Y%m%d%H%M%S`" --decrypt $1

If you ran the script by specifying at the end the name of file to
decrypt (i.e., "decrypt_file encrypted.gpg"), then it would create a
decrypted file with the date and time appended to it (i.e.,
"encrypted_20051111173001").  I'm sorry I don't know the equivalent
commands in Windows, but if you can find the equivalent then it should
work.  The key, I think, is finding a way to execute the "date" command,
which, in this case, is executed because it is surrounded by backquotes (`).

John

Sean Cerney wrote:

> Hello All,
>
> I am using gnupg to decrypt files that are imported to us daily. 
> These are xml files.  I use GnuPG in a Windows environment.
>
> i'm trying to find the right command line code to use to automate the
> decryption of these files.
>
> I can enter the following code:
>
> gpg --output (pathname)\(desired output name) --decrypt
> (pathname)\*.xml.pgp
>
> where *.xml.pgp is any decrypted xml file in my folder.
>
> my question is:  can I automate gpg to assign a unique name to the
> OUTPUT file (such as 11_05.xml, etc.) instead of manually entering a
> name each time?
>
> thanks for any help.
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's
> FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
>



More information about the Gnupg-users mailing list