Decrypt multiple Encrypted files within a folder

vedaal at vedaal at
Fri Oct 31 15:28:03 CET 2008

Duwaine Robinson duwainer at
wrote on Thu Oct 30 15:47:44 CET 2008:

>>> I would like to be able to create a batch file 
>>> or a script that allows
>>> me to decrypt multiple encrypted files within a given folder.

Vlad "SATtva" Miller [mailto:sattva at] wrote:

>>On Linux that's easy.

>>To encrypt:
>>$ find <your_path> -type f -execdir gpg -r <keyID> -e {} \;

>>To decrypt:
>>$ find <your_path> -type f -iname '*.gpg' -execdir gpg {} \; 
>>note, that you'll be prompted for the passphrase for every file, 
>>you use gpg-agent with passphrase caching or provide passphrase 
on the
>>command line.)

Duwaine Robinson wrote:

>Seems easy enough. Happens that I am trying to get this done on 

have tested Vlad's suggestions, 
and it can be done the same way on windows by installing cygwin
and entering Vlad's commands at the cygwin $ prompt


[1] after installing cygwin,
add a copy of gpg.exe into the folder C:\cygwin\bin

[2] cygwin needs the 'slashes' for the path *reversed*
for purposes of illustration,
let's say that the directory whose files you want to encrypt, is 
and the directory whose files you want to decrypt, is c:\dt
and your encryption keyname is Boo
and the passphrase is Foo,

then Vlad's commands on cygwin in windows, would be:

To encrypt:
$ find c:/et -type f -execdir gpg -r Boo -e {} \;

To decrypt:
$ find c:/dt -type f -iname '*.gpg' -execdir gpg --passphrase Foo 
{} \;


it *must* be c:/et and c:/dt 
c:\et and c:\dt

otherwise, cygwin will give the following error message:
find: c:et: No such file or directory


any ads or links below this message are added by hushmail without 
my endorsement or awareness of the nature of the link

Planning for retirement? Click for free information on 401(k) plans.

More information about the Gnupg-users mailing list