NIST FIPS 198-1 日本語訳
英語タイトル : The Keyed-Hash Message Authentication Code (HMAC)日本語タイトル : 鍵付きハッシュメッセージ認証コード(HMAC)
公開日 : 2008-07-16
原文URL : https://csrc.nist.gov/pubs/fips/198-1/final
翻訳編集 : 自動生成(有志による非公式の日本語訳), 原文取得日 : 2026-10-25, 訳文 : 114 / 114 ブロック
[要約] FIPS 198-1 は、暗号学的ハッシュ関数を用いたメッセージ認証のメカニズムである、鍵付きハッシュメッセージ認証コード(HMAC)を規定する標準です。HMAC は共有シークレット鍵と組み合わせることで、反復型の承認済み暗号学的ハッシュ関数のどれとでも使用でき、暗号鍵、HMAC の仕様、切り詰め、実装上の注意を扱います。2008年7月の改訂版で、付録に FIPS 198 との相違点が示されています。
FIPS PUB 198-1
FIPS PUB 198-1
FEDERAL INFORMATION PROCESSING STANDARDS PUBLICATION
連邦情報処理標準出版物
The Keyed-Hash Message Authentication Code (HMAC)
鍵付きハッシュメッセージ認証コード(HMAC)
CATEGORY: COMPUTER SECURITY
区分:コンピュータセキュリティ
SUBCATEGORY: CRYPTOGRAPHY
小区分:暗号
Information Technology Laboratory National Institute of Standards and Technology Gaithersburg, MD 20899-8900
Information Technology Laboratory 米国国立標準技術研究所 Gaithersburg, MD 20899-8900
July 2008
2008年7月
[米国商務省の紋章。公的な標章のため、この非公式サイトには掲載していません。原本 PDF を参照してください。]
U.S. Department of Commerce Carlos M. Gutierrez, Secretary
米国商務省 長官 Carlos M. Gutierrez
National Institute of Standards and Technology James M. Turner, Deputy Director
米国国立標準技術研究所 副所長 James M. Turner
FOREWORD
まえがき
The Federal Information Processing Standards Publication Series of the National Institute of Standards and Technology (NIST) is the official series of publications relating to Standards and Guidelines adopted and promulgated under the provisions of the Federal Information Security Management Act (FISMA) of 2002.
米国国立標準技術研究所(NIST)の連邦情報処理標準出版物シリーズは、2002年連邦情報セキュリティマネジメント法(FISMA)の規定に基づいて採択・公布された標準およびガイドラインに関する公式の出版物シリーズです。
Comments concerning FIPS publications are welcomed and should be addressed to the Director, Information Technology Laboratory, National Institute of Standards and Technology, 100 Bureau Drive, Stop 8900, Gaithersburg, MD 20899-8900.
FIPS出版物に関するコメントを歓迎します。コメントは、Director, Information Technology Laboratory, National Institute of Standards and Technology, 100 Bureau Drive, Stop 8900, Gaithersburg, MD 20899-8900 宛てに送付することが望まれます。
Cita Furlani, Director Information Technology Laboratory
Information Technology Laboratory 所長 Cita Furlani
Abstract
要旨
This Standard describes a keyed-hash message authentication code (HMAC), a mechanism for message authentication using cryptographic hash functions. HMAC can be used with any iterative Approved cryptographic hash function, in combination with a shared secret key.
本標準は、暗号学的ハッシュ関数を用いたメッセージ認証のメカニズムである鍵付きハッシュメッセージ認証コード(HMAC)について記述します。HMACは、共有シークレット鍵と組み合わせることで、反復型の承認済み暗号学的ハッシュ関数であればどれとでも使用できます。
Keywords: computer security, cryptography, HMAC, MAC, message authentication, Federal Information Processing Standards (FIPS).
キーワード:コンピュータセキュリティ、暗号、HMAC、MAC、メッセージ認証、連邦情報処理標準(FIPS)。
Federal Information Processing Standards Publication 198-1
連邦情報処理標準出版物 198-1
July 2008
2008年7月
Announcing the Standard for
次の標準を公表する
The Keyed-Hash Message Authentication Code (HMAC)
鍵付きハッシュメッセージ認証コード(HMAC)
Federal Information Processing Standards Publications (FIPS PUBS) are issued by the National Institute of Standards and Technology (NIST) after approval by the Secretary of Commerce pursuant to Section 5131 of the Information Technology Management Reform Act of 1996 (Public Law 104-106) and the Computer Security Act of 1987 (Public Law 100-235).
連邦情報処理標準出版物(FIPS PUBS)は、1996年情報技術管理改革法(Public Law 104-106)第5131条および1987年コンピュータセキュリティ法(Public Law 100-235)に従い、商務長官の承認を経て米国国立標準技術研究所(NIST)が発行します。
1.Name of Standard. The Keyed-Hash Message Authentication Code (HMAC) (FIPS PUB 198-1).
1.標準の名称。The Keyed-Hash Message Authentication Code (HMAC)(FIPS PUB 198-1)。
2.Category of Standard. Computer Security Standard. Subcategory. Cryptography.
2.標準の区分。コンピュータセキュリティ標準。小区分。暗号。
3.Explanation. This Standard specifies an algorithm for applications requiring message authentication. Message authentication is achieved via the construction of a message authentication code (MAC). MACs based on cryptographic hash functions are known as HMACs.
3.説明。本標準は、メッセージ認証を必要とするアプリケーション向けのアルゴリズムを規定します。メッセージ認証は、メッセージ認証コード(MAC)を構成することによって実現されます。暗号学的ハッシュ関数に基づくMACはHMACと呼ばれます。
The purpose of a MAC is to authenticate both the source of a message and its integrity without the use of any additional mechanisms. HMACs have two functionally distinct parameters, a message input and a secret key known only to the message originator and intended receiver(s). Additional applications of keyed-hash functions include their use in challenge-response identification protocols for computing responses, which are a function of both a secret key and a challenge message.
MACの目的は、追加のメカニズムを用いることなく、メッセージの送信元とその完全性の両方を認証することです。HMACには機能的に異なる2つのパラメータ、すなわちメッセージ入力と、メッセージの作成者および意図された受信者だけが知る秘密鍵があります。鍵付きハッシュ関数の他の用途としては、チャレンジレスポンス型識別プロトコルにおける応答の計算があります。この応答は、秘密鍵とチャレンジメッセージの両方の関数です。
An HMAC function is used by the message sender to produce a value (the MAC) that is formed by condensing the secret key and the message input. The MAC is typically sent to the message receiver along with the message. The receiver computes the MAC on the received message using the same key and HMAC function as were used by the sender, and compares the result computed with the received MAC. If the two values match, the message has been correctly received, and the receiver is assured that the sender is a member of the community of users that share the key.
HMAC関数は、メッセージの送信者が値(MAC)を生成するために用います。この値は、秘密鍵とメッセージ入力を圧縮して形成されます。MACは通常、メッセージとともにメッセージの受信者に送られます。受信者は、送信者が用いたものと同じ鍵とHMAC関数を用いて受信したメッセージのMACを計算し、計算結果を受信したMACと比較します。2つの値が一致すれば、メッセージは正しく受信されており、受信者は送信者がその鍵を共有する利用者集団の一員であることを確信できます。
4. Approving Authority.
4. 承認権者。
Secretary of Commerce.
商務長官。
5.Maintenance Agency. Department of Commerce, National Institute of Standards and Technology, Information Technology Laboratory (ITL).
5.保守機関。商務省 米国国立標準技術研究所 Information Technology Laboratory(ITL)。
6.Applicability. This Standard is applicable to all Federal departments and agencies for the protection of sensitive unclassified information that is not subject to Title 10 United States Code Section 2315 (10 USC 2315) and that is not within a national security system as defined in Title 44 United States Code Section 3502(2) (44 USC 3502(2)). The adoption and use of this Standard is available to private and commercial organizations.
6.適用範囲。本標準は、合衆国法典第10編第2315条(10 USC 2315)の対象とならず、かつ合衆国法典第44編第3502条(2)(44 USC 3502(2))で定義される国家安全保障システムに含まれない機微な非機密情報を保護するために、すべての連邦省庁に適用されます。民間組織および商業組織も本標準を採用し使用することができます。
7.Specifications. Federal Information Processing Standard (FIPS) 198-1, The Keyed-Hash Message Authentication Code (HMAC) (affixed).
7.仕様。連邦情報処理標準(FIPS)198-1, The Keyed-Hash Message Authentication Code (HMAC)(添付)。
8.Implementations. The authentication mechanism described in this Standard may be implemented in software, firmware, hardware, or any combination thereof. NIST has developed a Cryptographic Module Validation Program that will test implementations for conformance with this HMAC Standard. Information on this program is available at http://csrc.nist.gov/groups/STM/index.html.
8.実装。本標準に記述する認証メカニズムは、ソフトウェア、ファームウェア、ハードウェア、またはそれらの任意の組み合わせで実装してもよいです。NISTは、本HMAC標準への適合性について実装を試験する暗号モジュール認証プログラムを策定しています。このプログラムに関する情報は http://csrc.nist.gov/groups/STM/index.html で入手できます。
Agencies are advised that keys used for HMAC applications should not be used for other purposes.
各機関は、HMACアプリケーションに用いる鍵を他の目的に使用しないことが望ましい点に留意されました。
9.Other Approved Security Functions. HMAC implementations that comply with this Standard shall employ cryptographic algorithms, cryptographic key generation algorithms and key management techniques that have been approved for protecting Federal government sensitive information. Approved cryptographic algorithms and techniques include those that are either:
9.その他の承認済みセキュリティ機能。本標準に準拠するHMAC実装は、連邦政府の機微な情報の保護用に承認された暗号アルゴリズム、暗号鍵生成アルゴリズム、および鍵管理技法を採用しなければなりません。承認済みの暗号アルゴリズムおよび技法には、次のいずれかに該当するものが含まれます。
a. specified in a Federal Information Processing Standard (FIPS), b. adopted in a FIPS or NIST Recommendation, or c. specified in the list of Approved security functions for FIPS 140-2.
a. 連邦情報処理標準(FIPS)で規定されているもの、b. FIPSまたはNIST勧告で採用されているもの、c. FIPS 140-2の承認済みセキュリティ機能のリストに規定されているもの。
10.Export Control. Certain cryptographic devices and technical data regarding them are subject to Federal export controls. Exports of cryptographic modules implementing this Standard and technical data regarding them must comply with these Federal regulations and be licensed by the Bureau of Export Administration of the U.S. Department of Commerce. Information about export regulations is available at: http://www.bis.doc.gov/index.htm.
10.輸出管理。一部の暗号装置およびそれに関する技術データは、連邦の輸出管理の対象です。本標準を実装する暗号モジュールおよびそれに関する技術データの輸出は、これらの連邦規則に従い、米国商務省輸出管理局の許可を受けなければなりません。輸出規則に関する情報は http://www.bis.doc.gov/index.htm で入手できます。
11.Implementation Schedule. Guidance regarding the testing and validation to FIPS 198-1 and its relationship to FIPS 140-2 can be found in IG 1.10 of the Implementation Guidance for FIPS PUB 140-2 and the Cryptographic Module Validation Program at http://csrc.nist.gov/groups/STM/cmvp/index.html.
11.実施スケジュール。FIPS 198-1に対する試験および認証と、FIPS 140-2との関係に関するガイダンスは、http://csrc.nist.gov/groups/STM/cmvp/index.html にあるImplementation Guidance for FIPS PUB 140-2 and the Cryptographic Module Validation ProgramのIG 1.10に記載されています。
12.Qualifications. The security afforded by the HMAC function is dependent on maintaining the secrecy of the key and the use of an appropriate Approved hash function. Therefore, users must guard against disclosure of these keys. While it is the intent of this
12.条件。HMAC関数によって得られるセキュリティは、鍵の秘密を維持すること、および適切な承認済みハッシュ関数を用いることに依存します。したがって、利用者はこれらの鍵の漏えいを防がなければなりません。本
Standard to specify a mechanism to provide message authentication, conformance to this Standard does not assure that a particular implementation is secure. It is the responsibility of the implementer to ensure that any module containing an HMAC implementation is designed and built in a secure manner.
標準はメッセージ認証を提供するメカニズムを規定することを意図していますが、本標準への適合は特定の実装が安全であることを保証するものではありません。HMAC実装を含むモジュールが安全な方法で設計・構築されていることを確保するのは、実装者の責任です。
Similarly, the use of a product containing an implementation that conforms to this Standard does not guarantee the security of the overall system in which the product is used. The responsible authority in each agency shall assure that an overall system provides an acceptable level of security.
同様に、本標準に適合する実装を含む製品を使用しても、その製品が用いられるシステム全体のセキュリティは保証されません。各機関の責任者は、システム全体が許容可能なセキュリティレベルを提供することを確保しなければなりません。
Since a Standard of this nature must be flexible enough to adapt to advancements and innovations in science and technology, this Standard will be reviewed every five years in order to assess its adequacy.
この種の標準は科学技術の進歩と革新に適応できる柔軟性を備える必要があるため、本標準は妥当性を評価するために5年ごとに見直されます。
13.Waiver Procedure: The Federal Information Security Management Act (FISMA) does not allow for waivers to Federal Information Processing Standards (FIPS) that are made mandatory by the Secretary of Commerce.
13.適用除外の手続き:連邦情報セキュリティマネジメント法(FISMA)は、商務長官が義務化した連邦情報処理標準(FIPS)に対する適用除外を認めていません。
14.Where to obtain copies. This publication is available by accessing http://csrc.nist.gov/publications/. Other computer security publications are available at the same web site.
14.写しの入手先。本出版物は http://csrc.nist.gov/publications/ にアクセスして入手できます。その他のコンピュータセキュリティ関連の出版物も同じWebサイトで入手できます。
Federal Information Processing Standards Publication 198-1
連邦情報処理標準出版物 198-1
Specifications for
次の仕様
The Keyed-Hash Message Authentication Code
The Keyed-Hash Message Authentication Code
TABLE OF CONTENTS
目次
1. INTRODUCTION
1. はじめに
Providing a way to check the integrity of information transmitted over or stored in an unreliable medium is a prime necessity in the world of open computing and communications. Mechanisms that provide such integrity checks based on a secret key are usually called message authentication codes (MACs). Typically, message authentication codes are used between two parties that share a secret key in order to authenticate information transmitted between these parties. This Standard defines a MAC that uses a cryptographic hash function in conjunction with a secret key. This mechanism is called HMAC [HMAC]. HMAC shall use an Approved cryptographic hash function [FIPS 180-3]. HMAC uses the secret key for the calculation and verification of the MACs.
信頼性の低い媒体を介して送信される情報、またはそうした媒体に保存される情報の完全性を検査する手段を提供することは、オープンなコンピューティングと通信の世界において第一の必要事項です。秘密鍵に基づいてこのような完全性検査を提供するメカニズムは、通常、メッセージ認証コード(MAC)と呼ばれます。メッセージ認証コードは一般に、秘密鍵を共有する二者の間で、両者間で送信される情報を認証するために用いられます。本標準は、暗号学的ハッシュ関数を秘密鍵と組み合わせて用いるMACを定義します。このメカニズムをHMAC [HMAC] と呼びます。HMACは承認済みの暗号学的ハッシュ関数 [FIPS 180-3] を使用しなければなりません。HMACは、MACの計算および検証に秘密鍵を用います。
2. GLOSSARY OF TERMS AND ACRONYMS
2. 用語および略語の解説
2.1 Glossary of Terms
2.1 用語集
The following definitions are used throughout this Standard:
本標準全体を通じて、次の定義を用います。
Approved: FIPS-approved or NIST recommended. An algorithm or technique that is either 1) specified in a FIPS or NIST Recommendation, or 2) adopted in a FIPS or NIST Recommendation and specified in either the FIPS or NIST Recommendation, or in a document referenced by the FIPS or NIST Recommendation.
Approved:FIPS承認またはNIST推奨。次のいずれかに該当するアルゴリズムまたは技法をいいます。1) FIPSまたはNIST勧告で規定されているもの、2) FIPSまたはNIST勧告で採用され、かつ当該FIPSもしくはNIST勧告、または当該FIPSもしくはNIST勧告が参照する文書で規定されているもの。
Cryptographic key (key): a parameter used in conjunction with a cryptographic algorithm that determines the specific operation of that algorithm. In this Standard, the cryptographic key is used by the HMAC algorithm to produce a MAC on the data.
Cryptographic key (key):暗号アルゴリズムと組み合わせて使用され、そのアルゴリズムの具体的な動作を決定するパラメータ。本標準では、暗号鍵は HMAC アルゴリズムがデータに対する MAC を生成するために使用します。
Hash function: a mathematical function that maps a string of arbitrary length (up to a pre-determined maximum size) to a fixed length string.
Hash function:任意長(あらかじめ定めた最大長まで)の文字列を固定長の文字列に写像する数学的関数。
Keyed-hash message authentication code (HMAC): a message authentication code that uses a cryptographic key in conjunction with a hash function.
Keyed-hash message authentication code (HMAC):暗号鍵をハッシュ関数と組み合わせて使用するメッセージ認証コード。
Message Authentication Code (MAC): a cryptographic checksum that results from passing data through a message authentication algorithm. In this Standard, the message authentication algorithm is called HMAC, while the result of applying HMAC is called the MAC.
Message Authentication Code (MAC):データをメッセージ認証アルゴリズムに通すことで得られる暗号チェックサム。本標準では、メッセージ認証アルゴリズムを HMAC と呼び、HMAC を適用した結果を MAC と呼びます。
Secret key: a cryptographic key that is uniquely associated with one or more entities. The use of the term "secret" in this context does not imply a classification level; rather the term implies the need to protect the key from disclosure or substitution.
Secret key:一つ以上のエンティティに一意に関連付けられた暗号鍵。この文脈における「secret(秘密)」という用語は機密区分のレベルを意味するものではなく、鍵を開示や置換から保護する必要があることを意味します。
2.2 Acronyms
2.2 略語
The following acronyms and abbreviations are used throughout this Standard:
本標準では、次の略語を使用します。
FIPS — Federal Information Processing Standard
FIPS — 連邦情報処理標準
FIPS PUB FIPS Publication
FIPS PUB FIPS 刊行物
HMAC Keyed-Hash Message Authentication Code
HMAC 鍵付きハッシュメッセージ認証コード
MAC — Message Authentication Code
MAC — メッセージ認証コード
NIST — National Institute of Standards and Technology
NIST — 米国国立標準技術研究所
2.3 HMAC Parameters and Symbols
2.3 HMAC のパラメータと記号
HMAC uses the following parameters:
HMAC は次のパラメータを使用します。
B Block size (in bytes) of the input to the Approved hash function.
B 承認されたハッシュ関数への入力のブロックサイズ(バイト単位)。
H — An Approved hash function.
H — 承認されたハッシュ関数。
ipad — Inner pad; the byte x‘36’ repeated B times.
ipad — 内側パッド。バイト x‘36’ を B 回繰り返したもの。
K Secret key shared between the originator and the intended receiver(s).
K 送信者と意図された受信者との間で共有される秘密鍵。
\(K_0\) — The key K after any necessary pre-processing to form a B byte key.
\(K_0\) — B バイトの鍵とするために必要な前処理を施した後の鍵 K。
L — Block size (in bytes) of the output of the Approved hash function.
L — 承認されたハッシュ関数の出力のブロックサイズ(バイト単位)。
opad — Outer pad; the byte x‘5c’ repeated B times.
opad — 外側パッド。バイト x‘5c’ を B 回繰り返したもの。
text — The data on which the HMAC is calculated; text does not include the padded key. The length of text is n bits, where \(0 \le n < 2^B - 8B\).
text — HMAC を計算する対象のデータ。text にはパディングされた鍵は含まれません。text の長さは n ビットであり、\(0 \le n < 2^B - 8B\) です。
x ‘N’ — Hexadecimal notation, where each symbol in the string ‘N’ represents 4 binary bits.
x ‘N’ — 16 進表記。文字列 ‘N’ の各記号は 4 ビットの 2 進数を表します。
|| — Concatenation.
|| — 連結。
⊕ — Exclusive-Or operation.
⊕ — 排他的論理和演算。
3. CRYPTOGRAPHIC KEYS
3. 暗号鍵
HMAC uses a key, K, of appropriate security strength, as discussed in NIST Special Publication (SP) 800-107 [SP 800-107], Recommendation for Applications Using Approved Hash Algorithms. When an application uses a K longer than B-bytes, then it shall first hash the K using H and then use the resultant L-byte string as the key \(K_0\); detail can be found in Table 1 in Section 4 below.
HMAC は、NIST Special Publication (SP) 800-107 [SP 800-107]、Recommendation for Applications Using Approved Hash Algorithms で論じられているとおり、適切なセキュリティ強度を持つ鍵 K を使用します。アプリケーションが B バイトより長い K を使用する場合、まず H を用いて K をハッシュし、得られた L バイトの文字列を鍵 \(K_0\) として使用しなければなりません。詳細は後述の第 4 節の表 1 を参照のこと。
4. HMAC SPECIFICATION
4. HMAC の仕様
To compute a MAC over the data ‘text’ using the HMAC function, the following operation is performed:
HMAC 関数を用いてデータ ‘text’ に対する MAC を計算するには、次の演算を行います。
\(MAC(text) = HMAC(K, text) = H((K_0 \oplus opad) \| H((K_0 \oplus ipad) \| text))\)
\(MAC(text) = HMAC(K, text) = H((K_0 \oplus opad) \| H((K_0 \oplus ipad) \| text))\)
Table 1 illustrates the step by step process in the HMAC algorithm, which is depicted in Figure 1.
表 1 は HMAC アルゴリズムの処理を段階ごとに示したものであり、図 1 はそれを図示したものです。
Table 1: The HMAC Algorithm
表 1:HMAC アルゴリズム
| STEPS | STEP-BY-STEP DESCRIPTION |
|---|---|
| Step 1 | If the length of \(K = B\): set \(K_0 = K\). Go to step 4. |
| Step 2 | If the length of \(K > B\): hash \(K\) to obtain an \(L\) byte string, then append \((B-L)\) zeros to create a B-byte string \(K_0\) (i.e., \(K_0 = \mathrm{H}(K) \| 00...00\)). Go to step 4. |
| Step 3 | If the length of \(K < B\): append zeros to the end of \(K\) to create a \(B\)-byte string \(K_0\) (e.g., if \(K\) is 20 bytes in length and \(B = 64\), then \(K\) will be appended with 44 zero bytes x’00’). |
| Step 4 | Exclusive-Or \(K_0\) with \(ipad\) to produce a \(B\)-byte string: \(K_0 \oplus ipad\). |
| Step 5 | Append the stream of data 'text' to the string resulting from step 4: \((K_0 \oplus ipad) \| text\). |
| Step 6 | Apply \(H\) to the stream generated in step 5: \(\mathrm{H}((K_0 \oplus ipad) \| text)\). |
| Step 7 | Exclusive-Or \(K_0\) with \(opad\): \(K_0 \oplus opad\). |
| Step 8 | Append the result from step 6 to step 7: \((K_0 \oplus opad) \| \mathrm{H}((K_0 \oplus ipad) \| text)\). |
| Step 9 | Apply \(H\) to the result from step 8: \(H((K_0 \oplus opad) \| H((K_0 \oplus ipad) \| text))\). |
| 手順 | 各手順の説明 |
|---|---|
| 手順1 | 長さが \(K = B\) の場合:\(K_0 = K\) とします。手順4に進みます。 |
| 手順2 | 長さが \(K > B\) の場合:\(K\) をハッシュして \(L\) バイトの文字列を得た後、\((B-L)\) 個のゼロを付加して B バイトの文字列 \(K_0\) を作成します(すなわち、\(K_0 = \mathrm{H}(K) \| 00...00\))。手順4に進みます。 |
| 手順3 | 長さが \(K < B\) の場合:\(K\) の末尾にゼロを付加して \(B\) バイトの文字列 \(K_0\) を作成します(例えば、\(K\) の長さが20バイトで \(B = 64\) の場合、\(K\) には44個のゼロバイト x’00’ が付加されます)。 |
| 手順4 | \(K_0\) と \(ipad\) の排他的論理和をとり、\(B\) バイトの文字列 \(K_0 \oplus ipad\) を生成します。 |
| 手順5 | 手順4の結果の文字列にデータストリーム 'text' を付加する:\((K_0 \oplus ipad) \| text\)。 |
| 手順6 | 手順5で生成したストリームに \(H\) を適用する:\(\mathrm{H}((K_0 \oplus ipad) \| text)\)。 |
| 手順7 | \(K_0\) と \(opad\) の排他的論理和をとる:\(K_0 \oplus opad\)。 |
| 手順8 | 手順6の結果を手順7の結果に付加する:\((K_0 \oplus opad) \| \mathrm{H}((K_0 \oplus ipad) \| text)\)。 |
| 手順9 | 手順8の結果に \(H\) を適用する:\(H((K_0 \oplus opad) \| H((K_0 \oplus ipad) \| text))\)。 |
Figure 1: Illustration of the HMAC Construction
図 1:HMAC の構成の図解
5. TRUNCATION
5. 切り詰め
A well-known practice with MACs is to truncate their outputs (i.e., the length of the MACs used is less than the length of the output of the HMAC function L). Applications of this standard may truncate the outputs of the HMAC. When truncation is used, the λ leftmost bits of the output of the HMAC function shall be used as the MAC. For information about the choice of λ and the security implications of using truncated outputs of the HMAC function, see SP 800-107.
MAC の出力を切り詰める(すなわち、使用する MAC の長さを HMAC 関数の出力長 L より短くする)ことは、よく知られた慣行です。本標準のアプリケーションは、HMAC の出力を切り詰めてもよいです。切り詰めを行う場合、HMAC 関数の出力の左端 λ ビットを MAC として使用しなければなりません。λ の選び方と、HMAC 関数の切り詰めた出力を使用することのセキュリティ上の影響については、SP 800-107 を参照のこと。
6. IMPLEMENTATION NOTE
6. 実装上の注記
The HMAC algorithm is specified for an arbitrary Approved iterative cryptographic hash function, H. In the HMAC algorithm, values of the ipad and the opad depend on the block size, B, of the Approved hash function. An HMAC implementation can easily replace one Approved iterative hash function, H, with another Approved iterative hash function, H’ by generating new ipad and opad using the block size of H’ instead of H as defined in Section 2.3.
HMAC アルゴリズムは、任意の承認された反復型暗号ハッシュ関数 H について規定されています。HMAC アルゴリズムでは、ipad と opad の値は承認されたハッシュ関数のブロックサイズ B に依存します。HMAC の実装では、第 2.3 節の定義に従い H ではなく H’ のブロックサイズを用いて新たな ipad と opad を生成することで、ある承認された反復型ハッシュ関数 H を別の承認された反復型ハッシュ関数 H’ に容易に置き換えることができます。
Conceptually, the intermediate results of the compression function on the B-byte blocks \((K_0 \oplus ipad)\) and \((K_0 \oplus opad)\) can be precomputed once, at the time of generation of the key K, or before its first use. These intermediate results can be stored and then used to initialize H each time that a message needs to be authenticated using the same key. For each authenticated message using the key K, this method saves the application of the hash function of H on two B-byte blocks (i.e., on \((K \oplus ipad)\) and \((K \oplus opad)\)). This saving may be significant when authenticating short streams of data. These stored intermediate values shall be treated and protected in the same manner as secret keys.
概念的には、B バイトのブロック \((K_0 \oplus ipad)\) と \((K_0 \oplus opad)\) に対する圧縮関数の中間結果は、鍵 K の生成時または鍵の初回使用前に一度だけ事前計算しておくことができます。これらの中間結果を保存しておき、同じ鍵を用いてメッセージを認証する必要が生じるたびに H の初期化に使用できます。この方法により、鍵 K を用いて認証するメッセージごとに、二つの B バイトのブロック(すなわち \((K \oplus ipad)\) と \((K \oplus opad)\))に対するハッシュ関数 H の適用が省かれます。短いデータストリームを認証する場合、この節約は大きくなりうます。保存したこれらの中間値は、秘密鍵と同じ方法で取り扱い、保護しなければなりません。
Choosing to implement HMAC in this manner has no effect on interoperability.
HMAC をこの方法で実装することを選択しても、相互運用性には影響しません。
Object identifiers (OIDs) for HMAC are posted at http://csrc.nist.gov/groups/ST/crypto_apps_infra/csor/algorithms.html, along with procedures for adding new OIDs.
HMAC のオブジェクト識別子(OID)は、新たな OID を追加する手順とともに http://csrc.nist.gov/groups/ST/crypto_apps_infra/csor/algorithms.html に掲載されています。
Examples of HMAC are available at http://csrc.nist.gov/groups/ST/toolkit/examples.html.
HMAC の例は http://csrc.nist.gov/groups/ST/toolkit/examples.html で入手できます。
APPENDIX A: The Differences Between FIPS 198 and FIPS 198-1
付録 A:FIPS 198 と FIPS 198-1 の相違点
The length of truncated HMAC outputs and their security implications in FIPS 198 is not mentioned in this Standard; instead, it is described in SP 800-107. The discussion about the limitations of MAC algorithms has been moved to SP 800-107. The examples and OIDs have been posted on the NIST web sites referenced in Section 6.
FIPS 198 にあった、切り詰めた HMAC 出力の長さとそのセキュリティ上の影響については、本標準では取り上げず、SP 800-107 で記述しています。MAC アルゴリズムの限界に関する議論は SP 800-107 に移しました。例と OID は、第 6 節で参照している NIST の Web サイトに掲載しました。
APPENDIX B: References
付録 B:参考文献
[HMAC] H. Krawczyk, M. Bellare, and R. Canetti, HMAC: Keyed-Hashing for Message Authentication, Internet Engineering Task Force, Request for Comments (RFC) 2104, February 1997.
[HMAC] H. Krawczyk, M. Bellare, and R. Canetti, HMAC: Keyed-Hashing for Message Authentication, Internet Engineering Task Force, Request for Comments (RFC) 2104, 1997年2月.
[FIPS 180-3] National Institute of Standards and Technology, Secure Hash Standards (SHS), Federal Information Processing Standards Publication 180-3, October 2008.
[FIPS 180-3] National Institute of Standards and Technology, Secure Hash Standards (SHS), Federal Information Processing Standards Publication 180-3, 2008年10月.
[SP 800-57] NIST Special Publication (SP) 800-57, Recommendation for Key Management – Part 1: General (Revised), March 2007.
[SP 800-57] NIST Special Publication (SP) 800-57, Recommendation for Key Management – Part 1: General (Revised), 2007年3月.
[SP 800-107] NIST Special Publication (SP) 800-107, Recommendation for Applications Using Approved Hash Algorithms, February 2009.
[SP 800-107] NIST Special Publication (SP) 800-107, Recommendation for Applications Using Approved Hash Algorithms, 2009年2月.