公開鍵暗号方式において、公開鍵フィンガープリントとは、より長い公開鍵を識別するために使用される短いバイト列のことです。フィンガープリントは、公開鍵に暗号学的ハッシュ関数を適用することによって生成されます。フィンガープリントは参照する鍵よりも短いため、特定の鍵管理タスクを簡素化するために使用できます。Microsoftのソフトウェアでは、「フィンガープリント」の代わりに「サムプリント」が使用されます。
公開鍵のフィンガープリントは通常、以下の手順で作成されます。
このプロセスによって生成される短いフィンガープリントは、より大きな公開鍵の認証に使用できます。例えば、一般的なRSA公開鍵は2048ビット以上の長さですが、一般的なMD5やSHA-1のフィンガープリントはわずか128ビットまたは160ビットです。
指紋は、人間の目視確認のために表示される場合、通常は16進数文字列にエンコードされます。これらの文字列は、読みやすくするために文字のグループにフォーマットされます。たとえば、 SSH用の128ビットMD5指紋は、次のように表示されます。
43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8
When a public key is received over an untrusted channel, such as the Internet, the recipient often wishes to authenticate the public key. Fingerprints can help accomplish this, since their small size allows them to be passed over trusted channels where public keys won't easily fit.
For example, if Alice wishes to authenticate a public key as belonging to Bob, she can contact Bob over the phone or in person and ask him to read his fingerprint to her, or give her a scrap of paper with the fingerprint written down. Alice can then check that this trusted fingerprint matches the fingerprint of the public key. Exchanging and comparing values like this is much easier if the values are short fingerprints instead of long public keys.
Fingerprints can also be useful when automating the exchange or storage of key authentication data. For example, if key authentication data needs to be transmitted through a protocol or stored in a database where the size of a full public key is a problem, then exchanging or storing fingerprints may be a more viable solution.
In addition, fingerprints can be queried with search engines in order to ensure that the public key that a user just downloaded can be seen by third party search engines. If the search engine returns hits referencing the fingerprint linked to the proper site(s), one can feel more confident that the key is not being injected by an attacker, such as a Man-in-the-middle attack.
PGP developed the PGP word list to facilitate the exchange of public key fingerprints over voice channels.
In systems such as SSH, users can exchange and check fingerprints manually to perform key authentication. Once a user has accepted another user's fingerprint, that fingerprint (or the key it refers to) will be stored locally along with a record of the other user's name or address, so that future communications with that user can be automatically authenticated.
In systems such as X.509-based PKI, fingerprints are primarily used to authenticate root keys. These root keys issue certificates which can be used to authenticate user keys. This use of certificates eliminates the need for manual fingerprint verification between users.
In systems such as PGP or Groove, fingerprints can be used for either of the above approaches: they can be used to authenticate keys belonging to other users, or keys belonging to certificate-issuing authorities. In PGP, normal users can issue certificates to each other, forming a web of trust, and fingerprints are often used to assist in this process (e.g., at key-signing parties).
CGAやSFSなどのシステム、およびほとんどの暗号化ピアツーピアネットワークでは、フィンガープリントは既存のアドレスと名前のフォーマット(IPv6アドレス、ファイル名、その他の識別文字列など)に埋め込まれます。アドレスと名前がすでに信頼できるチャネルを介して交換されている場合、このアプローチにより、フィンガープリントをそれらに便乗させることができます。[ 1 ]
PGPでは、ほとんどの鍵は「鍵ID」と呼ばれるものが鍵フィンガープリントの下位32ビットまたは64ビットと等しくなるように作成されます。PGPはさまざまな目的で公開鍵を参照するために鍵IDを使用します。これらは厳密にはフィンガープリントではありません。なぜなら、長さが短いため、公開鍵を安全に認証することができないからです。現在のハードウェアではわずか4秒で衝突する32ビット鍵IDを生成できるため、32ビット鍵IDは使用すべきではありません。[ 2 ]
指紋認証のセキュリティに対する主な脅威は、第二原像攻撃です。これは、攻撃者が、被害者の指紋と一致する指紋にハッシュされる公開鍵を持つ鍵ペアを作成する攻撃です。攻撃者は、被害者の公開鍵の代わりに自身の公開鍵を提示することで、被害者になりすますことができます。
システムによっては、衝突攻撃という二次的な脅威も存在します。これは、攻撃者が自身の指紋にハッシュされる複数の鍵ペアを生成する攻撃です。これにより、攻撃者は自身が作成した署名を否認したり、その他の混乱を引き起こしたりする可能性があります。
原像攻撃を防ぐため、指紋に使用される暗号学的ハッシュ関数は、第二原像耐性という特性を備えている必要があります。衝突攻撃が脅威となる場合は、ハッシュ関数は衝突耐性も備えている必要があります。より短く使いやすい指紋を作成するためにハッシュ関数の出力を切り詰めることは許容されますが、切り詰められた指紋は、総当たり攻撃に対するハッシュ関数の関連特性を維持できる十分な長さでなければなりません。
実際には、現在一般的に使用されている指紋のほとんどは、切り捨てられていないMD5またはSHA-1ハッシュに基づいています。2017年現在、MD5とSHA-1では衝突は発生しますが、原像は発生しません。そのため、将来的にはSHA-256などの新しいハッシュ関数の使用が増加すると考えられます。ただし、SHA-256や出力長の長い他のハッシュ関数に基づく指紋は、(比較的短い)MD5やSHA-1の指紋よりも切り捨てられる可能性が高くなります。
指紋の長さを何としても最小限に抑えなければならない状況では、指紋の計算コストを上げることで指紋のセキュリティを強化できます。たとえば、暗号的に生成されたアドレスのコンテキストでは、これは「ハッシュ拡張」と呼ばれ、指紋を計算する人は誰でも、固定数のゼロから始まるハッシュサムを検索する必要があります[ 3 ]。これはコストのかかる操作であると想定されています。