In gpg
's man page, there are examples of key IDs :
234567C4
0F34E556E
01347A56A
0xAB123456
234AABBCC34567C4
0F323456784E56EAB
01AB3FED1347A5612
0x234AABBCC34567C4
and fingerprints :
1234343434343434C434343434343434
123434343434343C3434343434343734349A3434
0E12343434343434343434EAB3484343434343434
0xE12343434343434343434EAB3484343434343434
My intuition would have been that a leading 0 is for octal and a leading 0x for hexadecimal, but it does not seem like it is.
What are the different representations?
Best Answer
NOTE: Before I begin, all the representations here are hexidecimal only. There isn't any other representation.
Key IDs
The man page seems pretty clear on where these values are coming from. The key IDs are a portion of the SHA-1 fingerprint.
All these values are hex, the notation allows for either a number to be prefixed with
0x
, a0
, or to simply begin with a non-zero value.NOTE: Using key IDs is inherently a bad idea since they're essentially taking a portion of the fingerprint to identify a given key. The problem arises in that it's somewhat trivial to generate collisions among key IDs. See this article for more on this issue, titled: Short key IDs are bad news (with OpenPGP and GNU Privacy Guard).
excerptFingerprints
Whereas the fingerprints:
I'd suggest taking a look at the wikipedia page titled: Public key fingerprint. It details how fingerprints are generated. Here's summary:
excerptReferences