1

I recently have signed the public OpenPGP key of a friend of mine. Curious to see, which effect this would have on the actual key, I compared the key before and after signing it. What I found was that all but the last line of the key did not change. The last line did consist of five to six characters before as well as after signing it, however the characters have been altered. So my signature of my friends key is obviously contained in this last line.

How and using which information is this last line actually generated? Since it obviously contains not only my signature but also those of all the people that have signed that key before me.

1 Answer 1

1

Signing an OpenPGP key adds a signature packet, calculated on the fingerprint of the signee's key and one of his user IDs. You can easily observe this running gpg --export [signee's key id] | gpg --list-packets (the output can be rather massive for keys with a larger number of signatures, consider using less or a similar tool to be able to search and scroll the output), which displays rather technical details on the key. An example (a signature issued by CAcert on my own OpenPGP key):

:public key packet:
        version 4, algo 1, created 1356475387, expires 0
        pkey[0]: [8192 bits]
        pkey[1]: [17 bits]
        keyid: 4E1F799AA4FF2279
:user ID packet: "Jens Erat (born 1988-01-19 in Stuttgart, Germany)"
[snip, self-signatures omitted as irrelevant in this example]
:signature packet: algo 17, keyid D2BB0D0165D0FD58
        version 4, created 1356531044, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 0b cc
        hashed subpkt 2 len 4 (sig created 2012-12-26)
        critical hashed subpkt 3 len 4 (sig expires after 1y1d0h0m)
        hashed subpkt 26 len 29 (policy: http://www.cacert.org/cps.php)
        subpkt 16 len 8 (issuer key ID D2BB0D0165D0FD58)
        data: [160 bits]
        data: [157 bits]

With other words: the actual public key is not modified, but a new packet is added containing the signature (or possibly multiple packets, if you signed multiple user IDs).

The last line did consist of five to six characters before as well as after signing it, however the characters have been altered. So my signature of my friends key is obviously contained in this last line.

The last few characters contain a CRC-24 checksum. If this is changed, something more must have changed. Try to inspect both exports before and after adding the signature using diff.

2
  • I get it so far, but how is all this information compressed into some five or six characters of the last line of the ASCII exported key? Or in other words: will the ASCII representation of this signature appendix grow in length as more signatures are added or is it somehow always compressed to the same length? Oct 28, 2015 at 12:37
  • The signature size depends on your own key size; but should definitely be larger than "a few bytes". The last few characters are a checksum, something in-between must have also changed. Inspect both exports with diff.
    – Jens Erat
    Oct 28, 2015 at 13:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .