Page 1 Seite 1
COMPUTER COMPUTER
SECURITY SICHERHEIT
Recommendation for Block Empfehlung für Block
Cipher Modes of Operation: Chiffre Betriebsmodi:
Three Variants of Ciphertext Drei Varianten der Chiffretext
Stealing for CBC Mode Stehlen für CBC-Modus
Morris Dworkin Morris Dworkin
Draft Addendum to Entwurf zur Ergänzung
NIST Special Publication 800-38A NIST Special Publication 800-38A
June, 2010 Juni 2010

Page 2 Seite 2

Page 3 Seite 3
Computer Security Division Computer Security Division
Information Technology Laboratory Laboratorium für Informationstechnologie
National Institute of Standards and Technology National Institute of Standards and Technology
Gaithersburg, MD 20899-8930 Gaithersburg, MD 20899-8930
June 2010 Juni 2010
US Department of Commerce US Department of Commerce
Gary Locke, Secretary Gary Locke, Sekretär
National Institute of Standards and Technology National Institute of Standards and Technology
Patrick Gallagher, Director Patrick Gallagher, Direktor
Draft Addendum to Entwurf zur Ergänzung
NIST Special Publication 800-38A NIST Special Publication 800-38A
Recommendation for Block Empfehlung für Block
Cipher Modes of Operation: Chiffre Betriebsmodi:
Three Variants of Ciphertext Drei Varianten der Chiffretext
Stealing for CBC Mode Stehlen für CBC-Modus
Morris Dworkin Morris Dworkin
COMPUTER COMPUTER
SECURITY SICHERHEIT

Page 4 Seite 4
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
Reports on Information Security Technology Berichte über Sicherheit in der Informationstechnik
The Information Technology Laboratory (ITL) at the National Institute of Standards and Technology Die Information Technology Laboratory (ITL) am National Institute of Standards and Technology
(NIST) promotes the US economy and public welfare by providing technical leadership for the Nation’s (NIST) fördert die US-Wirtschaft und der öffentlichen Wohlfahrt durch technische Führung für die Nation
measurement and standards infrastructure. Messung und Standards Infrastruktur. ITL develops tests, test methods, reference data, proof of ITL entwickelt Tests, Testmethoden, Referenzdaten, Nachweis der
concept implementations, and technical analyses to advance the development and productive use of Konzept Implementierungen und technische Analysen, die Entwicklung und den produktiven Einsatz von Advance
information technology. Informationstechnologie. ITL's responsibilities include the development of technical, physical, Verantwortlichkeiten ITL gehören die Entwicklung von technischen, physikalischen,
administrative, and management standards and guidelines for the cost-effective security and privacy of Verwaltung und Management-Standards und Richtlinien für die kostengünstige Sicherheit und Privatsphäre
sensitive unclassified information in Federal computer systems. sensible Informationen klassifiziert in Bundes Computer-Systeme. This Special Publication 800-series Diese Sonderveröffentlichung 800-Serie
reports on ITL's research, guidance, and outreach efforts in computer security, and its collaborative Berichte über Forschung, Beratung und weit reichende Anstrengungen ITL in Computer-Sicherheit, und ihre Zusammenarbeit
activities with industry, government, and academic organizations. Aktivitäten mit der Industrie, Regierung und akademischen Organisationen.
Certain commercial entities, equipment, or materials may be identified in this document in order Bestimmte gewerbliche Einrichtungen, Geräten oder Materialien können in diesem Dokument, um identifiziert werden
to describe an experimental procedure or concept adequately. eine experimentelle Verfahren oder Konzept adäquat zu beschreiben. Such identification is not intended Eine solche Identifizierung ist nicht beabsichtigt
to imply recommendation or endorsement by the National Institute of Standards and Technology, auf Empfehlung oder Billigung durch das National Institute of Standards and Technology implizieren,
nor is it intended to imply that the entities, materials, or equipment are necessarily the best noch ist es zu verstehen, dass die Einrichtungen, Materialien oder Ausrüstung notwendigerweise die besten
available for the purpose. zur Verfügung.
Addendum Nachtrag
National Institute of Standards and Technology Special Publication 800-38A National Institute of Standards and Technology Special Publication 800-38A
12 pages (June 2010) 12 Seiten (Juni 2010)
CODEN: NSPUE2 CODEN: NSPUE2

