Simply Display all Encryption Keys on a File?

Naftuli Tzvi Kay rfkrocktk at gmail.com
Tue Jul 5 20:05:44 CEST 2016


Werner,
Thanks for your response, that answers my question. It might be nice to
have a utility, maybe called "gpg-file" which will display file information
about a GnuPG file. Being able to see things like symmetric encryption
algorithm, public keys encrypted to, compression(?), whether it's signed,
and the digest algorithm would be really nice. I know everyone is busy, but
just would like to put this out there.

Thanks,
 - Naftuli Tzvi

On Tue, Jul 5, 2016 at 1:40 AM, Werner Koch <wk at gnupg.org> wrote:

> On Mon,  4 Jul 2016 23:52, rfkrocktk at gmail.com said:
>
> > Is there a way to take a GnuPG 2 encrypted file and simply display the
> key
> > ids that it was encrypted to? Obviously this probably won't work for
> > --hidden-encrypt-to, but is there a shorthand way of doing this? I've
> tried
> > using gpg2 --list-packets, but this attempts to decrypt the file first.
>
> This should work:
>
>   $ cat enc-2-keys-2.gpg \
>      | gpg --no-options --no-default-keyring --keyring /dev/null \
>            --batch --status-fd 1 2>/dev/null \
>      | awk  '$1=="[GNUPG:]" && $2=="ENC_TO" {print $3}'
>   9185878E4FCD74C0
>   1D777619BE310D79
>
> Unfortunately there is no --skip-decrypt option and thus you need to
> use the above trick.  Works with all gpg versions.
>
>
> Shalom-Salam,
>
>    Werner
>
> --
> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>  /* Join us at OpenPGP.conf  <https://openpgp-conf.org> */
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20160705/36745bc7/attachment.html>


More information about the Gnupg-devel mailing list