TL;DR
gpg -vvv --list-packets
can probably answer most questions.
This post builds on Jens Erat's answer
gpg --list-packets
can use the verbosity and debug switches. Note, that while the man page only talks about passing up to 2 verbose switches gpg does respond up to 3 verbose swiches.
The --debug-level 1
, switch isn't that interesting, --debug-all
is interesting, but for the love of god do it on an empty file. My encrypted empty file resulted in 414 lines of output, my 1GB file resulted in 2.7 million lines.
I've included examples of the output of pgpdump, and gpg with differing levels of verbosity. I had to cut the --debug-all
out because it took too much space.
FYI I'm running gpg (GnuPG) 2.2.27
pgpdump ./big_buck_bunny_1080p_surround.avi.gpg 2>&1 | head -n 15
Old: Public-Key Encrypted Session Key Packet(tag 1)(94 bytes)
New version(3)
Key ID - 0xD2E1F0CBF16B1266
Pub alg - Reserved for Elliptic Curve(pub 18)
unknown(pub 18)
-> m = sym alg(1 byte) + checksum(2 bytes) + PKCS-1 block type 02
New: Symmetrically Encrypted and MDC Packet(tag 18)(8192 bytes) partial start
Ver 1
Encrypted data [sym alg is specified in pub-key encrypted session key]
(plain text + MDC SHA1(20 bytes))
New: (8192 bytes) partial continue
New: (8192 bytes) partial continue
New: (8192 bytes) partial continue
New: (8192 bytes) partial continue
New: (8192 bytes) partial continue
$ gpg --list-packets ./big_buck_bunny_1080p_surround.avi.gpg
gpg: encrypted with 255-bit ECDH key, ID D2E1F0CBF16B1266, created 2021-03-23
"your dog (doggy) <[email protected]>"
# off=0 ctb=84 tag=1 hlen=2 plen=94
:pubkey enc packet: version 3, algo 18, keyid D2E1F0CBF16B1266
data: [263 bits]
data: [392 bits]
# off=96 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
:encrypted data packet:
length: unknown
mdc_method: 2
# off=117 ctb=a3 tag=8 hlen=1 plen=0 indeterminate
:compressed packet: algo=2
# off=119 ctb=ae tag=11 hlen=5 plen=928670793
:literal data packet:
mode b (62), created 1616485594, name="big_buck_bunny_1080p_surround.avi",
raw data: 928670754 bytes
$ gpg -vvv --list-packets ./big_buck_bunny_1080p_surround.avi.gpg
gpg: using character set 'utf-8'
# off=0 ctb=84 tag=1 hlen=2 plen=94
:pubkey enc packet: version 3, algo 18, keyid D2E1F0CBF16B1266
data: [263 bits]
data: [392 bits]
gpg: public key is D2E1F0CBF16B1266
gpg: using subkey D2E1F0CBF16B1266 instead of primary key CCD3793A53651BF6
gpg: public key encrypted data: good DEK
# off=96 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
:encrypted data packet:
length: unknown
mdc_method: 2
gpg: using subkey D2E1F0CBF16B1266 instead of primary key CCD3793A53651BF6
gpg: encrypted with 255-bit ECDH key, ID D2E1F0CBF16B1266, created 2021-03-23
"your dog (doggy) <[email protected]>"
gpg: AES256 encrypted data
# off=117 ctb=a3 tag=8 hlen=1 plen=0 indeterminate
:compressed packet: algo=2
# off=119 ctb=ae tag=11 hlen=5 plen=928670793
:literal data packet:
mode b (62), created 1616485594, name="big_buck_bunny_1080p_surround.avi",
raw data: 928670754 bytes
gpg: decryption okay