Page 5 Seite 5
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
Table of Contents Inhaltsverzeichnis
1 1
INTRODUCTION EINFÜHRUNG ..............................................................................................................................................1
2 2
SPECIFICATION OF CBC-CS1 TECHNISCHE DATEN DES CBC-CS1 ......................................................................................................................2
3 3
SPECIFICATION OF CBC-CS2 TECHNISCHE DATEN DES CBC-CS2 ......................................................................................................................4
4 4
SPECIFICATION OF CBC-CS3 TECHNISCHE DATEN DES CBC-CS3 ......................................................................................................................6
REFERENCES.............................................................................................................................................................8
List of Figures Liste der Abbildungen
Figure 1: Abbildung 1: CBC-CS1-Encrypt.......................................................................................................... 3 3
Figure 2: CBC-CS1-Decrypt Abbildung 2: CBC-CS1-Entschlüsseln ......................................................................................................... 4 4

Page 6 Seite 6
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A

Page 7 Seite 7
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
1 1
1 Introduction 1 Einleitung
A limitation to Cipher Block Chaining (CBC) mode, as specified in NIST SP 800-38A, Eine Beschränkung auf Cipher Block Chaining (CBC)-Modus, wie in NIST SP Tion 800-38A angegeben,
Ref. Ref. [1], is that the plaintext input must consist of a sequence of blocks. [1], ist, dass die Klartext-Eingangs müssen aus einer Folge von Blöcken bestehen. (In the rest of (Im übrigen
this publication, a block is called a “complete block” to emphasize the contrast with a Diese Publikation wird ein Block als "kompletten Block", um den Kontrast zu betonen, ein
“partial block” whose bit length is smaller than the block size.) Although Appendix A of "Teilblock", deren Bitlänge kleiner als die Blockgröße). Obwohl Anhang A
Ref. Ref. [1] describes how padding methods can be used to meet this requirement, in such [1] beschreibt, wie Polsterung Methoden können verwendet werden, um diese Anforderung zu erfüllen, so
cases, the length of the resulting ciphertext expands over the length of the unpadded Fällen wird die Länge der resultierenden Schlüsseltext erstreckt sich über die Länge des unpadded
plaintext by the number of padding bits. Klartext durch die Anzahl der Füllbits.
This addendum to Ref. Dieser Nachtrag zum ref. [1] specifies three variants of CBC mode that accept any plaintext [1] gibt drei Varianten der CBC-Modus, die jeden akzeptieren Klartext
input whose bit length is greater than or equal to the block size, whether or not the length Eingangs deren Bitlänge größer als oder gleich der Blockgröße, die der Länge oder nicht
is a multiple of the block size. ist ein Vielfaches der Blockgröße ist. Unlike the padding methods discussed in Ref. Im Gegensatz zu den Methoden in der Polsterung Ref diskutiert. [1], these [1] Diese
variants avoid ciphertext expansion. Varianten vermeiden Geheimtext Expansion.
These variants are denoted CBC-CS1, CBC-CS2, and CBC-CS3, where “CS” indicates Diese Varianten werden bezeichnet CBC-CS1, CBC-CS2, CS3 und CBC-, wobei "CS" zeigt
“ciphertext stealing,” because when padding bits are needed in these variants, they are "Ciphertext Stealing", denn wenn Polsterung Bits werden in diesen Varianten benötigt werden, sind sie
taken from the penultimate ciphertext block. aus der vorletzten Chiffretextblock entnommen. The variants differ only in the ordering of Die Varianten unterscheiden sich nur in der Reihenfolge der
the ciphertext bits. die Geheimtextbits. CBC-CS1 was specified as a suggestion on the NIST Computer CBC-CS1 wurde als Vorschlag auf der NIST-Computer angegeben
Security Resource Center web site. Security Resource Center-Website. CBC-CS2 is specified, for example, in Ref. CBC-CS2 angegeben wird, beispielsweise in der Referenz. [3]. [3].
CBC-CS3 is the variant specified for Kerberos 5 in Ref. CBC-CS3 ist die für Kerberos 5 in Ref angegebene Variante. [2]. [2].
Below are the specifications for encryption and decryption using CBC-CS1, CBC-CS2, Unten sind die Spezifikationen für die Verschlüsselung und Entschlüsselung mit CBC-CS1, CS2-CBC,
and CBC-CS3, building on the specification of the CBC encryption and decryption in und CBC-CS3, aufbauend auf der Spezifikation des CBC-Verschlüsselung und Entschlüsselung
Ref. Ref. [1]. [1]. Diagrams are given for CBC-CS1 encryption and decryption. Diagramme werden für CBC-CS1 Verschlüsselung und Entschlüsselung gegeben. Each variant Jede Variante
inherits the relevant requirements of Ref. erbt die einschlägigen Anforderungen der Ref. [1], eg, on the underlying block cipher, the [1], beispielsweise an der darunterliegenden Blockchiffre, die
key, and the initialization vector. Schlüssel und der Initialisierungsvektor.
The following notational conventions apply to the specifications below: Folgende Darstellungsmittel gelten für die folgenden Spezifikationen:
• Bit strings are denoted with upper case letters; • Bit Saiten werden mit Großbuchstaben bezeichnet; integers with lower case letters. Zahlen mit Kleinbuchstaben.
• The block size of the underlying block cipher is denoted b . • Die Blockgröße des zugrunde liegenden Blockchiffre bezeichnet b.
• For a bit string X , the bit length of X is denoted len( X ). • Für ein Bit-String X, wird das Bit Länge von X bezeichnet len (X).
• For a bit string X and a positive integer r that does not exceed len( X ), the string • Für ein Bit-String X und eine positive ganze Zahl r, die len (X) nicht übersteigt, wird die Zeichenfolge
consisting of the leftmost r bits of X is denoted MSB aus den am weitesten links r Bits von X bezeichnet ist MSB
r r
( X ), and the string consisting (X), und die Zeichenkette, die aus
of the rightmost r bits of X is denoted LSB der am weitesten rechts r Bits von X bezeichnet ist LSB
r r
( X ). (X).
• For an input block B and key K , the output block of the cipher function • Bei einem Eingangsblock B und Schlüssel K, der Ausgangsblock des Verschlüsselungsfunktion
(“encryption”) is denoted CIPH ("Verschlüsselung") bezeichnet wird CIPH
K K
( B ), and the output block of the inverse cipher (B), und der Ausgangsblock der inversen Verschlüsselungs
function (“decryption”) is denoted CIPH -Funktion ("Entschlüsselung") bezeichnet wird CIPH
-1 -1
K K
( B ). (B).
In principle, the input strings to encryption and decryption for each of the variants may be Im Prinzip können die Eingabezeichenfolgen Verschlüsselung und Entschlüsselung für jede der Varianten sein
any string whose length is not less than b bits, but typically an implementation is jede Zeichenfolge, deren Länge nicht kleiner als b bits, aber typischerweise eine Implementierung
designed to accept a restricted set of lengths. entwickelt, um einen eingeschränkten Satz von Längen annehmen. For example, the set of lengths may be Zum Beispiel kann der Satz von Längen

