pgpdump

Japanese

Kazu Yamamoto

pgpdump is a PGP packet visualizer which displays the packet format of OpenPGP (RFC 4880) and PGP version 2 (RFC 1991).

How does pgpdump work?

PGP produces binary files or files encoded with ASCII armor (which is identical to the MIME Base64 encoding). An example of ASCII armor file is as follows (say "sig.pgp"):

% cat sig.pgp
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.2.6 (NetBSD)
Comment: For info see http://www.gnupg.org
 
owGbwMvMwCSYq3dE6sEMJU7GNYZJLGmZOanWn4xaQzIyixWAKFEhN7W4ODE9VaEk
XyEpVaE4Mz0vNUUhqVIhwD1Aj6vDnpmVAaQeZogg060chvkFjPMr2CZNmPnwyebF
fJP+td+b6biAYb779N1eL3gcHUyNsjliW1ekbZk6wRwA
=+jUx
-----END PGP MESSAGE-----

It's very hard to understand the data structure inside this. Pgpdump visualizes this example as follows:

% pgpdump sig.pgp
Old: Signature Packet(tag 2)(63 bytes)
        Ver 3 - old
        Hash material(5 bytes):
                Sig type - Signature of a binary document(0x00).
                Creation time - Fri Nov 27 18:35:42 JST 1998
        Key ID - 0xA79778E247B63037
        Pub alg - DSA Digital Signature Algorithm(pub 17)
        Hash alg - SHA1(hash 2)
        Hash left 2 bytes - 27 ae 
        DSA r(159 bits) - ...
        DSA s(159 bits) - ...
                -> hash(DSA q bits)
Old: Literal Data Packet(tag 11)(45 bytes)
        Format - binary
        Filename - hoge
        File modified time - Sun Apr 27 04:41:04 JST 1975
         Literal - ...

Availability

History of PGP format