目次

NIST SP 800-38A Addendum 日本語訳

英語タイトル : Recommendation for Block Cipher Modes of Operation: Three Variants of Ciphertext Stealing for CBC Mode
日本語タイトル : ブロック暗号の運用モードに関する推奨事項:CBCモードの暗号文盗用3方式
公開日 : 2010-10
原文URL : https://csrc.nist.gov/pubs/sp/800/38/a/sup/final
翻訳編集 : 自動生成(有志による非公式の日本語訳), 原文取得日 : 2026-10-01, 訳文 : 107 / 107 ブロック

[要約] SP 800-38A Addendum は、SP 800-38AのCBCモードに対し、暗号文盗用を用いる3つの変形CBC-CS1、CBC-CS2、CBC-CS3を規定する補遺です。ビット長がブロックサイズ以上であれば、ブロックサイズの倍数でなくても任意の平文入力を受け入れ、第2節から第4節で各変形の仕様を定めます。SP 800-38A で説明されているパディング方式と異なり暗号文が拡張されず、3つの変形の違いは暗号文ビットの順序だけです。

Addendum to NIST Special Publication 800-38A

NIST Special Publication 800-38Aへの補遺

October, 2010

2010年10月

Recommendation for Block Cipher Modes of Operation: Three Variants of Ciphertext Stealing for CBC Mode

ブロック暗号の運用モードに関する推奨事項:CBCモードの暗号文盗用3方式

Morris Dworkin

Morris Dworkin

図表
[NIST logo — not reproduced on this unofficial site]

[NIST のロゴ。公的な標章のため、この非公式サイトには掲載していません。原本 PDF を参照してください。]

C O M P U T E R S E C U R I T Y

C O M P U T E R S E C U R I T Y(コンピューターセキュリティ)

Addendum to NIST Special Publication 800-38A

NIST Special Publication 800-38Aへの補遺

Recommendation for Block Cipher Modes of Operation: Three Variants of Ciphertext Stealing for CBC Mode

ブロック暗号の運用モードに関する推奨事項:CBCモードの暗号文盗用3方式

Morris Dworkin

Morris Dworkin

C O M P U T E R S E C U R I T Y

C O M P U T E R S E C U R I T Y(コンピューターセキュリティ)

Computer Security Division Information Technology Laboratory National Institute of Standards and Technology Gaithersburg, MD 20899-8930

コンピューターセキュリティ部門 情報技術研究所 米国国立標準技術研究所 メリーランド州ゲイサーズバーグ 20899-8930

October 2010

2010年10月

U.S. Department of Commerce Gary Locke, Secretary

米国商務省 Gary Locke 長官

National Institute of Standards and Technology Patrick Gallagher, Director

米国国立標準技術研究所 Patrick Gallagher 所長

Reports on Information Security Technology

情報セキュリティ技術に関する報告書

The Information Technology Laboratory (ITL) at the National Institute of Standards and Technology (NIST) promotes the U.S. economy and public welfare by providing technical leadership for the Nation’s measurement and standards infrastructure. ITL develops tests, test methods, reference data, proof of concept implementations, and technical analyses to advance the development and productive use of information technology. ITL’s responsibilities include the development of technical, physical, administrative, and management standards and guidelines for the cost-effective security and privacy of sensitive unclassified information in Federal computer systems. This Special Publication 800-series reports on ITL’s research, guidance, and outreach efforts in computer security, and its collaborative activities with industry, government, and academic organizations.

国立標準技術研究所(NIST)の情報技術研究所(ITL)は、米国の計測および標準インフラストラクチャに対する技術的リーダーシップを提供することで、米国経済と公共の福祉を促進しています。ITLは、情報技術の発展と生産的な利用を前進させるため、試験、試験方法、参照データ、概念実証実装、および技術分析を開発します。ITLの責務には、連邦コンピューターシステム内の機微な非機密情報の費用対効果の高いセキュリティとプライバシーを確保するため、技術、物理、事務管理、およびマネジメントに関する標準およびガイドラインを策定することが含まれます。本Special Publication 800シリーズは、コンピューターセキュリティに関するITLの研究、指針、普及活動、および産業界、政府、学術機関との協力活動について報告します。

Certain commercial entities, equipment, or materials may be identified in this document in order to describe an experimental procedure or concept adequately. Such identification is not intended to imply recommendation or endorsement by the National Institute of Standards and Technology, nor is it intended to imply that the entities, materials, or equipment are necessarily the best available for the purpose.

実験手順または概念を適切に説明する目的で、本書では特定の商業組織、装置、または材料を特定する場合があります。このような特定は、国立標準技術研究所による推奨または是認を意味することを意図するものではなく、また、当該組織、材料、または装置が必ずしもその目的に最適であることを意味するものでもありません。

