Signing Multiple Files

John Clizbe JPClizbe at
Mon Feb 11 01:15:42 CET 2008

Hash: SHA1

Lance W. Haverkamp wrote:
> Having looked through much documentation & some trial and error; it 
> seems there is no way to sign (detached) multiple files.  I need to sign 
> dozens (or hundreds) of photos at a time.  I am *not* a programmer.
> I did coble together a (Linux) script:
> #!/bin/bash
> for i in $( ls ); do
> gpg -b $i
> done
> There must be a better way, but this will sign everything in a folder. 
> I don't code enough to be able to tell the file browser to sign multiple 
> selected files recursively.
> Am I missing something obvious here?

That will sign everything in a given directory, but won't recurse.
'ls -R' will recurse, but won't give you filenames in a usable format to pass
It will also attempt to sign everything in addition to the images

find . -name "*.jpeg" -print

is probably more along the lines of what you're looking for instead of ls above

for i in $(find . -name "*.jpeg" -print \;)
  gpg -b $i -o ${i}.sig

You may wish to use one of the --passphrase options,eg
'--passphrase-file <file>' or '--passphrase <string>', or temporarily remove the
passphrase from the signing key to spare yourself the 'joy' of typing the
passphrase potentially 100s of times.

Some reason you moved the thread to GnuPG-Users from PGP-Basics?

- --
John P. Clizbe                      Inet:   John (a)
You can't spell fiasco without SCO. PGP/GPG KeyID: 0x608D2A10/0x18BB373A
"what's the key to success?"        / "two words: good decisions."
"what's the key to good decisions?" /  "one word: experience."
"how do i get experience?"          / "two words: bad decisions."

"Just how do the residents of Haiku, Hawai'i hold conversations?"
Version: GnuPG v1.4.8 (WinXP Pent3)
Comment: When cryptography is outlawed, b25seSBvdXRsYXdzIHdpbGwgdXNlIG
Comment: Be part of the £33t ECHELON -- Use Strong Encryption.
Comment: It's YOUR right - for the time being.
Comment: Using GnuPG with Mozilla -


More information about the Gnupg-users mailing list