Page 8 Seite 8
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
2 2
restricted to multiples of 8, so that the input strings may be represented with bytes/octets. um ein Vielfaches von 8 beschränkt, so daß die Eingabezeichenfolgen können mit Bytes / Oktetts repräsentiert werden.
The input lengths that an implementation allows are called the valid lengths. Die Eingangslängen, dass eine Implementierung ermöglicht werden die gültigen Längen genannt.
2 Specification of CBC-CS1 2 Spezifikation der CBC-CS1
Algorithm: CBC-CS1-Encrypt Algorithmus: CBC-CS1-Verschlüsselung
Input : Input:
plaintext P , such that len( P ) is valid, including that len( P )≥ b ; Klartext P, so dass len (P) gilt, einschließlich len (P)b;
initialization vector IV ; Initialisierungsvektor IV;
key K . Schlüssel K.
Output : Ausgang:
ciphertext C , such that len( C )=len( P ). Chiffretext C, so dass len (C) = len (P).
Steps : Schritte aus:
1. 1.
Let n be the smallest integer such that nb ≥len( P ), let d= len( P )-( n -1)⋅ b , and let P Sei n die kleinste ganze Zahl, so dass nb ≥len (P), sei d = len (P) - (n-1)b, und P
1 1
, ,
P P
2 2
, … , P , ..., P
n -1 n -1
, P , P
n n
* *
be the unique sequence of bit strings such that: ist die eindeutige Folge von Bit-Strings, so dass:
a) a)
P = P P = P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n -1
|| P || P
n n
* *
; ; and und
b) b)
P P
1 1
, P , P
2 2
, … and P , ... Und P
n -1 n -1
are complete blocks. sind vollständig blockiert.
Consequently, len( P Folglich len (P
n n
* *
)= d , and 1≤ db , so that P ) = D, und 1≤ db, so daß P
n n
* *
is either a complete block or a ist entweder ein vollständiger Block oder
nonempty partial block. leere Teilblock.
2. 2.
If d = b , ie, P Wenn d = b, dh P
n n
* *
is a complete block, then ein vollständiger Block, dann
a) apply CBC encryption with initialization vector IV and key K to the a) gelten CBC-Verschlüsselung mit Initialisierungsvektor IV und Schlüssel K auf die
plaintext ( P Klartext (P
1 1
, P , P
2 2
, … P , ... P
n -1 n -1
, P , P
n n
* *
) to produce ( C ) Bis (C produzieren
1 1
, C , C
2 2
, … C , ... C
n -1 n -1
, C , C
n n
); );
b) b)
return C Rück C
1 1
|| C || C
2 2
|| … || C || ... || C
n -1 n -1
|| C || C
n n
. . STOP. Aufhören.
If d < b , ie, P Wenn d <b, dh P
n n
* *
is a partial block, go to Step 3. ist ein Teilblock, gehen Sie zu Schritt 3 fort.
3. 3.
Let PAD be the bit string consisting of bd '0' bits, and let P Lassen PAD die Bit-String, der aus bd "0"-Bits, und sei P
n n
= P = P
n n
* *
|| PAD . || PAD.
4. 4.
Apply CBC encryption to the plaintext ( P CBC-Verschlüsselung anwenden, um den Klartext (P
1 1
, P , P
2 2
, … P , ... P
n -1 n -1
, P , P
n n
) with initialization ) Mit Initialisierung
vector IV and key K to produce ( C Vektor-IV und Schlüssel K zu produzieren (C
1 1
, C , C
2 2
, … C , ... C
n -1 n -1
, C , C
n n
). ).
5. 5.
Let C Sei C
n -1 n -1
* *
= MSB = MSB
d d
( C (C
n -1 n -1
). ).
6. 6.
Return C Rück C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n -1 n -1
* *
|| C || C
n n
. .
Diagram : Figure 1 below illustrates the CBC-CS1-Encrypt algorithm for the case that Diagramm: Abbildung 1 veranschaulicht die CBC-CS1-Verschlüsselung-Algorithmus für den Fall, dass
d < b . d <b. The bolded rectangles contain the inputs and outputs. Die fett Rechtecke enthalten die Eingänge und Ausgänge. The dotted rectangles Die gestrichelten Rechtecke
provide alternate representations of two blocks in order to illustrate the role of the bieten alternative Darstellungen von zwei Blöcke, um die Rolle des zu veranschaulichen
“stolen” ciphertext. "Gestohlen" Geheimtext.
In particular, the string of the b - d rightmost bits of C Insbesondere die Zeichenfolge der b - d äußersten rechten Bits C
n -1 n -1
, denoted C , Bezeichnet C
n -1 n -1
** **
, becomes the , Wird der
padding for the input block to the final invocation of the block cipher. Polsterung für den Eingangsblock zum letzten Aufruf der Blockchiffre. The ciphertext Der Geheimtext
that is returned in Step 6 above omits C dass in Schritt 6 oben zurücklässt C
n -1 n -1
** **
, because it can be recovered from C , Da sie aus dem C zurückgewonnen werden
n n
during während
decryption. Entschlüsselung.