Addendum National Institute of Standards and Technology Special Publication 800-38A

補遺 国立標準技術研究所 Special Publication 800-38A

11 pages (June 2010)

11ページ(2010年6月)

CODEN: NSPUE2

CODEN: NSPUE2

Table of Contents

目次

List of Figures

図一覧

1 Introduction

1 はじめに

A limitation to Cipher Block Chaining (CBC) mode, as specified in NIST SP 800-38A, Ref. [1], is that the plaintext input must consist of a sequence of blocks. (In the rest of this publication, a block is called a “complete block” to emphasize the contrast with a “partial block” whose bit length is smaller than the block size.) Although Appendix A of Ref. [1] describes how padding methods can be used to meet this requirement, in such cases, the length of the resulting ciphertext expands over the length of the unpadded plaintext by the number of padding bits.

NIST SP 800-38A(参考文献[1])に規定されているCipher Block Chaining(CBC)モードの制約の一つは、平文入力がブロックの列から成らなければならないことです。(本書の以降の部分では、ブロックサイズより小さいビット長を持つ「部分ブロック」との対比を明確にするため、ブロックを「完全ブロック」と呼びます。)参考文献[1]の付録Aでは、この要件を満たすためにパディング方式を使用できることを説明していますが、そのような場合、結果として得られる暗号文は、パディングされていない平文よりパディングのビット数だけ長くなります。

This addendum to Ref. [1] specifies three variants of CBC mode that accept any plaintext input whose bit length is greater than or equal to the block size, whether or not the length is a multiple of the block size. Unlike the padding methods discussed in Ref. [1], these variants avoid ciphertext expansion.

参考文献[1]への本補遺は、ビット長がブロックサイズ以上であれば、長さがブロックサイズの倍数であるかどうかを問わず、任意の平文入力を受け入れるCBCモードの3種類の変形を規定します。参考文献[1]で説明されているパディング方式とは異なり、これらの変形では暗号文が拡張されません。

These variants are denoted CBC-CS1, CBC-CS2, and CBC-CS3, where “CS” indicates “ciphertext stealing,” because when padding bits are needed in these variants, they are taken from the penultimate ciphertext block. The variants differ only in the ordering of the ciphertext bits. CBC-CS1 was specified as a suggestion on the NIST Computer Security Resource Center web site. CBC-CS2 is specified, for example, in Ref. [3]. CBC-CS3 is the variant specified for Kerberos 5 in Ref. [2].

これらの変形はCBC-CS1、CBC-CS2、CBC-CS3と表記します。「CS」は「ciphertext stealing(暗号文盗用)」を示します。これは、これらの変形でパディングビットが必要な場合、最後から2番目の暗号文ブロックからそのビットを取るためです。各変形の違いは、暗号文ビットの順序だけです。CBC-CS1は、NIST Computer Security Resource CenterのWebサイトで提案として規定されました。CBC-CS2は、たとえば参考文献[3]で規定されています。CBC-CS3は、参考文献[2]でKerberos 5用に規定された変形です。

Below are the specifications for encryption and decryption using CBC-CS1, CBC-CS2, and CBC-CS3, building on the specification of the CBC encryption and decryption in Ref. [1]. Diagrams are given for CBC-CS1 encryption and decryption. Each variant inherits the relevant requirements of Ref. [1], e.g., on the underlying block cipher, the key, and the initialization vector.

以下に、参考文献[1]におけるCBC暗号化および復号の仕様を基礎として、CBC-CS1、CBC-CS2、CBC-CS3を用いた暗号化と復号の仕様を示します。CBC-CS1の暗号化と復号については図を示します。各変形には、基礎となるブロック暗号、鍵、初期化ベクトルなど、参考文献[1]の関連要件が適用されます。

The following notational conventions apply to the specifications below:

以下の仕様には、次の表記規則を適用します。

•Bit strings are denoted with upper case letters; integers with lower case letters.

•ビット列は大文字で、整数は小文字で表します。

• The block size of the underlying block cipher is denoted \(b\).

• 基礎となるブロック暗号のブロックサイズを \(b\) と表します。

• For a bit string \(X\), the bit length of \(X\) is denoted \(\operatorname{len}(X)\).

• ビット列 \(X\) について、\(X\) のビット長を \(\operatorname{len}(X)\) と表します。

• For a bit string \(X\) and a positive integer \(r\) that does not exceed \(\operatorname{len}(X)\), the string consisting of the leftmost \(r\) bits of \(X\) is denoted \(\mathrm{MSB}_r(X)\), and the string consisting of the rightmost \(r\) bits of \(X\) is denoted \(\mathrm{LSB}_r(X)\).

