NOTA: Antes de começar, todas as representações aqui são apenas hexadecimais. Não há outra representação.
IDs de chave
A página man parece bem clara sobre a origem desses valores. Os IDs principais são uma parte da impressão digital SHA-1.
The key Id of an X.509 certificate are the low 64 bits of its SHA-1 fingerprint. The use of key Ids is just a shortcut, for all automated processing the fingerprint should be used.
Todos esses valores são hexadecimais, a notação permite que um número seja prefixado com 0x
, a 0
ou simplesmente comece com um valor diferente de zero.
OBSERVAÇÃO: O uso de IDs de chave é inerentemente uma má ideia, pois eles basicamente tiram uma parte da impressão digital para identificar uma determinada chave. O problema surge em que é um pouco trivial gerar colisões entre IDs de chave. Veja este artigo para saber mais sobre esse assunto, intitulado: IDs de chave curta são ruins notícias (com OpenPGP e GNU Privacy Guard) .
trechoSummary: It is important that we (the Debian community that relies on OpenPGP through GNU Privacy Guard) stop using short key IDs. There is no vulnerability in OpenPGP and GPG. However, using short key IDs (like 0x70096AD1) is fundementally insecure; it is easy to generate collisions for short key IDs. We should always use 64-bit (or longer) key IDs, like: 0x37E1C17570096AD1 or 0xEC4B033C70096AD1.
TL;DR: This now gives two results:
gpg --recv-key 70096AD1
Impressões digitais
Considerando as impressões digitais:
This format is deduced from the length of the string and its content or the 0x prefix. Note, that only the 20 byte version fingerprint is available with gpgsm (i.e. the SHA-1 hash of the certificate).
When using gpg an exclamation mark (!) may be appended to force using the specified primary or secondary key and not to try and calculate which primary or secondary key to use.
The best way to specify a key Id is by using the fingerprint. This avoids any ambiguities in case that there are duplicated key IDs.
Sugiro dar uma olhada na página da Wikipédia intitulada: Impressão digital da chave pública . Ele detalha como as impressões digitais são geradas. Aqui está o resumo:
trecho
A public key (and optionally some additional data) is encoded into a sequence of bytes. To ensure that the same fingerprint can be recreated later, the encoding must be deterministic, and any additional data must be exchanged and stored alongside the public key. The additional data is typically information which anyone using the public key should be aware of. Examples of additional data include: which protocol versions the key should be used with (in the case of PGP fingerprints); and the name of the key holder (in the case of X.509 trust anchor fingerprints, where the additional data consists of an X.509 self-signed certificate).
The data produced in the previous step is hashed with a cryptographic hash function such as MD5 or SHA-1.
If desired, the hash function output can be truncated to provide a shorter, more convenient fingerprint.
This process produces a short fingerprint which can be used to authenticate a much larger public key. For example, whereas a typical RSA public key will be 1024 bits in length or longer, typical MD5 or SHA-1 fingerprints are only 128 or 160 bits in length.
When displayed for human inspection, fingerprints are usually encoded into hexadecimal strings. These strings are then formatted into groups of characters for readability. For example, a 128-bit MD5 fingerprint for SSH would be displayed as follows:
43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8