Page 9 Seite 9
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
3 3
Figure 1: CBC-CS1-Encrypt Abbildung 1: CBC-CS1-Verschlüsselung
Algorithm: CBC-CS1-Decrypt Algorithmus: CBC-CS1-Entschlüsseln
Input : Input:
ciphertext C , such that len( C ) is valid, including that len( C )≥ b ; Chiffretext C, so dass len (C) gilt, einschließlich len (C)b;
initialization vector IV ; Initialisierungsvektor IV;
key K . Schlüssel K.
Output : Ausgang:
plaintext P , such that len( P ) = len( C ). Klartext P, so dass len (P) = len (C).
Steps : Schritte aus:
1. 1.
Let n be the smallest integer such that nb ≥len( C ), let d= len( C )-( n -1)⋅ b , and let C Sei n die kleinste ganze Zahl, so dass nb ≥len (C), lassen d = len (C) - (n-1)b und sei C
1 1
, ,
C C
2 2
, … , C , ..., C
n -2 N -2
, C , C
n -1 n -1
* *
, C , C
n n
be the unique sequence of bit strings such that ist die eindeutige Folge von Bit-Strings, daß
a) a)
C = C C = C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n -1 n -1
* *
|| C || C
n n
; ;
b) b)
C C
n n
is a complete block; ein vollständiger Block; and und
c) c)
If n >2, then C Wenn n> 2, dann C
1, 1,
…, C ..., C
n -2 N -2
, are complete blocks. , Sind vollständig blockiert.
Consequently, len( C Folglich len (C
n -1 n -1
* *
)= d , and 1≤db , so that C ) = D und b1≤d, so dass C
n -1 n -1
* *
is either a complete block or ist entweder ein vollständiger Block oder
a nonempty partial block. eine nichtleere Teilblock.
2. 2.
If d = b , ie, C Wenn d = b, dh C
n -1 n -1
* *
is a complete block, then ein vollständiger Block, dann
a) a)
apply CBC decryption to ( C gelten CBC-Entschlüsselung (C
1 1
, C , C
2 2
, … , C , ..., C
n -2 N -2
, C , C
n -1 n -1
* *
, C , C
n n
) with ) Mit
initialization vector IV and key K to produce ( P Initialisierungsvektor IV und Schlüssel K zu produzieren (P
1 1
, P , P
2 2
, … P , ... P
n -1 n -1
, P , P
n n
); );
b) b)
return P Rück P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n -1
|| P || P
n n
. . STOP. Aufhören.
If d < b , ie, C Wenn d <b, dh C
n -1 n -1
* *
is a partial block, then go to Step 3. ist ein Teilblock, dann gehen Sie zu Schritt 3.
3. 3.
Let Z Sei Z
* *
=MSB = MSB
d d
(CIPH (CIPH
-1 -1
K K
( C (C
n n
)), and Z )) Und Z
** **
=LSB = LSB
b - d b - d
(CIPH (CIPH
-1 -1
K K
( C (C
n n
)). )).