• ビット列 \(X\) と、\(r\) が \(\operatorname{len}(X)\) を超えない正の整数であるとき、左端の \(r\) ビット(\(X\) のもの)から成る列を \(\mathrm{MSB}_r(X)\) と表し、右端の \(r\) ビット(\(X\) のもの)から成る列を \(\mathrm{LSB}_r(X)\) と表します。

• For an input block \(B\) and key \(K\), the output block of the cipher function (“encryption”) is denoted \(\mathrm{CIPH}_K(B)\), and the output block of the inverse cipher function (“decryption”) is denoted \(\mathrm{CIPH}^{-1}_K(B)\).

• 入力ブロック \(B\) と鍵 \(K\) に対し、暗号関数(「暗号化」)の出力ブロックを \(\mathrm{CIPH}_K(B)\) と表し、逆暗号関数(「復号」)の出力ブロックを \(\mathrm{CIPH}^{-1}_K(B)\) と表します。

In principle, the input strings to encryption and decryption for each of the variants may be any string whose length is not less than b bits, but typically an implementation is designed to accept a restricted set of lengths. For example, the set of lengths may be restricted to multiples of 8, so that the input strings may be represented with bytes/octets. The input lengths that an implementation allows are called the valid lengths.

原理上、各変形における暗号化および復号への入力文字列は、長さが b ビット以上であれば任意の文字列でよいですが、通常、実装は限られた長さの集合を受け入れるよう設計されます。たとえば、許容する長さを8の倍数に制限することがあり、これにより入力文字列をバイト/オクテットで表現できます。実装が許容する入力長を有効長と呼びます。

2 Specification of CBC-CS1

2 CBC-CS1の仕様

Algorithm: CBC-CS1-Encrypt

アルゴリズム:CBC-CS1-Encrypt

Input: plaintext \(P\), such that \(\operatorname{len}(P)\) is valid;
initialization vector \(\mathit{IV}\);
key \(K\).

入力:平文 \(P\)(ただし \(\operatorname{len}(P)\) が有効な長さであるもの);
初期化ベクトル \(\mathit{IV}\);
鍵 \(K\)。

Output: ciphertext \(C\), such that \(\operatorname{len}(C)=\operatorname{len}(P)\).

出力:暗号文 \(C\)(ただし \(\operatorname{len}(C)=\operatorname{len}(P)\) を満たすもの)。

手順:

1. Let \(n\) be the smallest integer such that \(n\cdot b\ge \operatorname{len}(P)\), let \(d=\operatorname{len}(P)-(n-1)\cdot b\), and let \(P_1, P_2, \ldots, P_{n-1}, P_n^{*}\) be the unique sequence of bit strings such that:
a) \(P=P_1\parallel P_2\parallel\ldots\parallel P_{n-1}\parallel P_n^{*}\); and
b) \(P_1, P_2, \ldots\) and \(P_{n-1}\) are complete blocks.
Consequently, \(\operatorname{len}(P_n^{*})=d\), and \(1\le d\le b\), so that \(P_n^{*}\) is either a complete block or a nonempty partial block.

1. \(n\) を \(n\cdot b\ge \operatorname{len}(P)\) を満たす最小の整数とし、\(d=\operatorname{len}(P)-(n-1)\cdot b\) とします。また、\(P_1, P_2, \ldots, P_{n-1}, P_n^{*}\) を、次を満たすビット列の一意な列とします。
a) \(P=P_1\parallel P_2\parallel\ldots\parallel P_{n-1}\parallel P_n^{*}\)。かつ
b) \(P_1, P_2, \ldots\) および \(P_{n-1}\) は完全ブロックです。
したがって、\(\operatorname{len}(P_n^{*})=d\) であり、\(1\le d\le b\) となるため、\(P_n^{*}\) は完全ブロックまたは空でない部分ブロックのいずれかです。

2. Let \(\mathit{PAD}\) be the bit string consisting of \(b-d\) ‘0’ bits, and let \(P_n=P_n^{*}\parallel\mathit{PAD}\). Note that if \(P_n^{*}\) is a complete block, then \(\mathit{PAD}\) is the empty string, and \(P_n=P_n^{*}\).

2. \(\mathit{PAD}\) を \(b-d\) 個の ‘0’ ビットから成るビット列とし、\(P_n=P_n^{*}\parallel\mathit{PAD}\) とします。\(P_n^{*}\) が完全ブロックである場合、\(\mathit{PAD}\) は空の列となり、\(P_n=P_n^{*}\) であることに注意します。

3. Apply CBC encryption to the plaintext \((P_1, P_2, \ldots P_{n-1}, P_n)\) with initialization vector \(\mathit{IV}\) and key \(K\) to produce \((C_1, C_2, \ldots C_{n-1}, C_n)\).

