Re: Finding all files encrypted with a certain key

2023-10-26 Thread raf via Gnupg-users
On Wed, Oct 25, 2023 at 09:38:55PM -0500, Jacob Bachmeyer via Gnupg-users wrote: > raf via Gnupg-users wrote: > > [...] > > While testing these, I just noticed that /usr/bin/file > > on my macOS-10.14 laptop shows a different keyid to > > what libmagic shows. That's bizarre. > > > > For some

Re: Finding all files encrypted with a certain key

2023-10-26 Thread raf via Gnupg-users
On Thu, Oct 26, 2023 at 11:29:38AM +0800, "Felix E. Klee" wrote: > On Wed, Oct 25, 2023 at 9:23 PM Werner Koch wrote: > > > gpg: decryption failed: No secret key > > > > > > I wonder how to get rid of that. > > > > grep -v on stderr ;-). > > Thanks, I was thinking about that. But I think

Re: Finding all files encrypted with a certain key

2023-10-25 Thread Felix E. Klee
On Wed, Oct 25, 2023 at 9:23 PM Werner Koch wrote: > > gpg: decryption failed: No secret key > > > > I wonder how to get rid of that. > > grep -v on stderr ;-). Thanks, I was thinking about that. But I think simply using find, as suggested by Andrew and raf, is sufficient and simple. > I

Re: Finding all files encrypted with a certain key

2023-10-25 Thread Jacob Bachmeyer via Gnupg-users
raf via Gnupg-users wrote: [...] While testing these, I just noticed that /usr/bin/file on my macOS-10.14 laptop shows a different keyid to what libmagic shows. That's bizarre. For some encrypted files of mine, /usr/bin/file (v5.33) shows 3A0FC449 817C22BA but libmagic/rh shows 49C40F3A

Re: Finding all files encrypted with a certain key

2023-10-25 Thread Werner Koch via Gnupg-users
Hi, hit the sent key combination by accident. The last para should have read: I think it is time to make things like this easier. Actually re-encrypt support has been on our feature list for many years. Every time I want to tackle this I stop at the decision on whether to also handle the

Re: Finding all files encrypted with a certain key

2023-10-25 Thread Werner Koch via Gnupg-users
On Wed, 25 Oct 2023 10:54, Felix E. Klee said: > Thank you! I modified that a bit, to make it more readable to me and fix > a little bug: The second `$1` doesn’t expand to the file name. Also, I Upoi caught me, I didn't test the posted version. > gpg: decryption failed: No secret key > > I

Re: Finding all files encrypted with a certain key

2023-10-25 Thread raf via Gnupg-users
On Wed, Oct 25, 2023 at 11:01:30AM +0800, "Felix E. Klee" wrote: > On Tue, Oct 24, 2023 at 5:12?PM Andrew Gallagher > wrote: > > GNU `file` will print the encryption key ID: > > Interesting. I wonder if there is any disadvantage of using `file` over > Werner's proposal. I don't think so. The

Re: Finding all files encrypted with a certain key

2023-10-24 Thread Felix E. Klee
On Tue, Oct 24, 2023 at 5:12 PM Andrew Gallagher wrote: > GNU `file` will print the encryption key ID: Interesting. I wonder if there is any disadvantage of using `file` over Werner’s proposal. ___ Gnupg-users mailing list Gnupg-users@gnupg.org

Re: Finding all files encrypted with a certain key

2023-10-24 Thread Felix E. Klee
On Wed, Oct 25, 2023 at 10:08 AM raf via Gnupg-users wrote: > > How do I do that for a massive directory tree? > > With my rawhide (rh) program (github.com/raforg/rawhide) you can do it > with something like this: > > rh /path '"*.gpg" && "*PGP*encrypted*BEF6EFD3 8FE8DCA0*".what' Very

Re: Finding all files encrypted with a certain key

2023-10-24 Thread Felix E. Klee
On Tue, Oct 24, 2023 at 5:21 PM Werner Koch wrote: > encrypted-to-me-p.sh > --8<---cut here---start->8--- > #/bin/sh > gpg -d --status-fd 1 -o /dev/null 2>/dev/null "$1" | awk ' > $1=="[GNUPG:]" && $2=="ENC_TO" && $3=="BEF6EFD38FE8DCA0" {print $1; exit 0}' >

Re: Finding all files encrypted with a certain key

2023-10-24 Thread raf via Gnupg-users
On Tue, Oct 24, 2023 at 11:38:52AM +0800, "Felix E. Klee" wrote: > For the purpose of re-encryption with a new key, I’d like to find all > files that are encrypted with my key BEF6EFD38FE8DCA0. All encrypted > files, independent of key, have the extension `.gpg`. > > How do I do that for a

Re: Finding all files encrypted with a certain key

2023-10-24 Thread Werner Koch via Gnupg-users
On Tue, 24 Oct 2023 11:38, Felix E. Klee said: > For the purpose of re-encryption with a new key, I’d like to find all > files that are encrypted with my key BEF6EFD38FE8DCA0. All encrypted > files, independent of key, have the extension `.gpg`. > > How do I do that for a massive directory tree?

Re: Finding all files encrypted with a certain key

2023-10-24 Thread Andrew Gallagher via Gnupg-users
Apologies to the `file` authors, it’s a BSD utility, not GNU. A On 24 Oct 2023, at 10:11, Andrew Gallagher via Gnupg-users wrote: > > Signed PGP part > On 24 Oct 2023, at 04:38, Felix E. Klee wrote: >> >> For the purpose of re-encryption with a new key, I’d like to find all >> files that

Re: Finding all files encrypted with a certain key

2023-10-24 Thread Andrew Gallagher via Gnupg-users
On 24 Oct 2023, at 04:38, Felix E. Klee wrote: > > For the purpose of re-encryption with a new key, I’d like to find all > files that are encrypted with my key BEF6EFD38FE8DCA0. All encrypted > files, independent of key, have the extension `.gpg`. > > How do I do that for a massive directory