Page 10 Seite 10
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
4 4
4. 4.
Let C Sei C
n -1 n -1
=C = C
n -1 n -1
* *
|| Z || Z
** **
. .
5. 5.
Apply CBC decryption to ( C Gelten CBC-Entschlüsselung (C
1 1
, C , C
2 2
, … , C , ..., C
n -1 n -1
) with initialization vector IV and key ) Mit Initialisierungsvektor IV und Schlüssel
K to produce ( P K zu produzieren (P
1 1
, P , P
2 2
, … P , ... P
n -1 n -1
). ).
6. 6.
Let P Sei P
n n
* *
=C = C
n -1 n -1
* *
Z Z
* *
. .
7. 7.
Return P Rück P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n -1
|| P || P
n n
* *
. .
Diagram : Diagramm:
Figure 2 below illustrates the CBC-CS1-Decrypt algorithm for the case that d < b . Abbildung 2 veranschaulicht die CBC-CS1-Entschlüsseln Algorithmus für den Fall, dass d <b. As in Wie in
the previous diagram, the bolded rectangles contain the inputs and outputs. der vorherige Plan, die fett Rechtecke enthalten die Eingänge und Ausgänge.
Figure 2: CBC-CS1-Decrypt Abbildung 2: CBC-CS1-Entschlüsseln
3 Specification of CBC-CS2 3 Spezifikation der CBC-CS2
Algorithm: CBC-CS2-Encrypt Algorithmus: CBC-CS2-Verschlüsselung
Input : Input:
plaintext P , such that len( P ) is valid, including that len( P )≥ b ; Klartext P, so dass len (P) gilt, einschließlich len (P)b;
initialization vector IV ; Initialisierungsvektor IV;
key K . Schlüssel K.
Output : Ausgang:
ciphertext C , such that len( C ) = len( P ). Chiffretext C, so dass len (C) = len (P).
P P
1 1
C C
1 1
P P
2 2
C C
2 2
P P
n -1 n -1
C C
n n
IV IV
CIPH CIPH
-1 -1
K K
CIPH CIPH
-1 -1
K K
CIPH CIPH
-1 -1
K K
...
C C
n -1 n -1
Z Z
** **
C C
n -1 n -1
* *
P P
n n
* *
CIPH CIPH
-1 -1
K K
Z Z
* *
Z Z
** **