3. 平文 \((P_1, P_2, \ldots P_{n-1}, P_n)\) に、初期化ベクトル \(\mathit{IV}\) と鍵 \(K\) を用いてCBC暗号化を適用し、\((C_1, C_2, \ldots C_{n-1}, C_n)\) を生成します。

4. Let \(C_{n-1}^{*}=\mathrm{MSB}_d(C_{n-1})\).

4. \(C_{n-1}^{*}=\mathrm{MSB}_d(C_{n-1})\) とします。

5. Return \(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}^{*}\parallel C_n\).

5. \(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}^{*}\parallel C_n\) を返します。

When \(P_n^{*}\) is a complete block, CBC-CS1-Encrypt is equivalent to CBC encryption.

\(P_n^{*}\) が完全ブロックの場合、CBC-CS1-Encrypt はCBC暗号化と等価です。

Diagram: Figure 1 below illustrates the CBC-CS1-Encrypt algorithm for the case that \(P_n^{*}\) is a partial block, i.e., \(d<b\). The bolded rectangles contain the inputs and outputs. The dotted rectangles provide alternate representations of two blocks in order to illustrate the role of the “stolen” ciphertext.

図:下の図1は、\(P_n^{*}\) が部分ブロック、すなわち \(d<b\) の場合のCBC-CS1-Encryptアルゴリズムを示します。太線の長方形は入力と出力を含みます。点線の長方形は、「盗用」される暗号文の役割を示すために、2つのブロックの別の表現を示します。

In particular, the string of the \(b-d\) rightmost bits of \(C_{n-1}\), denoted \(C_{n-1}^{**}\), becomes the padding for the input block to the final invocation of the block cipher within the execution of CBC mode. The ciphertext that is returned in Step 5 above omits \(C_{n-1}^{**}\), because it can be recovered from \(C_n\) during decryption.

具体的には、右端 \(b-d\) ビットからなる \(C_{n-1}\) の部分文字列を \(C_{n-1}^{**}\) と表します。この文字列は、CBCモードの実行におけるブロック暗号の最後の呼び出しに対する入力ブロックのパディングとなります。上記ステップ5で返される暗号文では \(C_{n-1}^{**}\) を省略します。復号時に \(C_n\) から復元できるためです。

図表

図1:CBC-CS1-Encrypt。列ごとの CBC 暗号化である。P_1 は IV と排他的論理和(⊕)をとられ、CIPH_K を経て C_1 となる。C_1 は P_2 との排他的論理和に入り、それが CIPH_K を経て C_2 となる。省略されたブロックは省略記号と点線で示され、P_(n-1) と C_(n-1) まで続く。最後の列では、部分ブロック P_n* の後にゼロ「00...」(点線の箱)が続いて P_n となり、C_(n-1) と排他的論理和をとられて CIPH_K を経て C_n となる。下では C_(n-1) が C_(n-1)* と C_(n-1)**(点線の箱)に分けられ、波括弧で C_(n-1)* が出力(太枠)として選ばれる。破線の矢印が C_(n-1)** を最後の排他的論理和の右へ運び、そこで点線の箱 P_n* ⊕ C_(n-1)* と C_(n-1)** がその排他的論理和に入る様子が示されている。太枠の長方形は入力 IV、P_1、P_2、P_(n-1)、P_n* と出力 C_1、C_2、C_n、C_(n-1)* を表す。

Figure 1: CBC-CS1-Encrypt

図1:CBC-CS1-Encrypt

Algorithm: CBC-CS1-Decrypt

アルゴリズム:CBC-CS1-Decrypt

Input: ciphertext \(C\), such that \(\operatorname{len}(C)\) is valid;
initialization vector \(\mathit{IV}\);
key \(K\).

入力:暗号文 \(C\)(ただし \(\operatorname{len}(C)\) が有効な長さであるもの);
初期化ベクトル \(\mathit{IV}\);
鍵 \(K\)。

Output: plaintext \(P\), such that \(\operatorname{len}(P)=\operatorname{len}(C)\).

出力:平文 \(P\)(ただし \(\operatorname{len}(P)=\operatorname{len}(C)\) を満たすもの)。

手順:

1. Let \(n\) be the smallest integer such that \(n\cdot b\ge\operatorname{len}(C)\), let \(d=\operatorname{len}(C)-(n-1)\cdot b\), and let \(C_1, C_2, \ldots, C_{n-2}, C_{n-1}^{*}, C_n\) be the unique sequence of bit strings such that a) \(C=C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}^{*}\parallel C_n\); b) \(C_n\) is a complete block; and c) if \(n>2\), then \(C_1,\ldots,C_{n-2}\), are complete blocks. Consequently, \(\operatorname{len}(C_{n-1}^{*})=d\), and \(1\le d\le b\), so that \(C_{n-1}^{*}\) is either a complete block or a nonempty partial block.

