COMPUTER INFORMATIQUE
SECURITY SÉCURITÉ
Recommendation for Block Recommandation pour le bloc
Cipher Modes of Operation: Cipher modes de fonctionnement:
Three Variants of Ciphertext Trois variantes de cryptogramme
Stealing for CBC Mode Voler pour le mode CBC
Morris Dworkin Morris Dworkin
Draft Addendum to Projet Addendum
NIST Special Publication 800-38A NIST spécial 800-38A de publication
June, 2010 Juin 2010
Computer Security Division Division de la sécurité informatique
Information Technology Laboratory Laboratoire de la technologie de l'information
National Institute of Standards and Technology Institut National des Standards et de la Technologie
Gaithersburg, MD 20899-8930 Gaithersburg, MD 20899-8930
June 2010 Juin 2010
US Department of Commerce US Department of Commerce
Gary Locke, Secretary Gary Locke, secrétaire
National Institute of Standards and Technology Institut National des Standards et de la Technologie
Patrick Gallagher, Director Patrick Gallagher, directeur
Draft Addendum to Projet Addendum
NIST Special Publication 800-38A NIST spécial 800-38A de publication
Recommendation for Block Recommandation pour le bloc
Cipher Modes of Operation: Cipher modes de fonctionnement:
Three Variants of Ciphertext Trois variantes de cryptogramme
Stealing for CBC Mode Voler pour le mode CBC
Morris Dworkin Morris Dworkin
COMPUTER INFORMATIQUE
SECURITY SÉCURITÉ
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
Reports on Information Security Technology Rapports sur la sécurité des technologies de l'information
The Information Technology Laboratory (ITL) at the National Institute of Standards and Technology Le Laboratoire de la technologie de l'information (ITL) à l'Institut National des Standards et de la Technologie
(NIST) promotes the US economy and public welfare by providing technical leadership for the Nation’s (NIST) favorise l'économie américaine et le bien-être du public en fournissant un leadership technique pour la Nation de
measurement and standards infrastructure. mesure et des normes infrastructure. ITL develops tests, test methods, reference data, proof of ITL développe des tests, méthodes d'essai, les données de référence, la preuve de
concept implementations, and technical analyses to advance the development and productive use of implémentations de concept, et les analyses techniques pour faire avancer le développement et l'utilisation productive de
information technology. technologies de l'information. ITL's responsibilities include the development of technical, physical, Les responsabilités de ITL comprennent le développement de techniques, physiques,
administrative, and management standards and guidelines for the cost-effective security and privacy of et les normes et les lignes directrices de la gestion administrative pour la sécurité économique et la confidentialité des
sensitive unclassified information in Federal computer systems. informations non classés sensibles dans les systèmes fédéraux informatiques. This Special Publication 800-series Cette publication spéciale 800-série
reports on ITL's research, guidance, and outreach efforts in computer security, and its collaborative des rapports sur la recherche, l'orientation, et les efforts de sensibilisation de ITL en sécurité informatique, et sa collaboration
activities with industry, government, and academic organizations. activités avec l'industrie, le gouvernement et les organisations universitaires.
Certain commercial entities, equipment, or materials may be identified in this document in order Certaines entités commerciales, des équipements ou matériaux peuvent être identifiées dans le présent document pour
to describe an experimental procedure or concept adequately. pour décrire une procédure expérimentale ou d'un concept de manière adéquate. Such identification is not intended Cette identification n'est pas destiné
to imply recommendation or endorsement by the National Institute of Standards and Technology, impliquer recommandation ou une approbation par l'Institut National des Standards et de la Technologie,
nor is it intended to imply that the entities, materials, or equipment are necessarily the best et ne vise pas à laisser entendre que l'entités, des matériaux ou des équipements ne sont pas nécessairement le meilleur
available for the purpose. disponible à cet effet.
Addendum Addenda
National Institute of Standards and Technology Special Publication 800-38A Institut National des Standards et de la technologie spéciale 800-38A de publication
12 pages (June 2010) 12 pages (juin 2010)
CODEN: NSPUE2 CODEN: NSPUE2
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
Table of Contents Table des matières
1 1
INTRODUCTION INTRODUCTION ..............................................................................................................................................1
2 2
SPECIFICATION OF CBC-CS1 CARACTÉRISTIQUES DE CBC-CS1 ......................................................................................................................2
3 3
SPECIFICATION OF CBC-CS2 CARACTÉRISTIQUES DE CBC-CS2 ......................................................................................................................4
4 4
SPECIFICATION OF CBC-CS3 CARACTÉRISTIQUES DE CBC-CS3 ......................................................................................................................6
REFERENCES.............................................................................................................................................................8
List of Figures Liste des figures
Figure 1: Figure 1: CBC-CS1-Encrypt.......................................................................................................... 3 3
Figure 2: CBC-CS1-Decrypt Figure 2: CBC-CS1-Décrypter ......................................................................................................... 4 4
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
1 1
1 Introduction 1 Introduction
A limitation to Cipher Block Chaining (CBC) mode, as specified in NIST SP 800-38A, Une limitation au mode Cipher Block Chaining (CBC), tel que spécifié dans NIST SP 800-38A,
Ref. Ref. [1], is that the plaintext input must consist of a sequence of blocks. [1], est que l'entrée de texte en clair doit être composé d'une séquence de blocs. (In the rest of (Dans le reste du
this publication, a block is called a “complete block” to emphasize the contrast with a cette publication, un bloc est appelé un "bloc complet» pour souligner le contraste avec un
“partial block” whose bit length is smaller than the block size.) Although Appendix A of "Blocage partiel", dont la longueur de bits est inférieure à la taille du bloc.) Bien que l'annexe A de
Ref. Ref. [1] describes how padding methods can be used to meet this requirement, in such [1] décrit comment les méthodes de remplissage peuvent être utilisés pour satisfaire à cette exigence, dans un tel
cases, the length of the resulting ciphertext expands over the length of the unpadded cas, la longueur du texte chiffré résultant se dilate sur toute la longueur de la non rembourré
plaintext by the number of padding bits. texte en clair par le nombre de bits de remplissage.
This addendum to Ref. Cet addendum à Réf. [1] specifies three variants of CBC mode that accept any plaintext [1] spécifie trois variantes du mode CBC qui acceptent n'importe quel texte en clair
input whose bit length is greater than or equal to the block size, whether or not the length entrée dont la longueur binaire est supérieure ou égale à la taille de bloc, si la longueur ou non
is a multiple of the block size. est un multiple de la taille de bloc. Unlike the padding methods discussed in Ref. Contrairement aux méthodes de remplissage abordés dans Réf. [1], these [1], ceux-ci
variants avoid ciphertext expansion. éviter l'expansion des variantes de texte chiffré.
These variants are denoted CBC-CS1, CBC-CS2, and CBC-CS3, where “CS” indicates Ces variantes sont désignées CBC-CS1, CS2 CBC-et CBC-CS3, où «CS» indique
“ciphertext stealing,” because when padding bits are needed in these variants, they are "Chiffré vol," parce que quand bits de remplissage sont nécessaires dans ces variantes, ils sont
taken from the penultimate ciphertext block. pris dans le bloc de texte chiffré avant-dernière. The variants differ only in the ordering of Les variantes diffèrent que par la commande de
the ciphertext bits. les bits de texte chiffré. CBC-CS1 was specified as a suggestion on the NIST Computer CBC-CS1 a été spécifiée comme une suggestion sur l'ordinateur NIST
Security Resource Center web site. Security Resource Center du site Web. CBC-CS2 is specified, for example, in Ref. SRC-CS2 est spécifiée, par exemple, dans la réf. [3]. [3].
CBC-CS3 is the variant specified for Kerberos 5 in Ref. CBC-CS3 est la variante spécifiée pour Kerberos 5 Ref. [2]. [2].
Below are the specifications for encryption and decryption using CBC-CS1, CBC-CS2, Voici les spécifications pour le chiffrement et le déchiffrement utilisant CBC-CS1, CS2 CBC-,
and CBC-CS3, building on the specification of the CBC encryption and decryption in et CBC-CS3, en s'appuyant sur la spécification du chiffrement CBC et décryptage
Ref. Ref. [1]. [1]. Diagrams are given for CBC-CS1 encryption and decryption. Les schémas sont donnés pour le chiffrement CBC-CS1 et le décryptage. Each variant Chaque variante
inherits the relevant requirements of Ref. hérite des prescriptions pertinentes de la Réf. [1], eg, on the underlying block cipher, the [1], par exemple, l'algorithme de chiffrement de bloc sous-jacent, la
key, and the initialization vector. clé, et le vecteur d'initialisation.
The following notational conventions apply to the specifications below: Les conventions de notation suivantes s'appliquent aux spécifications ci-dessous:
• Bit strings are denoted with upper case letters; • Les chaînes de bits sont désignées par des lettres majuscules; integers with lower case letters. des nombres entiers avec des lettres minuscules.
• The block size of the underlying block cipher is denoted b . • La taille de blocs d'un chiffrement de bloc sous-jacent est noté b.
• For a bit string X , the bit length of X is denoted len( X ). • Pour une chaîne de bits X, la longueur de bit de X est notée len (X).
• For a bit string X and a positive integer r that does not exceed len( X ), the string • Pour obtenir une chaîne de bits X et r un nombre entier positif ne dépassant pas len (X), la chaîne
consisting of the leftmost r bits of X is denoted MSB constitué des bits de gauche r de X est notée MSB
r r
( X ), and the string consisting (X), et la chaîne composée
of the rightmost r bits of X is denoted LSB des r bits les plus à droite de X est noté LSB
r r
( X ). (X).
• For an input block B and key K , the output block of the cipher function • Pour un bloc d'entrée B et de la clé K, le bloc de sortie de la fonction de chiffrement
(“encryption”) is denoted CIPH ("Cryptage") est notée ICPC
K K
( B ), and the output block of the inverse cipher (B), et le bloc de sortie de l'algorithme de chiffrement inverse
function (“decryption”) is denoted CIPH fonction («décryptage») est notée ICPC
-1 -1
K K
( B ). (B).
In principle, the input strings to encryption and decryption for each of the variants may be En principe, les chaînes d'entrée pour le chiffrement et le déchiffrement de chacune des variantes peuvent être
any string whose length is not less than b bits, but typically an implementation is une chaîne dont la longueur est d'au moins b bits, mais en général, une mise en œuvre est
designed to accept a restricted set of lengths. conçue pour recevoir un ensemble restreint de longueurs. For example, the set of lengths may be Par exemple, l'ensemble des longueurs peut être
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
2 2
restricted to multiples of 8, so that the input strings may be represented with bytes/octets. limité à des multiples de 8, de sorte que les chaînes d'entrée peuvent être représentés par octets / octets.
The input lengths that an implementation allows are called the valid lengths. L'entrée des longueurs qui permet une mise en oeuvre que l'on appelle les longueurs valides.
2 Specification of CBC-CS1 2 Spécification de CBC-CS1
Algorithm: CBC-CS1-Encrypt Algorithme: CBC-CS1-Encrypt
Input : Entrée:
plaintext P , such that len( P ) is valid, including that len( P )≥ b ; clair P, tels que len (P) est valable, y compris len (P) ≥ b;
initialization vector IV ; vecteur d'initialisation IV;
key K . clé K.
Output : Sortie:
ciphertext C , such that len( C )=len( P ). le texte chiffré C, de telle sorte que len (C) = len (P).
Steps : Étapes:
1. 1.
Let n be the smallest integer such that n ⋅ b ≥len( P ), let d= len( P )-( n -1)⋅ b , and let P Soit n le plus petit entier tel que n ⋅ b ≥len (P), laissez d = len (P) - (n-1) ⋅ b, et soit 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: la séquence unique de chaînes de bits de telle sorte que:
a) a)
P = P P = P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n-1
|| P || P
n n
* *
; ; and et
b) b)
P P
1 1
, P , P
2 2
, … and P , ... Et P
n -1 n-1
are complete blocks. sont des blocs complets.
Consequently, len( P Par conséquent, len (P
n n
* *
)= d , and 1≤ d ≤ b , so that P ) = D, et d 1≤ ≤ b, de sorte que P
n n
* *
is either a complete block or a est soit un bloc complet ou un
nonempty partial block. bloc partiel non vide.
2. 2.
If d = b , ie, P Si D = b, c'est-à-P
n n
* *
is a complete block, then est un bloc complet, alors
a) apply CBC encryption with initialization vector IV and key K to the a) appliquer le cryptage CBC avec un vecteur d'initialisation IV et la clé K à la
plaintext ( P clair (P
1 1
, P , P
2 2
, … P , ... P
n -1 n-1
, P , P
n n
* *
) to produce ( C ) Pour produire (C
1 1
, C , C
2 2
, … C , ... C
n -1 n-1
, C , C
n n
); );
b) b)
return C retour C
1 1
|| C || C
2 2
|| … || C || ... || C
n -1 n-1
|| C || C
n n
. . STOP. Arrêtez.
If d < b , ie, P Si d <b, c'est-à-P
n n
* *
is a partial block, go to Step 3. est un bloc partiel, passez à l'étape 3.
3. 3.
Let PAD be the bit string consisting of bd '0' bits, and let P Laissez PAD être la chaîne de bits composée de "0" les bits bd, et P
n n
= P = P
n n
* *
|| PAD . || PAD.
4. 4.
Apply CBC encryption to the plaintext ( P Appliquer chiffrement CBC au texte en clair (P
1 1
, P , P
2 2
, … P , ... P
n -1 n-1
, P , P
n n
) with initialization ) À l'initialisation
vector IV and key K to produce ( C vecteur IV et la clé K pour produire (C
1 1
, C , C
2 2
, … C , ... C
n -1 n-1
, C , C
n n
). ).
5. 5.
Let C Soit C
n -1 n-1
* *
= MSB = MSB
d ré
( C (C
n -1 n-1
). ).
6. 6.
Return C Retour 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 Schéma: la figure 1 ci-dessous illustre l'algorithme CBC-CS1-Encrypt pour le cas où
d < b . d <b. The bolded rectangles contain the inputs and outputs. Les rectangles en gras contiennent les entrées et les sorties. The dotted rectangles Les rectangles en pointillés
provide alternate representations of two blocks in order to illustrate the role of the fournir des représentations alternatives de deux blocs de façon à illustrer le rôle de l'
“stolen” ciphertext. Chiffré "volé".
In particular, the string of the b - d rightmost bits of C En particulier, la chaîne de la b - d bits les plus à droite de C
n -1 n-1
, denoted C , Notée C
n -1 n-1
** **
, becomes the , Devient l'
padding for the input block to the final invocation of the block cipher. Rembourrage pour le bloc d'entrée à l'invocation finale du bloc de chiffrement. The ciphertext Le cryptogramme
that is returned in Step 6 above omits C qui est retourné à l'étape 6 ci-dessus omet C
n -1 n-1
** **
, because it can be recovered from C , Car il peut être récupéré à partir de C
n n
during pendant
decryption. décryptage.
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
3 3
Figure 1: CBC-CS1-Encrypt Figure 1: CBC-CS1-Encrypt
Algorithm: CBC-CS1-Decrypt Algorithme: CBC-CS1-Décrypter
Input : Entrée:
ciphertext C , such that len( C ) is valid, including that len( C )≥ b ; le texte chiffré C, de telle sorte que len (C) est valable, y compris que len (C) ≥ b;
initialization vector IV ; vecteur d'initialisation IV;
key K . clé K.
Output : Sortie:
plaintext P , such that len( P ) = len( C ). P de texte en clair, de sorte que len (P) = len (C).
Steps : Étapes:
1. 1.
Let n be the smallest integer such that n ⋅ b ≥len( C ), let d= len( C )-( n -1)⋅ b , and let C Soit n le plus petit entier tel que n ⋅ b ≥len (C), laissez d = len (C) - (n-1) ⋅ b, et soit 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 la séquence unique de chaînes de bits de telle sorte que
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; est un bloc complet; and et
c) c)
If n >2, then C Si n> 2, alors C
1, 1,
…, C ..., C
n -2 N -2
, are complete blocks. , Sont des blocs complets.
Consequently, len( C Par conséquent, len (C
n -1 n-1
* *
)= d , and 1≤d ≤ b , so that C ) = D, et 1≤d ≤ b, de sorte que C
n -1 n-1
* *
is either a complete block or est soit un bloc complet ou
a nonempty partial block. un bloc partiel non vide.
2. 2.
If d = b , ie, C Si D = b, c'est-à-C
n -1 n-1
* *
is a complete block, then est un bloc complet, alors
a) a)
apply CBC decryption to ( C appliquer CBC décryptage (C
1 1
, C , C
2 2
, … , C , ..., C
n -2 N -2
, C , C
n -1 n-1
* *
, C , C
n n
) with ) Avec
initialization vector IV and key K to produce ( P vecteur d'initialisation IV et la clé K pour produire (P
1 1
, P , P
2 2
, … P , ... P
n -1 n-1
, P , P
n n
); );
b) b)
return P retourner P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n-1
|| P || P
n n
. . STOP. Arrêtez.
If d < b , ie, C Si d <b, c'est-à-C
n -1 n-1
* *
is a partial block, then go to Step 3. est un bloc partiel, puis passez à l'étape 3.
3. 3.
Let Z Laissez Z
* *
=MSB = MSB
d ré
(CIPH (ICPC
-1 -1
K K
( C (C
n n
)), and Z )), Et Z
** **
=LSB = LSB
b - d b - d
(CIPH (ICPC
-1 -1
K K
( C (C
n n
)). )).
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
4 4
4. 4.
Let C Soit C
n -1 n-1
=C C =
n -1 n-1
* *
|| Z || Z
** **
. .
5. 5.
Apply CBC decryption to ( C Appliquer CBC décryptage (C
1 1
, C , C
2 2
, … , C , ..., C
n -1 n-1
) with initialization vector IV and key ) Avec le vecteur d'initialisation IV et la clé
K to produce ( P K pour produire (P
1 1
, P , P
2 2
, … P , ... P
n -1 n-1
). ).
6. 6.
Let P Soit P
n n
* *
=C C =
n -1 n-1
* *
Z Z
* *
. .
7. 7.
Return P Retour P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n-1
|| P || P
n n
* *
. .
Diagram : Schéma:
Figure 2 below illustrates the CBC-CS1-Decrypt algorithm for the case that d < b . Figure 2 ci-dessous illustre l'algorithme CBC-CS1-Décrypter dans le cas où d <b. As in Comme dans
the previous diagram, the bolded rectangles contain the inputs and outputs. le schéma précédent, les rectangles en gras contiennent les entrées et les sorties.
Figure 2: CBC-CS1-Decrypt Figure 2: CBC-CS1-Décrypter
3 Specification of CBC-CS2 3 Spécification de CBC-CS2
Algorithm: CBC-CS2-Encrypt Algorithme: CBC-CS2-Encrypt
Input : Entrée:
plaintext P , such that len( P ) is valid, including that len( P )≥ b ; clair P, tels que len (P) est valable, y compris len (P) ≥ b;
initialization vector IV ; vecteur d'initialisation IV;
key K . clé K.
Output : Sortie:
ciphertext C , such that len( C ) = len( P ). le texte chiffré C, de telle sorte que 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 ICPC
-1 -1
K K
CIPH ICPC
-1 -1
K K
CIPH ICPC
-1 -1
K K
… ...
C C
n -1 n-1
Z Z
** **
C C
n -1 n-1
* *
P P
n n
* *
CIPH ICPC
-1 -1
K K
Z Z
* *
Z Z
** **
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
5 5
Steps : Étapes:
1. 1.
Let n be the smallest integer such that n ⋅ b ≥len( P ), let d= len( P )-( n -1)⋅ b , and let P Soit n le plus petit entier tel que n ⋅ b ≥len (P), laissez d = len (P) - (n-1) ⋅ b, et soit 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: la séquence unique de chaînes de bits de telle sorte que:
a) a)
P = P P = P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n-1
|| P || P
n n
* *
; ; and et
b) b)
P P
1 1
, P , P
2 2
, … and P , ... Et P
n -1 n-1
are complete blocks. sont des blocs complets.
Consequently, len( P Par conséquent, len (P
n n
* *
)= d , and 1≤ d ≤ b , so that P ) = D, et d 1≤ ≤ b, de sorte que P
n n
* *
is either a complete block or a est soit un bloc complet ou un
nonempty partial block. bloc partiel non vide.
2. 2.
If d = b , ie, P Si D = b, c'est-à-P
n n
* *
is a complete block, then est un bloc complet, alors
a) apply CBC encryption with initialization vector IV and key K to the a) appliquer le cryptage CBC avec un vecteur d'initialisation IV et la clé K à la
plaintext ( P clair (P
1 1
, P , P
2 2
, … P , ... P
n -1 n-1
, P , P
n n
* *
) to produce ( C ) Pour produire (C
1 1
, C , C
2 2
, … C , ... C
n -1 n-1
, C , C
n n
); );
b) b)
return C retour C
1 1
|| C || C
2 2
||… C || C ...
n -1 n-1
|| C || C
n n
. . STOP. Arrêtez.
If d < b , ie, P Si d <b, c'est-à-P
n n
* *
is a partial block, go to Step 3. est un bloc partiel, passez à l'étape 3.
3. 3.
Let PAD be the bit string consisting of bd '0' bits, and let P Laissez PAD être la chaîne de bits composée de "0" les bits bd, et P
n n
=P = P
n n
* *
|| PAD . || PAD.
4. 4.
Apply CBC encryption to the plaintext ( P Appliquer chiffrement CBC au texte en clair (P
1 1
, P , P
2 2
, … P , ... P
n -1 n-1
, P , P
n n
) with initialization ) À l'initialisation
vector IV and key K to produce ( C vecteur IV et la clé K pour produire (C
1 1
, C , C
2 2
, … C , ... C
n -1 n-1
, C , C
n n
). ).
5. 5.
Let C Soit C
n -1 n-1
* *
=MSB = MSB
d ré
( C (C
n -1 n-1
). ).
6. 6.
Return C Retour 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 Notez que la sortie à l'étape 6 de CBC-CS2-Encrypt est presque identique à la sortie de
Step 6 of CBC-CS1-Encrypt. L'étape 6 de CBC-CS1-Encrypt. The only difference is the ordering of the final b + d bits; La seule différence est l'ordre des B + D finales bits; in dans
particular, C particulier, C
n n
precedes C précède C
n -1 n-1
* *
instead of following it. au lieu de la suivre.
Algorithm: CBC-CS2-Decrypt Algorithme: CBC-CS2-Décrypter
Input : Entrée:
ciphertext C , such that len( C ) is valid, including that len( C )≥ b ; le texte chiffré C, de telle sorte que len (C) est valable, y compris que len (C) ≥ b;
initialization vector IV ; vecteur d'initialisation IV;
key K . clé K.
Output : Sortie:
plaintext P , such that len( P )=len( C ). P de texte en clair, de sorte que len (P) = len (C).
Steps : Étapes:
1. 1.
Let n be the smallest integer such that n ⋅ b ≥len( C ), let d= len( C )-( n -1)⋅ b , and let C Soit n le plus petit entier tel que n ⋅ b ≥len (C), laissez d = len (C) - (n-1) ⋅ b, et soit 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 la séquence unique de chaînes de bits de telle sorte que
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; est un bloc complet; and et
c) c)
If n >2, then C Si n> 2, alors C
1, 1,
…, C ..., C
n -2 N -2
, are complete blocks. , Sont des blocs complets.
Consequently, len( C Par conséquent, len (C
n n
* *
)= d , and 1 ≤ d ≤ b , so that C ) = D, et 1 ≤ d ≤ b, de sorte que C
n n
* *
is either a complete block or est soit un bloc complet ou
a nonempty partial block. un bloc partiel non vide.
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
6 6
2. 2.
If d = b , ie, C Si D = b, c'est-à-C
n n
* *
is a complete block, then est un bloc complet, alors
a) a)
apply CBC decryption to ( C appliquer CBC décryptage (C
1 1
, C , C
2 2
, … , C , ..., C
n -1 n-1
, C , C
n n
* *
) with initialization ) À l'initialisation
vector IV and key K to produce ( P vecteur IV et la clé K pour produire (P
1 1
, P , P
2 2
, … , P , ..., P
n -1 n-1
, P , P
n n
); );
b) b)
return P retourner P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n-1
|| P || P
n n
. . STOP. Arrêtez.
If d < b , ie, C Si d <b, c'est-à-C
n n
* *
is a partial block, then go to Step 3. est un bloc partiel, puis passez à l'étape 3.
3. 3.
Apply Steps 3-6 of CBC-CS1-Decrypt to C Appliquer les étapes 3-6 de CBC-CS1-Déchiffrer à 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 pour revenir P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n-1
|| P || P
n n
* *
. .
Note that in Step 3, C On notera que dans l'étape 3, C
n n
* *
precedes C précède C
n -1 n-1
in order to undo the corresponding swap within the pour annuler le swap correspondant dans le
ciphertext in Step 6 of CBC-CS2-Encrypt. chiffré à l'étape 6 de CBC-CS2-Encrypt.
4 Specification of CBC-CS3 4 Spécification de CBC-CS3
Algorithm: CBC-CS3-Encrypt Algorithme: CBC-CS3-Encrypt
Input : Entrée:
plaintext P , such that len( P ) is valid, including that len( P )≥ b ; clair P, tels que len (P) est valable, y compris len (P) ≥ b;
initialization vector IV ; vecteur d'initialisation IV;
key K . clé K.
Output : Sortie:
ciphertext C , such that len( C )=len( P ). le texte chiffré C, de telle sorte que len (C) = len (P).
Steps : Étapes:
1. 1.
Let n be the smallest integer such that n ⋅ b ≥len( P ), let d= len( P )-( n -1)⋅ b , and let P Soit n le plus petit entier tel que n ⋅ b ≥len (P), laissez d = len (P) - (n-1) ⋅ b, et soit 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: la séquence unique de chaînes de bits de telle sorte que:
a) a)
P = P P = P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n-1
|| P || P
n n
* *
; ; and et
b) b)
P P
1 1
, P , P
2 2
, … and P , ... Et P
n -1 n-1
are complete blocks. sont des blocs complets.
Consequently, len( P Par conséquent, len (P
n n
* *
)= d , and 1≤ d ≤ b , so that P ) = D, et d 1≤ ≤ b, de sorte que P
n n
* *
is either a complete block or a est soit un bloc complet ou un
nonempty partial block. bloc partiel non vide.
2. 2.
If d = b , ie, P Si D = b, c'est-à-P
n n
* *
is a complete block, then est un bloc complet, alors
a) apply CBC encryption with initialization vector IV and key K to the a) appliquer le cryptage CBC avec un vecteur d'initialisation IV et la clé K à la
plaintext ( P clair (P
1 1
, P , P
2 2
, … P , ... P
n -1 n-1
, P , P
n n
* *
) to produce ( C ) Pour produire (C
1 1
, C , C
2 2
, … C , ... C
n -1 n-1
, C , C
n n
); );
b) b)
return C retour C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n n
|| C || C
n -1 n-1
. . STOP. Arrêtez.
If d < b , ie, P Si d <b, c'est-à-P
n n
* *
is a partial block, go to Step 3. est un bloc partiel, passez à l'étape 3.
3. 3.
Let PAD be the bit string consisting of bd '0' bits, and let P Laissez PAD être la chaîne de bits composée de "0" les bits bd, et P
n n
=P = P
n n
* *
|| PAD . || PAD.
4. 4.
Apply CBC encryption to the plaintext ( P Appliquer chiffrement CBC au texte en clair (P
1 1
, P , P
2 2
, … P , ... P
n -1 n-1
, P , P
n n
) with initialization ) À l'initialisation
vector IV and key K to produce ( C vecteur IV et la clé K pour produire (C
1 1
, C , C
2 2
, … C , ... C
n -1 n-1
, C , C
n n
). ).
5. 5.
Let C Soit C
n -1 n-1
* *
=MSB = MSB
d ré
( C (C
n -1 n-1
). ).
6. 6.
Return C Retour C
1 1
|| C || C
2 2
||…|| C || ... || C
n -2 N -2
|| C || C
n n
|| C || C
n -1 n-1
* *
. .
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
7 7
Note that in Step 6 of CBC-CS3-Encrypt, as in CBC-CS2-Encrypt, the positions of C Notez que dans l'étape 6 de CBC-CS3-Encrypt, comme dans CBC-CS2-Encrypt, les positions de C
n -1 n-1
* *
and C et C
n n
are swapped in comparison to Step 6 of CBC-CS1-Encrypt. sont permutés par rapport à l'étape 6 de CBC-CS1-Encrypt. For CBC-CS3- Pour CBC-CS3-
Encrypt, the analogous swap also occurs in the case that P Encrypt, le swap analogue se produit également dans le cas où P
n n
* *
is a complete block. est un bloc complet. In Dans
particular, within the output of Step 2 for CBC-CS3-Encrypt, C notamment, dans la sortie de l'étape 2 pour CBC-CS3-Encrypt, C
n n
precedes C précède C
n -1 n-1
, in contrast , En revanche
to the output of Step 2 for CBC-CS1-Encrypt and CBC-CS2-encrypt, where C à la sortie de l'étape 2 pour CBC-CS1-Crypter et CBC-CS2-chiffrer, où C
n n
follows suit
C C
n -1 n-1
. .
Algorithm: CBC-CS3-Decrypt Algorithme: CBC-CS3-Décrypter
Input : Entrée:
ciphertext C , such that len( C ) is valid, including that len( C )≥ b ; le texte chiffré C, de telle sorte que len (C) est valable, y compris que len (C) ≥ b;
initialization vector IV ; vecteur d'initialisation IV;
key K . clé K.
Output : Sortie:
plaintext P , such that len( P )=len( C ). P de texte en clair, de sorte que len (P) = len (C).
Steps : Étapes:
1. 1.
Let n be the smallest integer such that n ⋅ b ≥len( C ), let d= len( C )-( n -1)⋅ b , and let C Soit n le plus petit entier tel que n ⋅ b ≥len (C), laissez d = len (C) - (n-1) ⋅ b, et soit 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 la séquence unique de chaînes de bits de telle sorte que
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; est un bloc complet; and et
c) c)
If n >2, then C Si n> 2, alors C
1, 1,
…, C ..., C
n -2 N -2
, are complete blocks. , Sont des blocs complets.
Consequently, len( C Par conséquent, len (C
n n
* *
)= d , and 1≤d ≤ b , so that C ) = D, et 1≤d ≤ b, de sorte que C
n n
* *
is either a complete block or a est soit un bloc complet ou un
nonempty partial block. bloc partiel non vide.
2. 2.
Apply the CBC-CS1-Decrypt algorithm with initialization vector IV and key K to Appliquer l'algorithme CBC-CS1-Déchiffrer avec un vecteur d'initialisation IV et la clé K à
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 pour revenir P
1 1
|| P || P
2 2
||…|| P || ... || P
n -1 n-1
|| P || P
n n
* *
. .
Note that in Step 2, C On notera que dans l'étape 2, C
n n
* *
precedes C précède C
n -1 n-1
in order to undo the corresponding swaps within the afin d'annuler les swaps correspondants au sein de la
ciphertexts in Steps 2b and 6 of CBS-CS3-Encrypt. chiffrés dans les étapes 2b et 6 de CBS-CS3-Encrypt.
Draft Addendum to NIST Special Publication 800-38A Projet d'Addendum au NIST spécial 800-38A de publication
8 8
References Références
[1] [1]
Dworkin, M., NIST Special Publication 800-38A, 2001 Edition : Recommendation Dworkin, M., NIST spécial 800-38A de publication, édition 2001: Recommandation
for Block Cipher Modes of Operation, Methods and Techniques , December 2001, pour le bloc Cipher modes de fonctionnement, méthodes et techniques, Décembre 2001
Natl. Natl. Inst. Inst. Stand. Stand. Technol. Technol. [Web page], http://www.csrc.nist.gov/publications/ [Page Web], http://www.csrc.nist.gov/publications/
nistpubs/800-38a/sp800-38a.pdf . nistpubs / 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. Cryptage pour Kerberos 5, Internet Engineering Task Force, Février 2005.
[3] [3]
Schneier, B., Applied Cryptography, Second Edition: protocols, algorithms, and Schneier, B., Cryptographie appliquée, deuxième édition: les protocoles, les algorithmes, et
source code in C. code source en C. New York: Wiley, 1996. New York: Wiley, 1996.