Page 11 Seite 11
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
5 5
Steps : Schritte aus:
1. 1.
Let n be the smallest integer such that nb ≥len( P ), let d= len( P )-( n -1)⋅ b , and let P Sei n die kleinste ganze Zahl, so dass nb ≥len (P), sei d = len (P) - (n-1)b, und P
1 1
, ,
P P
2 2
, … , P , ..., P
n -1 n -1
, P , P
n n
* *
be the unique sequence of bit strings such that: ist die eindeutige Folge von Bit-Strings, so dass:
a) a)
P = P P = P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n -1
|| P || P
n n
* *
; ; and und
b) b)
P P
1 1
, P , P
2 2
, … and P , ... Und P
n -1 n -1
are complete blocks. sind vollständig blockiert.
Consequently, len( P Folglich len (P
n n
* *
)= d , and 1≤ db , so that P ) = D, und 1≤ db, so daß P
n n
* *
is either a complete block or a ist entweder ein vollständiger Block oder
nonempty partial block. leere Teilblock.
2. 2.
If d = b , ie, P Wenn d = b, dh P
n n
* *
is a complete block, then ein vollständiger Block, dann
a) apply CBC encryption with initialization vector IV and key K to the a) gelten CBC-Verschlüsselung mit Initialisierungsvektor IV und Schlüssel K auf die
plaintext ( P Klartext (P
1 1
, P , P
2 2
, … P , ... P
n -1 n -1
, P , P
n n
* *
) to produce ( C ) Bis (C produzieren
1 1
, C , C
2 2
, … C , ... C
n -1 n -1
, C , C
n n
); );
b) b)
return C Rück C
1 1
|| C || C
2 2
||… C || ... C
n -1 n -1
|| C || C
n n
. . STOP. Aufhören.
If d < b , ie, P Wenn d <b, dh P
n n
* *
is a partial block, go to Step 3. ist ein Teilblock, gehen Sie zu Schritt 3 fort.
3. 3.
Let PAD be the bit string consisting of bd '0' bits, and let P Lassen PAD die Bit-String, der aus bd "0"-Bits, und sei P
n n
=P = P
n n
* *
|| PAD . || PAD.
4. 4.
Apply CBC encryption to the plaintext ( P CBC-Verschlüsselung anwenden, um den Klartext (P
1 1
, P , P
2 2
, … P , ... P
n -1 n -1
, P , P
n n
) with initialization ) Mit Initialisierung
vector IV and key K to produce ( C Vektor-IV und Schlüssel K zu produzieren (C
1 1
, C , C
2 2
, … C , ... C
n -1 n -1
, C , C
n n
). ).
5. 5.
Let C Sei C
n -1 n -1
* *
=MSB = MSB
d d
( C (C
n -1 n -1
). ).
6. 6.
Return C Rück C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n n
|| C || C
n -1 n -1
* *
. .
Note that the output in Step 6 of CBC-CS2-Encrypt is almost identical to the output in Man beachte, dass der Ausgang in Schritt 6 von CBC-CS2-Verschlüsselung ist fast identisch mit dem Ausgang in
Step 6 of CBC-CS1-Encrypt. Schritt 6 von CBC-CS1-Verschlüsseln. The only difference is the ordering of the final b + d bits; Der einzige Unterschied ist die Anordnung der endgültigen b + d Bits; in in
particular, C insbesondere C
n n
precedes C voraus C
n -1 n -1
* *
instead of following it. statt danach.
Algorithm: CBC-CS2-Decrypt Algorithmus: CBC-CS2-Entschlüsseln
Input : Input:
ciphertext C , such that len( C ) is valid, including that len( C )≥ b ; Chiffretext C, so dass len (C) gilt, einschließlich len (C)b;
initialization vector IV ; Initialisierungsvektor IV;
key K . Schlüssel K.
Output : Ausgang:
plaintext P , such that len( P )=len( C ). Klartext P, so dass len (P) = len (C).
Steps : Schritte aus:
1. 1.
Let n be the smallest integer such that nb ≥len( C ), let d= len( C )-( n -1)⋅ b , and let C Sei n die kleinste ganze Zahl, so dass nb ≥len (C), lassen d = len (C) - (n-1)b und sei C
1 1
, ,
C C
2 2
, … , C , ..., C
n -2 N -2
, C , C
n -1 n -1
, C , C
n n
* *
be the unique sequence of bit strings such that ist die eindeutige Folge von Bit-Strings, daß
a) a)
C = C C = C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n -1 n -1
|| C || C
n n
* *
; ;
b) b)
C C
n -1 n -1
is a complete block; ein vollständiger Block; and und
c) c)
If n >2, then C Wenn n> 2, dann C
1, 1,
…, C ..., C
n -2 N -2
, are complete blocks. , Sind vollständig blockiert.
Consequently, len( C Folglich len (C
n n
* *
)= d , and 1 ≤ db , so that C ) = D und 1 ≤ db, so dass C
n n
* *
is either a complete block or ist entweder ein vollständiger Block oder
a nonempty partial block. eine nichtleere Teilblock.