1. \(n\) を \(n\cdot b\ge\operatorname{len}(C)\) を満たす最小の整数とし、\(d=\operatorname{len}(C)-(n-1)\cdot b\) とします。また、次の条件を満たすビット列の一意な列 \(C_1, C_2, \ldots, C_{n-2}, C_{n-1}^{*}, C_n\) を定めます。a) \(C=C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}^{*}\parallel C_n\)。b) \(C_n\) は完全ブロックです。c) \(n>2\) の場合、\(C_1,\ldots,C_{n-2}\) は完全ブロックです。したがって、\(\operatorname{len}(C_{n-1}^{*})=d\) であり、\(1\le d\le b\) となるため、\(C_{n-1}^{*}\) は完全ブロックまたは空でない部分ブロックです。

2. Let \(Z^{*}=\mathrm{MSB}_d(\mathrm{CIPH}_K^{-1}(C_n))\), and \(Z^{**}=\mathrm{LSB}_{b-d}(\mathrm{CIPH}_K^{-1}(C_n))\).

2. \(Z^{*}=\mathrm{MSB}_d(\mathrm{CIPH}_K^{-1}(C_n))\)、\(Z^{**}=\mathrm{LSB}_{b-d}(\mathrm{CIPH}_K^{-1}(C_n))\) とします。

3. Let \(C_{n-1}=C_{n-1}^{*}\parallel Z^{**}\). Note that if \(C_{n-1}^{*}\) is a complete block, then \(Z^{**}\) is the empty string, and \(C_{n-1}=C_{n-1}^{*}\).

3. \(C_{n-1}=C_{n-1}^{*}\parallel Z^{**}\) とします。\(C_{n-1}^{*}\) が完全ブロックの場合、\(Z^{**}\) は空文字列であり、\(C_{n-1}=C_{n-1}^{*}\) となります。

4. Apply CBC decryption to \((C_1, C_2, \ldots, C_{n-1})\) with initialization vector \(\mathit{IV}\) and key \(K\) to produce \((P_1, P_2, \ldots P_{n-1})\).

4. \((C_1, C_2, \ldots, C_{n-1})\) に、初期化ベクトル \(\mathit{IV}\) と鍵 \(K\) を用いてCBC復号を適用し、\((P_1, P_2, \ldots P_{n-1})\) を生成します。

5. Let \(P_n^{*}=\mathrm{C}_{n-1}^{*}\oplus Z^{*}\).

5. \(P_n^{*}=\mathrm{C}_{n-1}^{*}\oplus Z^{*}\) とします。

6. Return \(P_1\parallel P_2\parallel\ldots\parallel P_{n-1}\parallel P_n^{*}\).

6. \(P_1\parallel P_2\parallel\ldots\parallel P_{n-1}\parallel P_n^{*}\) を返します。

When \(C_{n-1}^{*}\) is a complete block, CBC-CS1-Decrypt is equivalent to CBC decryption.

\(C_{n-1}^{*}\) が完全ブロックの場合、CBC-CS1-Decrypt はCBC復号と等価です。

Diagram: Figure 2 below illustrates the CBC-CS1-Decrypt algorithm for the case that \(C_{n-1}^{*}\) is a partial block, i.e., \(d<b\). As in the previous diagram, the bolded rectangles contain the inputs and outputs.

図:図2は、\(C_{n-1}^{*}\) が部分ブロック、すなわち \(d<b\) の場合のCBC-CS1-Decryptアルゴリズムを示します。前の図と同様に、太字の長方形は入力と出力を示します。

図表

図2:CBC-CS1-Decrypt。列ごとの CBC 復号である。C_1 は CIPH^-1_K を経て IV と排他的論理和(⊕)をとられ P_1 となる。C_2 は CIPH^-1_K を経て C_1 と排他的論理和をとられ P_2 となる。省略されたブロックは省略記号と点線で示され、C_(n-1) と P_(n-1) まで続く。最後の列では、C_n が CIPH^-1_K を経て Z* と Z** に分けられるブロックとなる。Z** は矢印で上端へ運ばれ、入力 C_(n-1)*(太枠)の後に付けられる。波括弧は C_(n-1)* と Z** を合わせたものが C_(n-1) となることを示し、これは上記のとおり復号される。Z* は、上端から線で運ばれた C_(n-1)* と排他的論理和をとられ、出力 P_n* となる。太枠の長方形は入力 IV、C_1、C_2、C_(n-1)*、C_n と出力 P_1、P_2、P_(n-1)、P_n* を表す。

