decrypting many files to stdout

Ingo Klöcker kloecker at kde.org
Thu Jun 28 22:24:46 CEST 2007


On Thursday 28 June 2007 10:24, Ken Takusagawa wrote:
> I have many files that are all encrypted with the same public key,
> and the private key is protected with a passphrase.  Is there a way
> that I can decrypt all of them at once, concatenate the results and
> print it all to standard output but only have to type my passphrase
> once?  I'd like to avoid having the decrypted files be written to
> disk, i.e., I'd like "-d" behavior but with multiple files.

I suggest using gpg-agent for caching the passphrase. Then you only have 
to enter it once as long as gpg-agent is running and the cache-ttl is 
not expired. Use the following command line for starting gpg-agent (you 
probably want to use a shorter ttl than 3600 seconds aka 1 hour).

eval "$(gpg-agent --daemon --default-cache-ttl 3600)"

Then decrypt all files with a simple for-loop. Afterwards you might want 
to kill gpg-agent.


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /pipermail/attachments/20070628/0ff088f7/attachment.pgp 


More information about the Gnupg-users mailing list