Page 12 Seite 12
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
6 6
2. 2.
If d = b , ie, C Wenn d = b, dh C
n n
* *
is a complete block, then ein vollständiger Block, dann
a) a)
apply CBC decryption to ( C gelten CBC-Entschlüsselung (C
1 1
, C , C
2 2
, … , C , ..., C
n -1 n -1
, C , C
n n
* *
) with initialization ) Mit Initialisierung
vector IV and key K to produce ( P Vektor-IV und Schlüssel K zu produzieren (P
1 1
, P , P
2 2
, … , P , ..., P
n -1 n -1
, P , P
n n
); );
b) b)
return P Rück P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n -1
|| P || P
n n
. . STOP. Aufhören.
If d < b , ie, C Wenn d <b, dh C
n n
* *
is a partial block, then go to Step 3. ist ein Teilblock, dann gehen Sie zu Schritt 3.
3. 3.
Apply Steps 3-6 of CBC-CS1-Decrypt to C Gelten die Schritte 3-6 des CBC-CS1-Entschlüsseln nach C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n n
* *
|| C || C
n -1 n -1
to return P P zurück
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n -1
|| P || P
n n
* *
. .
Note that in Step 3, C Beachten Sie, dass in Schritt 3, C
n n
* *
precedes C voraus C
n -1 n -1
in order to undo the corresponding swap within the , um den entsprechenden Swap-in der Undo-
ciphertext in Step 6 of CBC-CS2-Encrypt. Chiffretext in Schritt 6 von CBC-CS2-Verschlüsseln.
4 Specification of CBC-CS3 4 Spezifikation der CBC-CS3
Algorithm: CBC-CS3-Encrypt Algorithmus: CBC-CS3-Verschlüsselung
Input : Input:
plaintext P , such that len( P ) is valid, including that len( P )≥ b ; Klartext P, so dass len (P) gilt, einschließlich len (P)b;
initialization vector IV ; Initialisierungsvektor IV;
key K . Schlüssel K.
Output : Ausgang:
ciphertext C , such that len( C )=len( P ). Chiffretext C, so dass len (C) = len (P).
Steps : Schritte aus:
1. 1.
Let n be the smallest integer such that nb ≥len( P ), let d= len( P )-( n -1)⋅ b , and let P Sei n die kleinste ganze Zahl, so dass nb ≥len (P), sei d = len (P) - (n-1)b, und P
1 1
, ,
P P
2 2
, … , P , ..., P
n -1 n -1
, P , P
n n
* *
be the unique sequence of bit strings such that: ist die eindeutige Folge von Bit-Strings, so dass:
a) a)
P = P P = P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n -1
|| P || P
n n
* *
; ; and und
b) b)
P P
1 1
, P , P
2 2
, … and P , ... Und P
n -1 n -1
are complete blocks. sind vollständig blockiert.
Consequently, len( P Folglich len (P
n n
* *
)= d , and 1≤ db , so that P ) = D, und 1≤ db, so daß P
n n
* *
is either a complete block or a ist entweder ein vollständiger Block oder
nonempty partial block. leere Teilblock.
2. 2.
If d = b , ie, P Wenn d = b, dh P
n n
* *
is a complete block, then ein vollständiger Block, dann
a) apply CBC encryption with initialization vector IV and key K to the a) gelten CBC-Verschlüsselung mit Initialisierungsvektor IV und Schlüssel K auf die
plaintext ( P Klartext (P
1 1
, P , P
2 2
, … P , ... P
n -1 n -1
, P , P
n n
* *
) to produce ( C ) Bis (C produzieren
1 1
, C , C
2 2
, … C , ... C
n -1 n -1
, C , C
n n
); );
b) b)
return C Rück C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n n
|| C || C
n -1 n -1
. . STOP. Aufhören.
If d < b , ie, P Wenn d <b, dh P
n n
* *
is a partial block, go to Step 3. ist ein Teilblock, gehen Sie zu Schritt 3 fort.
3. 3.
Let PAD be the bit string consisting of bd '0' bits, and let P Lassen PAD die Bit-String, der aus bd "0"-Bits, und sei P
n n
=P = P
n n
* *
|| PAD . || PAD.
4. 4.
Apply CBC encryption to the plaintext ( P CBC-Verschlüsselung anwenden, um den Klartext (P
1 1
, P , P
2 2
, … P , ... P
n -1 n -1
, P , P
n n
) with initialization ) Mit Initialisierung
vector IV and key K to produce ( C Vektor-IV und Schlüssel K zu produzieren (C
1 1
, C , C
2 2
, … C , ... C
n -1 n -1
, C , C
n n
). ).
5. 5.
Let C Sei C
n -1 n -1
* *
=MSB = MSB
d d
( C (C
n -1 n -1
). ).
6. 6.
Return C Rück C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n n
|| C || C
n -1 n -1
* *
. .