Figure 2: CBC-CS1-Decrypt

図2:CBC-CS1-Decrypt

3 Specification of CBC-CS2

3 CBC-CS2の仕様

Algorithm: CBC-CS2-Encrypt

アルゴリズム:CBC-CS2-Encrypt

Input: plaintext \(P\), such that \(\operatorname{len}(P)\) is valid;
initialization vector \(\mathit{IV}\);
key \(K\).

入力:平文 \(P\)(ただし \(\operatorname{len}(P)\) が有効な長さであるもの);
初期化ベクトル \(\mathit{IV}\);
鍵 \(K\)。

Output: ciphertext \(C\), such that \(\operatorname{len}(C)=\operatorname{len}(P)\).

出力:暗号文 \(C\)(ただし \(\operatorname{len}(C)=\operatorname{len}(P)\) を満たすもの)。

手順:

1. Let \(n\) be the smallest integer such that \(n\cdot b\ge \operatorname{len}(P)\), let \(d=\operatorname{len}(P)-(n-1)\cdot b\), and let \(P_1, P_2, \ldots, P_{n-1}, P_n^{*}\) be the unique sequence of bit strings such that:
a) \(P=P_1\parallel P_2\parallel\ldots\parallel P_{n-1}\parallel P_n^{*}\); and
b) \(P_1, P_2, \ldots\) and \(P_{n-1}\) are complete blocks.
Consequently, \(\operatorname{len}(P_n^{*})=d\), and \(1\le d\le b\), so that \(P_n^{*}\) is either a complete block or a nonempty partial block.

1. \(n\) を \(n\cdot b\ge \operatorname{len}(P)\) を満たす最小の整数とし、\(d=\operatorname{len}(P)-(n-1)\cdot b\) とします。また、\(P_1, P_2, \ldots, P_{n-1}, P_n^{*}\) を、次を満たすビット列の一意な列とします。
a) \(P=P_1\parallel P_2\parallel\ldots\parallel P_{n-1}\parallel P_n^{*}\)。かつ
b) \(P_1, P_2, \ldots\) および \(P_{n-1}\) は完全ブロックです。
したがって、\(\operatorname{len}(P_n^{*})=d\) であり、\(1\le d\le b\) となるため、\(P_n^{*}\) は完全ブロックまたは空でない部分ブロックのいずれかです。

2. Apply CBC-CS1-Encrypt to the plaintext \(P\) with initialization vector \(\mathit{IV}\) and key \(K\) to produce \(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}^{*}\parallel C_n\).

2. 平文 \(P\) に、初期化ベクトル \(\mathit{IV}\) と鍵 \(K\) を用いてCBC-CS1-Encryptを適用し、\(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}^{*}\parallel C_n\) を生成します。

3. If \(d=b\), return \(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}^{*}\parallel C_n\); if \(d<b\), return \(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_n\parallel C_{n-1}^{*}\).

3. \(d=b\) の場合、\(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}^{*}\parallel C_n\) を返します。\(d<b\) の場合、\(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_n\parallel C_{n-1}^{*}\) を返します。

When \(P_n^{*}\) is a complete block, then CBC-CS2-Encrypt, like CBC-CS1-Encrypt, is equivalent to CBC encryption. When \(P_n^{*}\) is a partial block, then CBC-CS2-Encrypt and CBC-CS1-Encrypt differ only in the ordering of \(C_{n-1}^{*}\) and \(C_n\).

\(P_n^{*}\) が完全ブロックの場合、CBC-CS2-Encrypt はCBC-CS1-Encryptと同様にCBC暗号化と等価です。\(P_n^{*}\) が部分ブロックの場合、CBC-CS2-EncryptとCBC-CS1-Encryptの違いは、\(C_{n-1}^{*}\) と \(C_n\) の順序だけです。

Algorithm: CBC-CS2-Decrypt

アルゴリズム:CBC-CS2-Decrypt

Input: ciphertext \(C\), such that \(\operatorname{len}(C)\) is valid;
initialization vector \(\mathit{IV}\);
key \(K\).

入力:暗号文 \(C\)(ただし \(\operatorname{len}(C)\) が有効な長さであるもの);
初期化ベクトル \(\mathit{IV}\);
鍵 \(K\)。

Output: plaintext \(P\), such that \(\operatorname{len}(P)=\operatorname{len}(C)\).

出力:平文 \(P\)(ただし \(\operatorname{len}(P)=\operatorname{len}(C)\) を満たすもの)。

手順:

1. Let \(n\) be the smallest integer such that \(n\cdot b\ge \operatorname{len}(C)\), let \(d=\operatorname{len}(C)-(n-1)\cdot b\), and let \(C_1, C_2, \ldots, C_{n-2}, C_{n-1}, \mathrm{C}_n^{*}\) be the unique sequence of bit strings such that
a) \(C=C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}\parallel C_n^{*}\);
b) \(C_{n-1}\) is a complete block; and
c) If \(n>2\), then \(C_1,\ldots,C_{n-2}\), are complete blocks.
Consequently, \(\operatorname{len}(C_n^{*})=d\), and \(1\le d\le b\), so that \(C_n^{*}\) is either a complete block or a nonempty partial block.

1. \(n\) を \(n\cdot b\ge \operatorname{len}(C)\) を満たす最小の整数とし、\(d=\operatorname{len}(C)-(n-1)\cdot b\) とします。また、\(C_1, C_2, \ldots, C_{n-2}, C_{n-1}, \mathrm{C}_n^{*}\) を、次を満たすビット列の一意な列とします。
a) \(C=C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}\parallel C_n^{*}\)。
b) \(C_{n-1}\) は完全ブロックです。かつ
c) \(n>2\) の場合、\(C_1,\ldots,C_{n-2}\) は完全ブロックです。
したがって、\(\operatorname{len}(C_n^{*})=d\) であり、\(1\le d\le b\) となるため、\(C_n^{*}\) は完全ブロックまたは空でない部分ブロックのいずれかです。

2. If \(d=b\), i.e., \(C_n^{*}\) is a complete block, then apply CBC-CS1-Decrypt to \(C\) with initialization vector \(\mathit{IV}\) and key \(K\), and return the result, \(P\). STOP.

2. \(d=b\)、すなわち \(C_n^{*}\) が完全ブロックである場合、\(C\) に初期化ベクトル \(\mathit{IV}\) と鍵 \(K\) を用いてCBC-CS1-Decryptを適用し、その結果 \(P\) を返します。STOP。

3. If \(d<b\), i.e., \(C_n^{*}\) is a partial block, then let \(\mathrm{C}'=C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_n^{*}\parallel C_{n-1}\).

3. \(d<b\)、すなわち \(C_n^{*}\) が部分ブロックである場合、\(\mathrm{C}'=C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_n^{*}\parallel C_{n-1}\) とします。

4. Apply CBC-CS1-Decrypt to \(\mathrm{C}'\), and return the result, \(P\).

4. \(\mathrm{C}'\) にCBC-CS1-Decryptを適用し、その結果 \(P\) を返します。

Note that in Step 3, \(C_n^{*}\) precedes \(C_{n-1}\) in order to undo the corresponding swap within the ciphertext in Step 3 of CBC-CS2-Encrypt.

ステップ3で \(C_n^{*}\) を \(C_{n-1}\) より前に置くのは、CBC-CS2-Encryptのステップ3で行われた対応する暗号文の入れ替えを元に戻すためです。

4 Specification of CBC-CS3

4 CBC-CS3の仕様

Algorithm: CBC-CS3-Encrypt

アルゴリズム:CBC-CS3-Encrypt

Input: plaintext \(P\), such that \(\operatorname{len}(P)\) is valid; initialization vector \(\mathit{IV}\); key \(K\).

入力:平文 \(P\)(\(\operatorname{len}(P)\) が有効長であるもの);初期化ベクトル \(\mathit{IV}\);鍵 \(K\)。

Output: ciphertext \(C\), such that \(\operatorname{len}(C)=\operatorname{len}(P)\).

出力:暗号文 \(C\)(\(\operatorname{len}(C)=\operatorname{len}(P)\) を満たすもの)。

手順:

1. Apply CBC-CS1-Encrypt to the plaintext \(P\) with initialization vector \(\mathit{IV}\) and key \(K\) to produce \(C_1 \parallel C_2 \parallel \ldots \parallel C_{n-2} \parallel C_{n-1}^{*} \parallel C_n\).

1. 平文 \(P\) に、初期化ベクトル \(\mathit{IV}\) と鍵 \(K\) を用いてCBC-CS1-Encryptを適用し、\(C_1 \parallel C_2 \parallel \ldots \parallel C_{n-2} \parallel C_{n-1}^{*} \parallel C_n\) を生成します。

2. Return \(C_1 \parallel C_2 \parallel \ldots \parallel C_{n-2} \parallel C_n \parallel C_{n-1}^{*}\).

2. \(C_1 \parallel C_2 \parallel \ldots \parallel C_{n-2} \parallel C_n \parallel C_{n-1}^{*}\) を返します。

Note that in Step 2, \(C_{n-1}^{*}\) and \(C_n\) are unconditionally swapped, i.e., even when \(C_{n-1}^{*}\) is a complete block; therefore, CBC-CS3 is not strictly an extension of CBC mode. In the other case, i.e., when \(C_{n-1}^{*}\) is a nonempty partial block, CBC-CS3-Encrypt is equivalent to CBC-CS2-Encrypt.

ステップ2では、\(C_{n-1}^{*}\) と \(C_n\) を無条件に入れ替えます。すなわち、\(C_{n-1}^{*}\) が完全ブロックの場合も入れ替えるため、CBC-CS3はCBCモードの厳密な拡張ではありません。一方、\(C_{n-1}^{*}\) が空でない部分ブロックの場合、CBC-CS3-EncryptはCBC-CS2-Encryptと等価です。

Algorithm: CBC-CS3-Decrypt

アルゴリズム:CBC-CS3-Decrypt

Input: ciphertext \(C\), such that \(\operatorname{len}(C)\) is valid; initialization vector \(\mathit{IV}\); key \(K\).

入力:暗号文 \(C\)(\(\operatorname{len}(C)\) が有効長であるもの);初期化ベクトル \(\mathit{IV}\);鍵 \(K\)。

Output: plaintext \(P\), such that \(\operatorname{len}(P)=\operatorname{len}(C)\).

出力:平文 \(P\)(\(\operatorname{len}(P)=\operatorname{len}(C)\) を満たすもの)。

手順:

1. Let \(n\) be the smallest integer such that \(n\cdot b\ge\operatorname{len}(C)\), let \(d=\operatorname{len}(C)-(n-1)\cdot b\), and let \(C_1, C_2, \ldots, C_{n-2}, C_{n-1}, C_n^{*}\) be the unique sequence of bit strings such that a) \(C=C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}\parallel C_n^{*}\); b) \(C_{n-1}\) is a complete block; and c) If \(n>2\), then \(C_1,\ldots,C_{n-2}\), are complete blocks. Consequently, \(\operatorname{len}(C_n^{*})=d\), and \(1\le d\le b\), so that \(C_n^{*}\) is either a complete block or a nonempty partial block.