Page 13 Seite 13
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
7 7
Note that in Step 6 of CBC-CS3-Encrypt, as in CBC-CS2-Encrypt, the positions of C Beachten Sie, dass in Schritt 6 von CBC-CS3-Verschlüsselung, wie in CBC-CS2-Verschlüsselung, die Positionen der C
n -1 n -1
* *
and C und C
n n
are swapped in comparison to Step 6 of CBC-CS1-Encrypt. im Vergleich vertauscht mit Schritt 6 von CBC-CS1-Verschlüsseln. For CBC-CS3- Für CBC-CS3-
Encrypt, the analogous swap also occurs in the case that P Verschlüsseln, tritt die analoge Swap auch in dem Fall, dass P
n n
* *
is a complete block. ein vollständiger Block. In In
particular, within the output of Step 2 for CBC-CS3-Encrypt, C Insbesondere im Rahmen der Ausgabe von Schritt 2 für CBC-CS3-Verschlüsselung, C
n n
precedes C voraus C
n -1 n -1
, in contrast , Im Gegensatz
to the output of Step 2 for CBC-CS1-Encrypt and CBC-CS2-encrypt, where C mit dem Ausgang des 2. Schritt für CBC-CS1-CBC-Verschlüsselung und CS2 zu verschlüsseln, wobei C
n n
follows folgt
C C
n -1 n -1
. .
Algorithm: CBC-CS3-Decrypt Algorithmus: CBC-CS3-Entschlüsseln
Input : Input:
ciphertext C , such that len( C ) is valid, including that len( C )≥ b ; Chiffretext C, so dass len (C) gilt, einschließlich len (C)b;
initialization vector IV ; Initialisierungsvektor IV;
key K . Schlüssel K.
Output : Ausgang:
plaintext P , such that len( P )=len( C ). Klartext P, so dass len (P) = len (C).
Steps : Schritte aus:
1. 1.
Let n be the smallest integer such that nb ≥len( C ), let d= len( C )-( n -1)⋅ b , and let C Sei n die kleinste ganze Zahl, so dass nb ≥len (C), lassen d = len (C) - (n-1)b und sei C
1 1
, ,
C C
2 2
, … , C , ..., C
n -2 N -2
, C , C
n -1 n -1
, C , C
n n
* *
be the unique sequence of bit strings such that ist die eindeutige Folge von Bit-Strings, daß
a) a)
C = C C = C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n -1 n -1
|| C || C
n n
* *
; ;
b) b)
C C
n -1 n -1
is a complete block; ein vollständiger Block; and und
c) c)
If n >2, then C Wenn n> 2, dann C
1, 1,
…, C ..., C
n -2 N -2
, are complete blocks. , Sind vollständig blockiert.
Consequently, len( C Folglich len (C
n n
* *
)= d , and 1≤db , so that C ) = D und b1≤d, so dass C
n n
* *
is either a complete block or a ist entweder ein vollständiger Block oder
nonempty partial block. leere Teilblock.
2. 2.
Apply the CBC-CS1-Decrypt algorithm with initialization vector IV and key K to Übernehmen Sie die CBC-CS1-Entschlüsseln-Algorithmus mit Initialisierungsvektor IV und Schlüssel K zu
C C
1 1
|| C || C
2 2
||… || C || ... || C
n -2 N -2
|| C || C
n n
* *
|| C || C
n -1 n -1
to return P P zurück
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n -1
|| P || P
n n
* *
. .
Note that in Step 2, C Beachten Sie, dass in Schritt 2, C
n n
* *
precedes C voraus C
n -1 n -1
in order to undo the corresponding swaps within the um die entsprechenden Swaps innerhalb der rückgängig machen
ciphertexts in Steps 2b and 6 of CBS-CS3-Encrypt. Geheimtexte in den Schritten 2b und 6 der CBS-CS3-Verschlüsseln.

Page 14 Seite 14
Draft Addendum to NIST Special Publication 800-38A Entwurf zur Ergänzung NIST Special Publication 800-38A
8 8
References Referenzen
[1] [1]
Dworkin, M., NIST Special Publication 800-38A, 2001 Edition : Recommendation Dworkin, M., NIST Special Publication 800-38A, Ausgabe 2001: Empfehlung
for Block Cipher Modes of Operation, Methods and Techniques , December 2001, für Block Cipher Betriebsarten, Methoden und Techniken, Dezember 2001
Natl. Natl. Inst. Inst. Stand. Stehen. Technol. Technol. [Web page], http://www.csrc.nist.gov/publications/ [Web-Seite], http://www.csrc.nist.gov/publications/
nistpubs/800-38a/sp800-38a.pdf . nistpubs / Tion 800-38A / sp800-38a.pdf.
[2] [2]
Raeburn, K., Request for Comments 3962 : Advanced Encryption Standard (AES) Raeburn, K., Request for Comments 3962: Advanced Encryption Standard (AES)
Encryption for Kerberos 5 , Internet Engineering Task Force, February 2005. Verschlüsselung für Kerberos 5, Internet Engineering Task Force, im Februar 2005.
[3] [3]
Schneier, B., Applied Cryptography, Second Edition: protocols, algorithms, and Schneier, B., Applied Cryptography, Second Edition: Protokolle, Algorithmen und
source code in C. Source-Code in C New York: Wiley, 1996. New York: Wiley, 1996.