1. \(n\) を \(n\cdot b\ge\operatorname{len}(C)\) を満たす最小の整数とし、\(d=\operatorname{len}(C)-(n-1)\cdot b\) とします。また、次の条件を満たすビット列の一意な列 \(C_1, C_2, \ldots, C_{n-2}, C_{n-1}, C_n^{*}\) を定めます。a) \(C=C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_{n-1}\parallel C_n^{*}\)。b) \(C_{n-1}\) は完全ブロックです。c) \(n>2\) の場合、\(C_1,\ldots,C_{n-2}\) は完全ブロックです。したがって、\(\operatorname{len}(C_n^{*})=d\) であり、\(1\le d\le b\) となるため、\(C_n^{*}\) は完全ブロックまたは空でない部分ブロックです。

2. Apply the CBC-CS1-Decrypt algorithm with initialization vector \(\mathit{IV}\) and key \(K\) to \(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_n^{*}\parallel C_{n-1}\), and return the result, \(P\).

2. 初期化ベクトル \(\mathit{IV}\) と鍵 \(K\) を用い、\(C_1\parallel C_2\parallel\ldots\parallel C_{n-2}\parallel C_n^{*}\parallel C_{n-1}\) にCBC-CS1-Decryptアルゴリズムを適用し、その結果 \(P\) を返します。

Note that in Step 2, \(C_n^{*}\) precedes \(C_{n-1}\) in order to undo the corresponding swap that was performed within Step 2 of CBC-CS3-Encrypt.

ステップ2で \(C_n^{*}\) を \(C_{n-1}\) より前に置くのは、CBC-CS3-Encryptのステップ2で行われた対応する入れ替えを元に戻すためです。

References

参考文献

[1] Dworkin, M., NIST Special Publication 800-38A, 2001 Edition: Recommendation for Block Cipher Modes of Operation, Methods and Techniques, December 2001, Natl. Inst. Stand. Technol. [Web page], http://www.csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf.

[1] Dworkin, M., NIST Special Publication 800-38A, 2001 Edition: Recommendation for Block Cipher Modes of Operation, Methods and Techniques, 2001年12月、Natl. Inst. Stand. Technol. [Webページ], http://www.csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf.

[2] Raeburn, K., Request for Comments 3962: Advanced Encryption Standard (AES) Encryption for Kerberos 5, Internet Engineering Task Force, February 2005.

[2] Raeburn, K., Request for Comments 3962: Advanced Encryption Standard (AES) Encryption for Kerberos 5, Internet Engineering Task Force, 2005年2月。

[3] Schneier, B., Applied Cryptography, Second Edition: protocols, algorithms, and source code in C. New York: Wiley, 1996.

[3] Schneier, B., Applied Cryptography, Second Edition: protocols, algorithms, and source code in C. New York: Wiley, 1996.