Page 1 Page 1
NIST Special Publication 800-38G NIST spécial 800-38G de publication
Draft Avant-projet
Recommendation for Block Cipher Recommandation pour le bloc Cipher
Modes of Operation: Modes de fonctionnement:
Methods for Format-Preserving Méthodes de Format-Préserver
Encryption Chiffrement
Morris Dworkin Morris Dworkin
COMPUTER INFORMATIQUE
SECURITY SÉCURITÉ

Page 2 Page 2

Page 3 Page 3
NIST Special Publication 800-38G NIST spécial 800-38G de publication
Draft Avant-projet
Recommendation for Block Cipher Recommandation pour le bloc Cipher
Modes of Operation: Modes de fonctionnement:
Methods for Format-Preserving Méthodes de Format-Préserver
Encryption Chiffrement
Morris Dworkin Morris Dworkin
Computer Security Division Division de la sécurité informatique
Information Technology Laboratory Laboratoire de la technologie de l'information
July, 2013 Juillet 2013
US Department of Commerce US Department of Commerce
Cameron F. Kerry, Acting Secretary Cameron F. Kerry, secrétaire par intérim
National Institute of Standards and Technology Institut National des Standards et de la Technologie
Patrick D. Gallagher, Under Secretary of Commerce for Standards and Technology and Director Patrick D. Gallagher, sous-secrétaire du Commerce des normes et de la technologie et directeur

Page 4 Page 4
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
ii ii
Authority Autorité
This publication has been developed by NIST to further its statutory responsibilities under the Cette publication a été développé par le NIST pour promouvoir ses responsabilités légales en vertu de la
Federal Information Security Management Act (FISMA), Public Law (PL) 107-347. Loi sur les renseignements de sécurité fédérale de gestion (FISMA), de droit public (PL) 107-347. NIST is NIST est
responsible for developing information security standards and guidelines, including minimum responsable de l'élaboration de normes et de lignes directrices en matière de sécurité de l'information, y compris minimum
requirements for Federal information systems, but such standards and guidelines shall not apply exigences des systèmes d'information du gouvernement fédéral, mais ces normes et les lignes directrices ne sont pas applicables
to national security systems without the express approval of appropriate Federal officials aux systèmes de sécurité nationaux sans l'approbation expresse des fonctionnaires fédéraux appropriés
exercising policy authority over such systems. l'exercice de l'autorité politique sur ces systèmes. This guideline is consistent with the requirements Cette recommandation est conforme aux exigences
of the Office of Management and Budget (OMB) Circular A-130, Section 8b(3), Securing de l'Office of Management and Budget (OMB) Circulaire A-130, la Section 8b (3), Sécurisation
Agency Information Systems , as analyzed in Circular A-130, Appendix IV: Analysis of Key Agence des systèmes d'information, comme analysé dans la circulaire A-130, Annexe IV: Analyse de Key
Sections . Sections. Supplemental information is provided in Circular A-130, Appendix III, Security of Information supplémentaire n'est fournie dans la circulaire A-130, annexe III, la sécurité de
Federal Automated Information Resources . Ressources d'information automatisés fédéraux.
Nothing in this publication should be taken to contradict the standards and guidelines made Rien dans la présente publication doivent être prises pour contredire les normes et lignes directrices établies
mandatory and binding on Federal agencies by the Secretary of Commerce under statutory obligatoire et contraignant sur ​​les organismes fédéraux par le secrétaire au Commerce sous la loi
authority. autorité. Nor should these guidelines be interpreted as altering or superseding the existing Ces lignes directrices ne devraient pas être interprétés comme une modification ou remplaçant le existant
authorities of the Secretary of Commerce, Director of the OMB, or any other Federal official. autorités de la secrétaire au Commerce, Directeur de la CAMO, ou tout autre fonctionnaire fédéral.
This publication may be used by nongovernmental organizations on a voluntary basis and is not Cette publication peut être utilisé par des organisations non gouvernementales sur une base volontaire et n'est pas
subject to copyright in the United States. soumis au droit d'auteur aux États-Unis. Attribution would, however, be appreciated by NIST. Paternité serait, cependant, être apprécié par le NIST.
National Institute of Standards and Technology Special Publication 800-38G Institut National des Standards et de la technologie spéciale 800-38G de publication
Natl. Natl. Inst. Inst. Stand. Stand. Technol. Technol. Spec. Spec. Publ. Publ. 800-38G, NNN pages (Month YYYY) 800-38G, pages NNN (mois, année)
http://dx.doi.org/10.6028/NIST.SP.XXX http://dx.doi.org/10.6028/NIST.SP.XXX
CODEN: NSPUE2 CODEN: NSPUE2
Public comment period: Month Day, YYYY through Month Day, YYYY Période de commentaires du public: Jour Mois AAAA par Mois Jour AAAA
National Institute of Standards and Technology Institut National des Standards et de la Technologie
Attn: Computer Security Division, Information Technology Laboratory À l'attention de: Division de la sécurité informatique, Laboratoire de la technologie de l'information
100 Bureau Drive (Mail Stop 8930) Gaithersburg, MD 20899-8930 100 Bureau dur (Mail Stop 8930) Gaithersburg, MD 20899-8930
Email: EncryptionModes@nist.gov Email: EncryptionModes@nist.gov
Certain commercial entities, equipment, or materials may be identified in this document in order to Certaines entités commerciales, des équipements ou matériaux peuvent être identifiées dans le présent document pour
describe an experimental procedure or concept adequately. décrire une procédure expérimentale ou d'un concept de manière adéquate. Such identification is not intended to imply Cette identification n'est pas destiné à impliquer
recommendation or endorsement by NIST, nor is it intended to imply that the entities, materials, or recommandation ou une approbation par le NIST, ne sont pas destinés à laisser entendre que l'entités, des matériaux ou
equipment are necessarily the best available for the purpose. équipements sont nécessairement les meilleurs existants pour l'application.
It is possible that implementation of modes included in this NIST Recommendation may involve an Il est possible que la mise en œuvre de modes inclus dans la présente Recommandation NIST peut impliquer une
invention covered by patent rights. invention couverte par des droits de brevet. By publication of this Special Publication, no position is taken with La publication de cette publication, aucune position n'est pris avec
respect to the validity, scope or enforceability of any claim(s) of any such patent rights in connection quant à la validité, la portée ou le caractère exécutoire de toute demande (s) de ces droits de brevet dans le cadre
with such implementation. avec cette mise en œuvre. If a patent holder has filed with NIST a Letter of Assurance (LOA) with Si un titulaire de brevet a déposé auprès du NIST une lettre de garantie (LOA) avec
respect to any such patent rights, a copy of that LOA may be obtained from NIST. l'égard de ces droits de brevet, une copie de cette lettre d'autorisation peut être obtenue auprès du NIST.
There may be references in this publication to other publications currently under development by NIST Il peut y avoir des références dans cette publication à d'autres publications en cours de développement par le NIST
in accordance with its assigned statutory responsibilities. conformément à ses obligations légales assignées. The information in this publication, including Les informations contenues dans cette publication, y compris
concepts and methodologies, may be used by Federal agencies even before the completion of such les concepts et les méthodes, peuvent être utilisés par les agences fédérales avant même la fin de cette
companion publications. publications de compagnie. Thus, until each publication is completed, current requirements, guidelines, Ainsi, jusqu'à ce que chaque publication est terminée, les exigences actuelles, les lignes directrices,
and procedures, where they exist, remain operative. et procédures, là où elles existent, restent valables. For planning and transition purposes, Federal Pour des fins de planification et de transition, fédéral
agencies may wish to closely follow the development of these new publications by NIST. organismes pourraient suivre de près le développement de ces nouvelles publications par le NIST.
Organizations are encouraged to review all draft publications during public comment periods and Les organisations sont encouragées à examiner tous les projets de publications au cours de périodes de consultation publique et
provide feedback to NIST. fournir une rétroaction au NIST. All NIST Computer Security Division publications, other than the ones Toutes les publications de la Division du NIST sécurité informatique, autres que ceux
noted above, are available at http://csrc.nist.gov/publications. indiqué ci-dessus, sont disponibles à http://csrc.nist.gov/publications.

Page 5 Page 5
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
iii iii
Reports on Computer Systems Technology Rapports sur les technologie des systèmes informatiques
The Information Technology Laboratory (ITL) at the National Institute of Standards and Le Laboratoire de la technologie de l'information (ITL) à l'Institut national des normes et
Technology (NIST) promotes the US economy and public welfare by providing technical Technology (NIST) favorise l'économie américaine et le bien-être du public en fournissant technique
leadership for the Nation's measurement and standards infrastructure. le leadership pour la mesure et des normes de l'infrastructure de la nation. ITL develops tests, test ITL développe des tests, le test
methods, reference data, proof of concept implementations, and technical analyses to advance méthodes, les données de référence, la preuve de concept, les implémentations et les analyses techniques pour faire avancer
the development and productive use of information technology. le développement et l'utilisation productive des technologies de l'information. ITL's responsibilities include the Les responsabilités comprennent l'ITL
development of management, administrative, technical, and physical standards and guidelines for développement de la gestion, administratif, technique, et les normes physiques et des lignes directrices pour
the cost-effective security and privacy of other than national security-related information in la sécurité économique et la vie privée des autres que les informations liées à la sécurité nationale en
Federal information systems. Systèmes fédéraux d'information. The Special Publication 800-series reports on ITL's research, La publication des rapports spéciaux de la série 800 sur la recherche de ITL,
guidelines, and outreach efforts in information system security, and its collaborative activities les lignes directrices et les efforts de sensibilisation à la sécurité des systèmes d'information, et de ses activités de collaboration
with industry, government, and academic organizations. avec l'industrie, du gouvernement et d'organisations académiques.
Abstract Résumé
This Recommendation specifies three methods for format-preserving encryption, called FF1, Cette Recommandation spécifie trois méthodes de cryptage de format de préservation, appelés FF1,
FF2, and FF3. FF2, FF3 et. Each of these methods is a mode of operation of the AES algorithm, which is used Chacun de ces modes est un mode de fonctionnement de l'algorithme AES, qui est utilisé
to construct a round function within the Feistel structure for encryption. pour construire une fonction retour dans la structure de Feistel pour le chiffrement.
Keywords Mots-clés
block cipher; bloquer chiffrement; computer security; la sécurité informatique; confidentiality; la confidentialité; cryptography; cryptographie; encryption; le cryptage; Feistel structure; La structure de Feistel;
format-preserving encryption; Format de préservation de cryptage; information security; sécurité de l'information; mode of operation. mode de fonctionnement.
Acknowledgements Remerciements
Much of the text in this publication is adapted from four specification documents that were Une grande partie du texte dans cette publication est adapté à partir de quatre documents de spécifications qui ont été
submitted to NIST: Mihir Bellare, Phil Rogaway, and Terence Spies submitted the FFX soumis au NIST: Mihir Bellare, Phil Rogaway, et Spies Terence soumis le FFX
framework and FFX[Radix] in [1 ] a nd [2]; cadre et FFX [Radix] dans [1 ] un e [2]; Eric Brier, Thomas Peyrin, and Jacques Stern Eric Brier, Thomas Peyrin, et Jacques Stern
submitted BPS in [3] , and Joachim Vance submitted VAES3 in [13]. soumis BPS dans [3] , et Joachim Vance soumis VAES3 dans [13].
In addition to the designers, the author wishes to thank his colleagues who reviewed drafts of this Outre les designers, l'auteur tient à remercier ses collègues qui ont examiné les projets de ce
publication and contributed to its development, especially Elaine Barker, Meltem Somnez Turan, publication et contribué à son développement, en particulier Elaine Barker, Meltem Somnez Turan,
Lily Chen, John Kelsey, Ray Perlner, Allen Roginsky, Lawrence Bassham, Tim Hall, and Sharon Lily Chen, John Kelsey, Ray Perlner, Allen Roginsky, Laurent Bassham, Tim Hall, et Sharon
Keller. Keller. The author also gratefully acknowledges the comments from the public and private L'auteur a également chaleureusement reconnaît les observations du public et privé
sectors to improve the quality of this publication. secteurs à améliorer la qualité de cette publication.

Page 6 Page 6
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
iv iv
TABLE OF CONTENTS Table des matières
1 1
PURPOSE..............................................................................................................................................................1
2 2
AUTHORITY........................................................................................................................................................1
3 3
INTRODUCTION INTRODUCTION ................................................................................................................................................1
4 4
DEFINITIONS AND DEFINITIONS ET NOTATION......................................................................................................................3
4.1 D 4.1 D
EFINITIONS ÉFINITIONS
....................................................................................................................................................3
4.2 A 4.2
CRONYMS CRONYMES
......................................................................................................................................................5
4.3 O 4.3 O
PERATIONS AND PERATIONS ET
F Fa
UNCTIONS ONCTIONS
.........................................................................................................................5
4.4 E 4,4 E
XAMPLES OF EXEMPLES DE
B B
ASIC ASIC
O O
PERATIONS AND PERATIONS ET
F Fa
UNCTIONS ONCTIONS
........................................................................................6 .................................................. ...................................... 6
5 5
PRELIMINARIES................................................................................................................................................8
5.1 C 5.1 C
HARACTER HARACTER
S S
TRINGS Trings
......................................................................................................................................8
5.2 U 5.2 U
NDERLYING NDERLYING
B B
LOCK BLOCAGE
C C
IPHER AND IPHER ET
K K
EY EY
...........................................................................................................8
5.3 E 5,3 E
NCRYPTION AND NCRYPTION ET
D Ré
ECRYPTION Ecryption
F Fa
UNCTIONS ONCTIONS
....................................................................................................9
5.4 F 5,4 F
EISTEL EISTEL
S S
TRUCTURE STRUCTURE
......................................................................................................................................10
5.5 C 5.5 C
OMPONENT OLET
F Fa
UNCTIONS ONCTIONS
...............................................................................................................................11
6 6
MODE MODE SPECIFICATIONS...............................................................................................................................13
6.1 6.1 FF1................................................................................................................................................................14
6.2 6.2 FF2................................................................................................................................................................16
6.3 6.3 FF3................................................................................................................................................................19
7 7
CONFORMANCE..............................................................................................................................................21
8 8
REFERENCES....................................................................................................................................................21
APPENDIX A: PARAMETER CHOICES ANNEXE A: choix de paramètres ............................................................................................................23
APPENDIX B: SECURITY GOAL ANNEXE B: SÉCURITÉ BUT .........................................................................................................................23
APPENDIX C: ANNEXE C: TWEAKS.........................................................................................................................................23
TABLE OF FIGURES TABLE DES FIGURES
Figure 1: Illustration of the Feistel Structure................................................................................ 11 Figure 1: Illustration de la structure de Feistel .......................................... ...................................... 11

Page 7 Page 7
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
1 Purpose 1 But
This publication is the seventh part in a series of Recommendations regarding the modes of Cette publication est la septième partie d'une série de recommandations en ce qui concerne les modes de
operation of block cipher algorithms. fonctionnement des algorithmes de chiffrement par bloc. The purpose of this part is to provide approved methods for Le but de cette partie est de fournir des méthodes approuvées pour
format-preserving encryption (FPE). cryptage de format de préservation (FPE).
2 Authority Autorité 2
This publication has been developed by the National Institute of Standards and Technology Cette publication a été développé par l'Institut National des Standards et de la Technologie
(NIST) in furtherance of its statutory responsibilities under the Federal Information Security (NIST) dans la poursuite de ses responsabilités légales en vertu de la sécurité de l'information fédérale
Management Act (FISMA) of 2002, Public Law 107-347. Loi sur la gestion (FISMA) de 2002, Public Law 107-347.
NIST is responsible for developing standards and guidelines, including minimum requirements NIST est responsable des normes et des lignes directrices en développement, y compris les exigences minimales
for federal information systems, but such standards and guidelines shall not apply to national pour les systèmes d'information du gouvernement fédéral, mais ces normes et directives ne s'appliquent pas aux nationaux
security systems. systèmes de sécurité.
This recommendation has been prepared for use by Federal agencies. Cette recommandation a été préparé à l'intention des organismes fédéraux. It may be used by Il peut être utilisé par
nongovernmental organizations on a voluntary basis and is not subject to copyright. des organisations non gouvernementales sur une base volontaire et n'est pas soumis au droit d'auteur. (Attribution (Attribution
would be appreciated by NIST.) serait apprécié par le NIST.)
Nothing in this publication should be taken to contradict the standards and guidelines made Rien dans la présente publication doivent être prises pour contredire les normes et lignes directrices établies
mandatory and binding on federal agencies by the Secretary of Commerce under statutory obligatoire et contraignant sur ​​les organismes fédéraux par le secrétaire au Commerce sous la loi
authority. autorité. Nor should these guidelines be interpreted as altering or superseding the existing Ces lignes directrices ne devraient pas être interprétés comme une modification ou remplaçant le existant
authorities of the Secretary of Commerce, Director of the OMB, or any other federal official. autorités de la secrétaire au Commerce, Directeur de la CAMO, ou tout autre fonctionnaire fédéral.
Conformance testing for implementations of this Recommendation will be conducted within the Essai de conformité pour les implémentations de cette recommandation sera menée dans le
framework of the Cryptographic Algorithm Validation Program (CAVP) and the Cryptographic cadre du Programme algorithme cryptographique de validation (CAVP) et la cryptographie
Module Validation Program (CMVP). Programme de validation des modules (PVMC). The requirements of this Recommendation are indicated Les exigences de la présente Recommandation sont indiqués
by the word “shall.” Some of these requirements may be out-of-scope for CAVP or CMVP par le mot «doit». Certaines de ces exigences peut être hors du champ de CAVP ou PVMC
validation testing, and thus are the responsibility of entities using, implementing, installing, or les tests de validation, et sont donc de la responsabilité des entités à l'aide, la mise en œuvre, l'installation, ou
configuring applications that incorporate this Recommendation. la configuration des applications qui intègrent cette recommandation.
3 Introduction 3 Introduction
This publication specifies three block cipher modes of operation—or, simply, modes—for Cette publication précise trois modes de chiffrement par bloc de fonctionnement, ou, tout simplement, modes-pour
format-preserving encryption (FPE). cryptage de format de préservation (FPE).
Previously approved encryption modes transform bit strings—sequences of 0 s and 1 s—into Modes de chiffrement approuvés antérieurement transforment chaînes séquences binaires de 0 s et 1 s-en
other bit strings, but these modes are not directly applicable to decimal strings, like Social d'autres chaînes de bits, mais ces modes ne sont pas directement applicables aux chaînes décimales, comme social
Security numbers (SSNs) or credit card numbers (CCNs), or to other data formats. Numéros de sécurité (NSS) ou des numéros de cartes de crédit (de CCNS), ou à d'autres formats de données.
Given any finite set of symbols, like the decimal numerals, FPE transforms data that is formatted Compte tenu de tout ensemble fini de symboles, comme les nombres décimaux, FPE transforme les données qui est formaté
as a sequence of the symbols in such a way that the encrypted form of the data has the same en tant que séquence de symboles de telle sorte que la forme cryptée de données a le même
format and length as the original data. forme et longueur que les données d'origine. Thus, an FPE-encrypted SSN also appears to be an SSN. Ainsi, un SSN FPE crypté semble également être un SSN.

Page 8 Page 8
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
2 2
Consequently, FPE facilitates the targeting of encryption to sensitive information, as well as the Par conséquent, FPE facilite le ciblage de cryptage à des informations sensibles, ainsi que la
retrofitting of encryption technology to legacy applications, where a conventional encryption la modernisation de la technologie de cryptage pour les applications héritées, où un chiffrement conventionnel
mode might not be feasible because it would disrupt data fields/pathways. Mode pourrait ne pas être possible car cela perturberait les champs de données / voies. FPE has emerged as a FPE a émergé comme une
useful cryptographic tool, whose applications include financial-information security, data outil cryptographique utile, dont les demandes inclure d'informations financières sécurité, les données
sanitization, and transparent encryption of fields in legacy databases. assainissement, et le chiffrement transparent des champs de bases de données existantes.
The three FPE modes specified in this publication are abbreviated FF1, FF2, and FF3, to indicate Les trois modes FPE spécifiées dans la présente publication sont abrégés FF1, FF2, FF3 et, pour indiquer
that they are format-preserving, Feistel-based encryption modes. qu'ils sont, des modes de cryptage à base de Feistel formats de préservation. They were submitted to NIST Ils ont été soumis à NIST
under the names FFX[Radix], VAES3, and BPS-BC, in [2] , [1 3], and [3], respectively. sous les noms FFX [Radix], VAES3, et BPS-Colombie-Britannique, dans [2] , [1 3], et [3], respectivement. Each Chaque
mode fits within a larger framework, called FFX, for constructing FPE mechanisms, that was Mode s'inscrit dans un cadre plus large, appelé FFX, pour la construction de mécanismes FPE, qui était
submitted to NIST in [ 1]. The “X” indicates the flexibility to instantiate the framework with soumis au NIST [ 1]. L'"X" indique la possibilité d'instancier le cadre de
different parameter sets, as well as FFX's evolution from the FFSEM specification earlier différents jeux de paramètres, ainsi que l'évolution de FFX de la spécification précédente FFSEM
submitted to NIST in [12]. soumis au NIST [12].
The FFX framework itself is not specified in this publication; Le cadre se FFX n'est pas spécifié dans cette publication; in fact, FF1, FF2, and FF3 are not en fait, FF1, FF2, FF3 et ne sont pas
presented explicitly as instantiations of FFX parameter sets, but rather as separate algorithms, in présentée explicitement comme instanciations de FFX jeux de paramètres, mais plutôt comme des algorithmes distincts, dans
order to simplify the individual specifications. Afin de simplifier les spécifications individuelles.
FF1, FF2, and FF3 each employ the Feistel structure of encryption—see Sec. 5. 4—which also FF1, FF2, FF3 et emploient chacun la structure de Feistel de cryptage-voir chap. 5. 4 qui a également
underlies the Data Encryption Algorithm [8] . sous-tend l'algorithme de cryptage de données [8] . At the core of FF1, FF2, and FF3 are somewhat Au cœur de FF1, FF2, FF3 et sont un peu
different Feistel round functions that are derived from an approved block cipher with 128-bit les différentes fonctions de Feistel rondes qui sont dérivés à partir d'un algorithme de chiffrement par bloc approuvé avec 128 bits
blocks, ie, the AES algorithm blocs, à savoir, l'algorithme AES
1 1
[6]. [6].
In addition to the formatted data for which the modes provide confidentiality, each mode also En plus des données formatées pour les modes qui assurent la confidentialité, chaque mode également
takes a “tweak” input, ie, additional information that is not necessarily secret. prend une entrée "tordre", c'est à dire, des informations supplémentaires qui ne sont pas nécessairement secret. This functionality Cette fonctionnalité
can be especially important for FPE modes, because the number of possible values for the peut être particulièrement important pour les modes FPE, parce que le nombre de valeurs possibles pour l'
confidential data is often relatively small. données confidentielles est souvent relativement faible. In particular, the encrypted form of the data can vary En particulier, la forme cryptée de données peut varier
in different instances when the tweak inputs are different. dans les différents cas où les entrées de tweak sont différents. See Appendix C for further discussion Voir l'annexe C pour de plus amples discussions
of tweaks. de réglages.
The three modes offer somewhat similar performance profiles. Les trois modes offrent des profils de performance à peu près semblables. FF1 supports the greatest range of FF1 supporte la plus grande gamme de
lengths for the protected, formatted data and the tweak. longueurs pour les données formatées, protégées et le tweak. FF2 generates a subkey for the block FF2 génère une sous-clé pour le bloc
cipher in the Feistel round function, which can help protect the original key from side-channel chiffre dans la fonction round Feistel, qui peut aider à protéger la clé originale du canal latéral
analysis. analyse. FF3 offers the lowest round count, eight, compared to ten for FF1 and FF2, and is the FF3 offre le nombre le plus bas tour, huit, dix par rapport à de FF1 et FF2, et est l'
least flexible in the tweaks that it supports. moins souple dans les réglages qu'il soutient.
The BPS mechanism for FPE—named after its designers, Brier, Peyrin, and Stern—was Le mécanisme BPS pour FPE-nommé d'après ses concepteurs, Brier, Peyrin, et Stern-a
submitted to NIST in [3] ; soumis au NIST [3] ; FF3 is essentially equivalent to the BPS-BC component of BPS, FF3 est essentiellement équivalente à la composante de BPS BPS-BC,
instantiated with a 128-bit block cipher. instancié avec un bloc de chiffrement de 128 bits. The full BPS mode—in particular, its chaining Mode dans les BPS pleins particulier, son chaînage
mechanism for longer input strings—is not approved in this Recommendation. mécanisme de plus la chaîne d'entrée-n'est pas approuvé dans la présente Recommandation.
1 1
The term “algorithm” here indicates a high-level cryptographic technique that may encompass more than one Le terme "algorithme" indique ici une technique de chiffrement de haut niveau qui peut englober plus d'un
computational procedure; procédure de calcul; for example, an “encryption algorithm” like the AES algorithm has transformations for par exemple, un "algorithme de cryptage" comme l'algorithme AES a transformations pour
both encryption and decryption. chiffrement et le déchiffrement. This publication also contains ten numbered algorithms in the original sense of the Cette publication contient également dix algorithmes numérotés dans le sens originel du
word, ie, as a list of instructions for executing a single computational procedure. mot, c'est à dire, comme une liste d'instructions pour l'exécution d'une seule procédure de calcul.

Page 9 Page 9
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
3 3
4 Definitions and Notation 4 Définitions et notation
4.1 Definitions 4.1 Définitions
alphabet alphabet
A finite set of two or more symbols. Un ensemble fini de deux ou plusieurs symboles.
approved approuvé
FIPS-approved or NIST-recommended: an algorithm or technique FIPS-approuvés ou NIST recommandé: un algorithme ou technique
that is either 1) specified in a FIPS or a NIST Recommendation, or qui est soit 1) spécifiée dans FIPS ou une recommandation NIST, ou
2) adopted in a FIPS or a NIST Recommendation. 2) adopté dans un FIPS ou une recommandation NIST.
base base
The number of characters in a given alphabet; Le nombre de caractères dans un alphabet donné; represented as radix comme représenté radix
in this publication. dans cette publication.
bit peu
A binary digit: 0 or 1. Un chiffre binaire: 0 ou 1.
bit string chaîne de bits
A finite, ordered sequence of bits. Une séquence finie, ordonné de bits.
block bloc
For a given block cipher, a bit string whose length is the block size Par un algorithme de chiffrement par bloc donné, une chaîne de bits dont la longueur correspond à la taille de bloc
of the block cipher. de chiffrement par bloc.
block cipher chiffrement par bloc
A parameterized family of permutations on bit strings of a fixed Une famille paramétrée de permutations sur les chaînes de bits d'un fixe
length; longueur; the parameter that determines the permutation is a bit string le paramètre qui détermine la permutation est une chaîne de bits
called the key. appelée la clé.
block cipher chiffrement par bloc
mode of operation mode de fonctionnement
An algorithm for the cryptographic transformation of data that is Un algorithme pour la transformation cryptographique de données qui est
based on a block cipher. basé sur un algorithme de chiffrement par bloc.
block size taille de bloc
For a given block cipher and key, the fixed length of the input (or Par un algorithme de chiffrement et la clé de bloc donné, la longueur fixe de l'entrée (ou
output) bit strings. sortie des chaînes) de bits.
block string chaîne de bloc
A bit string that can be represented as the concatenation of a finite, Une chaîne de bits qui peut être représenté comme la concaténation d'un fini,
ordered sequence of blocks. séquence ordonnée de blocs.
byte octet
A string of eight bits. Une chaîne de huit bits.
byte string chaîne d'octets
A bit string that can be represented as the concatenation of a finite, Une chaîne de bits qui peut être représenté comme la concaténation d'un fini,
ordered sequence of bytes. séquence ordonnée d'octets.
character caractère
A symbol in an alphabet. Un symbole dans l'alphabet.
character string chaîne de caractères
A finite, ordered sequence of characters. Une séquence finie, ordonnée de caractères.
ciphertext cryptogramme
The numeral string that is the encrypted form of a plaintext. La chaîne numérique qui est la forme cryptée d'un texte en clair.

Page 10 Page 10
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
4 4
decryption décryptage
function fonction
For a given block cipher and key, the function of an FPE mode that Par un algorithme de chiffrement et la clé de bloc donné, la fonction d'un mode FPE que
takes a ciphertext numeral string and a tweak as input and returns prend une chaîne numérique chiffré et un tweak comme entrée et retourne
the corresponding plaintext numeral string as output. la chaîne numérique en clair correspondant en sortie.
designated cipher chiffre désigné
function fonction
For a given block cipher and key, the choice of either the forward Par un algorithme de chiffrement et la clé de bloc donné, le choix de l'une ou l'autre de l'avant
transformation or the inverse transformation. la transformation ou la transformation inverse.
encryption chiffrement
function fonction
For a given block cipher and key, the function of an FPE mode that Par un algorithme de chiffrement et la clé de bloc donné, la fonction d'un mode FPE que
takes a plaintext numeral string and a tweak as input and returns a prend une chaîne numérique en clair et un tweak en entrée et renvoie un
ciphertext numeral string as output. chaîne numérique chiffré en sortie.
exclusive-OR OU exclusif
The bitwise addition, modulo 2, of two bit strings of equal length. L'addition au niveau du bit, modulo 2, de deux chaînes de bits de longueur égale.
Feistel structure La structure de Feistel
A framework for constructing an encryption mode. Un cadre pour la construction d'un mode de cryptage. The framework Le cadre
consists of several iterations, called rounds, in which a keyed se compose de plusieurs itérations, appelées cycles, dans lequel un détrompeur
function, called the round function, is applied to one part of the data fonction, dite fonction de tour, est appliquée à une partie des données
in order to modify the other part of the data; afin de modifier l'autre partie des données; the roles of the two les rôles des deux
parts are swapped for the next round. parties sont inversés pour le prochain tour.
forward avant
transformation transformation
For a given block cipher, the permutation of blocks that is Par un algorithme de chiffrement par bloc donné, la permutation de blocs qui est
determined by the choice of a key. déterminé par le choix d'une clé.
inverse inverse
transformation transformation
For a given block cipher, the inverse of the permutation of blocks Par un algorithme de chiffrement par bloc donné, l'inverse de la permutation de blocs
that is determined by the choice of a key. qui est déterminé par le choix d'une clé.
key clé
For a given block cipher, the secret bit string that parameterizes the Pour un chiffrement par bloc donné, la chaîne secrète de bits qui paramètre l'
permutations. permutations.
mode mode
See “block cipher mode of operation.” Voir «Mode de chiffrement par bloc de fonctionnement."
numeral chiffre
For a given base, a nonnegative integer less than the base. Pour une base donnée, un entier positif inférieur à la base.
numeral string chaîne numérique
For a given base, a character string that is comprised of numerals for Pour une base donnée, une chaîne de caractères qui est composé de chiffres pour
the base. la base.
plaintext clair
A numeral string whose confidentiality is protected by an FPE Une chaîne numérique dont la confidentialité est protégée par une FPE
mode. Mode.
prerequisite condition préalable
A required input to an algorithm that has been established prior to Une entrée nécessaire pour un algorithme qui a été établi avant l'
the invocation of the algorithm. l'invocation de l'algorithme.
shall doit
Is required to. Est nécessaire pour. Requirements apply to conforming implementations. Exigences s'appliquent aux implémentations conformes.
should devrait
Is recommended to. Il est recommandé à.
tweak modifier
The input parameter to the encryption and decryption functions Le paramètre d'entrée pour les fonctions de chiffrement et de déchiffrement
whose confidentiality is not protected by the mode. dont la confidentialité n'est pas protégée par le mode.

Page 11 Page 11
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
5 5
4.2 Acronyms 4.2 acronymes
AES AES
Advanced Encryption Standard. Advanced Encryption Standard.
CAVP CAVP
Cryptographic Algorithm Validation Program. Cryptographic Algorithm Validation Program.
CCN CCN
credit card number. numéro de carte de crédit.
CMVP PVMC
Cryptographic Module Validation Program. Cryptographic Module Validation Program.
FIPS FIPS
Federal Information Processing Standard. Federal Information Processing Standard.
FISMA FISMA
Federal Information Security Management Act. Loi fédérale sur la gestion de la sécurité de l'information.
FPE FPE
format-preserving encryption. Format de préservation cryptage.
IETF IETF
Internet Engineering Task Force. Internet Engineering Task Force.
ITL ITL
Information Technology Laboratory. Laboratoire de la technologie de l'information.
NIST NIST
National Institute of Standards and Technology. Institut National des Standards et de la Technologie.
PRF PRF
pseudorandom function. fonction pseudo-aléatoire.
RFC RFC
Request For Comment. Demande de commentaire.
SSN SSN
Social Security number. Numéro de sécurité sociale.
4.3 Operations and Functions 4.3 Opérations et fonctions
BYTELEN BYTELEN
(T) (T)
The number of bytes in a byte string, T . Le nombre d'octets dans une chaîne d'octets, T.
CIPH ICPC
K K
( X ) (X)
The output of the designated cipher function of the block cipher La sortie de la fonction de chiffrement désigné du bloc de chiffrement
under the key K applied to the block X . sous la clé K appliqué au bloc X.
LEN LEN
( X ) (X)
The length of the character string X . La longueur de la chaîne de caractères X.
LOG LOG
b b
( x ) (X)
The base b logarithm of the real number x ≠ 0. La base b logarithme du nombre réel x ≠ 0.
NUM NUM
radix base
( X ) (X)
The number that the numeral string X represents in base radix , with Le nombre que la chaîne numérique X représente en base de base, avec
the most significant character first. le personnage le plus significatif en premier.
PRF PRF
( X ) (X)
The output of the function La sortie de la fonction
PRF PRF
applied to the block X with the appliqué à la séquence X avec la

Page 12 Page 12
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
6 6
designated cipher function of the block cipher under the key K . fonction de chiffrement désigné de chiffrement par bloc sous la clé K.
REV REV
( X ) (X)
Given a bit string, X , the string that consists of the bits of X in Etant donné une suite de bits, X, qui se compose de la chaîne de bits de X en
reverse order. l'ordre inverse.
STR STR
m m
radix base
( x ) (X)
Given a nonnegative integer x less than radix Étant donné un entier positif x moins radix
m m
, the representation of , La représentation de
x as a string of m characters in base radix , with the most significant x en tant que chaîne de caractères en base m de base, avec le plus important
character first. premier caractère.
⌊ x ⌋ ⌊ x ⌋
The greatest integer that does not exceed the real number x . Le plus grand entier qui ne dépasse pas le nombre réel x.
x x
The least integer that is not less than the real number x . Le plus petit entier qui n'est pas inférieur au nombre réel x.
[ x ] [X]
s s
Given a nonnegative integer x less than 256 Étant donné un entier positif x inférieur à 256
s s
, the representation of x , La représentation de x
as a string of s bytes. comme une chaîne de s octets.
[ i .. j ] [I .. j]
The set of integers between two integers i and j , including i and j . L'ensemble des nombres entiers compris entre deux entiers i et j, y compris i et j.
x mod m x mod m
The nonnegative remainder of the real number x modulo the positive Le reste non négatif du nombre réel x modulo le positif
integer m. m nombre entier.
X [ i ] X [i]
The i th character of the string X . L'e caractère i de la chaîne X.
X [ i .. j ] X [i .. j]
The substring of characters of a string X from X [ i ] to X [ j ], including La chaîne de caractères d'une chaîne X de X [i] X [j], y compris
X [ i ] and X [ j ]. X [i] et X [j].
X ⊕ Y X ⊕ Y
The bitwise exclusive-OR of bit strings X and Y whose bit lengths Le bit à bit OU exclusif de chaînes de bits X et Y dont les longueurs de bits
are equal. sont égaux.
X || Y X || Y
The concatenation of bit strings X and Y . La concaténation de chaînes de bits X et Y.
0 0
s s
The bit string that consists of s consecutive '0' bits. La chaîne de bits qui consiste à s '0' bits consécutifs.
4.4 Examples of Basic Operations and Functions 4.4 Exemples d'opérations de base et Fonctions
In this publication, the Courier New font indicates the two binary bits, 0 and 1 . Dans cette publication, la police Courier New indique les deux bits binaires, 0 et 1.
Given positive real numbers b and x , the base b logarithm of x , denoted Compte tenu de nombres positifs réels b et x, la base b logarithme de x, noté
LOG LOG
b b
( x ), is the unique (X), est l'unique,
real number for which b nombre réel pour lequel b
LOG LOG
b b
( x ) (X)
= x . = X. For example, Par exemple,
LOG LOG
2 2
(64) = 6, (64) = 6,
LOG LOG
2 2
(10) ≈ 3.32, and (10) ≈ 3,32, et
LOG LOG
13 13
(169) = (169) =
2. 2.
Given a real number x , the floor function, denoted ⌊ x ⌋, is the greatest integer that does not exceed Étant donné un nombre réel x, la fonction de-chaussée, noté ⌊ x ⌋, est le plus grand entier qui ne dépasse pas
x . x. For example, ⌊2.1⌋= 2, and ⌊4⌋= 4. Par exemple, ⌊2.1⌋ = 2, et ⌊4⌋ = 4.
Given a real number x , the ceiling function, denoted  x , is the least integer that is not less than x . Compte tenu d'un nombre réel x, la fonction de plafond, notée x  , est le plus petit entier qui n'est pas inférieur à x.
For example, 2.1 = 3, and 4 = 4. Par exemple, 2.1 = 3, et 4 = 4.

Page 13 Page 13
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
7 7
Given two integers i and j with i ≤ j , the set of integers between i and j , including i and j , is Étant donné deux entiers i et j avec i ≤ j, l'ensemble des nombres entiers compris entre i et j, y compris i et j, est
denoted [ i .. j ]. noté [i .. j]. For example, [2 .. 5] = {2, 3, 4, 5}. Par exemple, [2 .. 5] = {2, 3, 4, 5}.
Given a real number x , and a positive integer m , the remainder of x modulo m , denoted x mod m , Compte tenu d'un nombre réel x et un entier positif m, le reste de x modulo m, notée x mod m,
is x – m ⌊ x / m ⌋. est x - m ⌊ x / m ⌋. For example, 20 mod 7 = 6, and -3 mod 7 = 4. Par exemple, 20 mod 7 = 6, et 7 = -3 mod 4.
Given a positive integer s , 0 Étant donné un entier positif s, 0
s s
denotes the string that consists of s ' 0 ' bits. désigne la chaîne qui est constitué des «bits 0 s. For example, 0 Par exemple, 0
8 8
= =
00000000 . 00000000.
The concatenation operation on character strings is denoted ||. L'opération de concaténation sur les chaînes de caractères est notée ||. For example, 001 || 10111 = Par exemple, 001 || 10111 =
00110111 , and if the base is 16, for example, 1 3 13 7 || 0 8 10 = 1 3 13 7 0 8 10. 00110111, et si la base est de 16, par exemple, 1 3 13 7 0 8 10 || = 1 3 13 7 8 0 10.
Given bit strings of equal length, the exclusive-OR (XOR) operation, denoted ⊕, specifies the Chaînes de bits données de longueur égale, le OU exclusif (XOR), notée ⊕, précise le
addition, modulo 2, of the bits in corresponding bit positions. addition modulo 2, des bits dans des positions de bits correspondantes. For example, 10011 ⊕ 10101 = Par exemple, 10 011 10 101 = ⊕
00110 . 00110.
Given a character string X , the length of X is denoted Compte tenu d'une chaîne de caractères X, la longueur de X est notée
LEN LEN
( X ). (X). For example, Par exemple,
LEN LEN
( %$$ ) = 3, and (% $$) = ​​3, et
LEN LEN
( 00010 ) = 5. (00 010) = 5.
Given a byte string X , the length of X in bytes is denoted Compte tenu d'une chaîne octet X, la longueur en octets de X est notée
BYTELEN BYTELEN
( X ). (X). For example, Par exemple,
BYTELEN BYTELEN
( 1011100110101100 ) = 2. (1011100110101100) = 2.
Given a character string X , and any index i , ie, with 1 ≤ i ≤ Étant donné une chaîne de caractères X, et tout indice i, c'est à dire, avec 1 ≤ i ≤
LEN LEN
( X ), the i th character of X is (X), la i-ème caractère de X est
denoted X [ i ]. notée X [i]. For a pair of indices ( i , j ), with 1≤ i ≤ j ≤ Pour une paire d'indices (i, j), avec 1≤ i ≤ j ≤
LEN LEN
( X ), the substring of characters from (X), la sous-chaîne de caractères à partir de
X [ i ] to X [ j ] is denoted X [ i .. j ]. X [i] X [j] est notée X [i .. j]. For example, if X = &$*#@@% , then X[2]= $ , X[3..5]= *#@ . Par exemple, si X = & $ * #@@%, alors X [2] = $, X [3..5] = * # @.
Given a base, radix , and a length, m , there are radix Compte tenu d'une base, base, et une longueur, m, il ya radix
m m
distinct numeral strings. chaînes numériques distinctes. Given an integer x Compte tenu d'un nombre entier x
such that 0 ≤ x < radix tel que 0 ≤ x <radix
m m
, the integer-to-string function, denoted , La fonction entier à chaîne, notée
STR STR
m m
radix base
( x ), is the representation (X) est la représentation
of x as a numeral string of length m in base radix , with the most significant character first, ie, on de x en tant que chaîne numérique de longueur m en base de base, avec le caractère plus significatif en premier, c'est à dire, sur
the left. la gauche. For example, Par exemple,
STR STR
4 4
12 12
(559) is the string of four numerals in base 12 that represents 559, (559) est la chaîne de quatre chiffres en base 12 qui représente 559,
namely, 0 3 10 7. An algorithm for computing à savoir, 3 0 7 10 Un algorithme pour le calcul
STR STR
m m
radix base
( x ) is given in Sec. 5.5. (X) est donnée à la Sec. 5.5.
A separate notation is given for the conversion of integers to byte strings: [ x ] Une notation est donnée distincte pour la conversion d'entiers en chaînes d'octets: [x]
s s
= =
STR STR
8 s 8 s
2 2
( x ). (X). For Pour
example, [1] exemple [1],
1 1
= 00000001 . = 00000001.
Given a (non-empty) numeral string X in base radix of length m , the string-to-integer function, Compte tenu d'une (non vide) chaîne numérique X en base de base de longueur m, la fonction string-à-entier,
denoted notée
NUM NUM
radix base
( X ), is the integer x such that (X) est le nombre entier x tel que
STR STR
m m
radix base
( x ) = X . (X) = x. In other words, En d'autres termes,
NUM NUM
radix base
( X ) is the (X) est le
non-negative integer less than radix entier non négatif inférieur radix
LEN LEN
( X ) (X)
whose most-significant-character-first representation in dont le plus important-character-première représentation en
base radix is X . base de base est X. For example, Par exemple,
NUM NUM
2 2
( 00011010 ) = 26. An algorithm for computing (00011010) = 26 Un algorithme pour le calcul
NUM NUM
radix base
( X ) (X)
is given in Sec. 5.5. est donnée à la Sec. 5.5.
Given a bit string, X , the string Étant donné une chaîne de bits, X, la chaîne
REV REV
( X ) is the concatenation of the bits of X in reverse order. (X) est la concaténation des bits de X dans l'ordre inverse. For Pour
example, Ainsi,
REV REV
( 00001 ) = 10000. (00001) = 10000.

Page 14 Page 14
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
8 8
5 Preliminaries 5 Préliminaires
5.1 Character Strings 5.1 chaînes de caractères
A finite set of two or more symbols is called an alphabet, and the elements of an alphabet are Un ensemble fini de deux ou plusieurs symboles est appelé un alphabet, et des éléments d'un alphabet sont
called characters. appelés caractères. A character string is a finite sequence of characters from an alphabet. Une chaîne de caractères est une séquence finie de caractères d'un alphabet.
Individual characters may repeat in the string. Les caractères individuels peuvent répéter dans la chaîne. Thus, for example, given the alphabet of lower- Ainsi, par exemple, compte tenu de l'alphabet de-inférieur
case English letters, cas des lettres anglaises,
{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z}, {A, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y , z},
the words “ hello ” and “ cannot ” are character strings, but “ Hello ” and “ can't ” are not, les mots "bonjour" et "ne peuvent pas" sont des chaînes de caractères, mais "Bonjour" et "ne peut pas" ne sont pas,
because the symbols “ H ” and “ ' ” are not in the alphabet. parce que les symboles "H" et "" ne sont pas dans l'alphabet.
The number of characters in an alphabet is called the base, denoted radix , so that radix ≥ 2 by Le nombre de caractères dans un alphabet est appelé la base, notée base, de sorte que radix ≥ 2 par
definition. définition. For a given base, a numeral is a nonnegative integer that is less than the base. Pour une base donnée, un nombre est un entier positif qui est inférieur à la base.
The base is a parameter of FF1, FF2, and FF3, and their specifications assume that the alphabet La base est un paramètre de FF1, FF2, FF3 et, et leurs spécifications supposer que l'alphabet
is the set of numerals for the base: est l'ensemble des nombres de la base:
{0, 1, …, radix -1}. {0, 1, ..., -1} radix.
Therefore, to apply FF1, FF2, or FF3 to character strings from an arbitrary alphabet, the string Donc, pour appliquer FF1, FF2, FF3 ou de chaînes de caractères d'un alphabet arbitraire, la chaîne
must first be converted, via a one-to-one correspondence, into a string of numerals for the base of doit d'abord être converti, par l'intermédiaire d'une correspondance un-à-un, en une chaîne de chiffres pour la base de
the alphabet. l'alphabet. For example, the natural conversion from lower-case English letters to base 26 Par exemple, la conversion naturelle de minuscules lettres anglaises à base 26
numerals is chiffres est
a→0, b→1, c→2, … x→23, y→24, z→25, a → 0, b → 1, c → 2, ... x → 23, y → 24, z → 25,
although other one-to-one correspondences are possible. bien que d'autres correspondances one-to-one sont possibles. The choice and implementation of Le choix et la mise en œuvre de
conversion methods from particular alphabets to their appropriate alphabets of numerals is méthodes de conversion de alphabets particuliers à leurs alphabets appropriés de chiffres quelles
outside the scope of this publication. en dehors de la portée de la présente publication.
The interpretation of a numeral string as a number depends on the base and the ordering L'interprétation d'une chaîne numérique comme une fonction du nombre de base et la commande
convention; convention; algorithms for functions that convert numeral strings to numbers and vice versa are algorithmes pour les fonctions qui convertissent les chaînes numériques pour les nombres et vice versa sont
given in Sec. donné à la Sec. 5.5. 5.5. Individual numerals, and other numbers in the specifications, are represented Chiffres individuels, et d'autres numéros dans le cahier des charges, sont représentés
in base 10. en base 10.
The basic operations and functions on strings are defined with examples in Sec. Les opérations et les fonctions de base sur les chaînes sont définies avec des exemples en Sec. 4.4. 4.4.
5.2 Underlying Block Cipher and Key 5.2 sous-jacente de chiffrement par bloc et la clé
The encryption and decryption functions of FF1, FF2, and FF3 feature a block cipher as the main Les fonctions de chiffrement et de déchiffrement de FF1, FF2, FF3 et disposent d'un chiffrement par bloc comme le principal
component; composant; thus, each of these FPE mechanisms is a mode of operation (mode, for short) of the ainsi, chacun de ces mécanismes de FPE est un mode de fonctionnement (mode, pour faire court) de la
block cipher. chiffrement par bloc.

Page 15 Page 15
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
9 9
For any given key, K , the underlying block cipher of the mode is a permutation, ie, an invertible Pour une touche donnée, K, le chiffrement par bloc sous-jacent de la mode est une permutation, c'est à dire, un inversible
transformation on bit strings of a fixed length; transformation sur des chaînes de bits de longueur fixe; the fixed-length bit strings are called blocks, and les chaînes de bits de longueur fixe sont appelées blocs, et
the length of a block is called the block size. la longueur d'un bloc est appelée la taille de bloc. For an FPE mode, as part of the choice of the Pour un mode de FPE, dans le cadre du choix de l'
underlying block cipher with the key, either the forward transformation or the inverse chiffrement par bloc sous-jacent à la clé, soit la transformation inverse vers l'avant ou l'
transformation transformation
2 2
is specified as the designated cipher function, denoted est spécifié que la fonction de chiffrement désigné, notée
CIPH ICPC
K K
. . The inverse of L'inverse de
CIPH ICPC
K K
is not needed for the modes that are specified in this publication. n'est pas nécessaire pour les modes qui sont spécifiés dans la présente publication.
For each of the three modes, the underlying block cipher shall be approved, and the block size Pour chacun de ces trois modes, le chiffrement par bloc sous-jacent est approuvé, et la taille de bloc
shall be 128 bits. doit être de 128 bits. Currently, the AES block cipher, with key lengths of 128, 192, or 256 bits, is Actuellement, les AES chiffrement par bloc, avec des longueurs de clé de 128, 192 ou 256 bits, est
the only block cipher that fits this profile. le seul chiffrement par bloc qui correspond à ce profil.
The choice of the key length affects the security of the FPE modes, eg, against brute-force Le choix de la longueur de la clé touche la sécurité des modes de FPE, par exemple, contre la force brute
search, and also affects the details of the implementation of the AES algorithm. recherche, et affecte également les détails de la mise en oeuvre de l'algorithme AES. Otherwise, the Dans le cas contraire, l'
key length does not affect the implementation of FF1, FF2, and FF3, and the choice of the key longueur de clé n'affecte pas la mise en œuvre de FF1, FF2, FF3 et, et le choix de la clé
length is not explicitly indicated in their specifications Methods for generating cryptographic longueur n'est pas indiqué explicitement dans leurs méthodes de spécifications pour générer cryptographique
keys are discussed in [9]; the goal is to select the keys uniformly at random, ie, for each les touches sont décrits dans [9], le but est de sélectionner les touches uniformément au hasard, c'est à dire, pour chaque
possible key to occur with equal probability. clé possible de se produire avec une probabilité égale.
The key shall be kept secret, ie, disclosed only to parties that are authorized to know the La clé doit être tenue secrète, c'est à dire, communiqués qu'aux partis qui sont autorisés à connaître la
protected information. renseignements protégés. Compliance with this requirement is the responsibility of the entities Le respect de cette exigence est de la responsabilité des entités
using, implementing, installing, or configuring applications that incorporate this l'aide, la mise en œuvre, l'installation ou la configuration des applications qui intègrent cette
Recommendation. Recommandation. The management of cryptographic keys is outside the scope of this La gestion des clés de chiffrement sort du cadre de cette
publication. publication.
5.3 Encryption and Decryption Functions 5.3 Fonctions de chiffrements décryptage
For a given key, denoted K , for the designated block cipher, FF1, FF2, and FF3 each consist of Pour une clé donnée, notée K, pour le chiffrement par bloc désigné, FF1, FF2, FF3 et se composent chacune de
two related functions: encryption and decryption. deux fonctions connexes: chiffrement et le déchiffrement. The encryption function takes as input a La fonction de chiffrement prend en entrée un
numeral string called the plaintext, denoted X , and an additional parameter, called the tweak, chaîne numérique appelé le texte en clair, notée X, et un paramètre supplémentaire, appelé le tweak,
denoted T ; notée T; the function returns a numeral string called the ciphertext, denoted Y , with the same la fonction renvoie une chaîne numérique appelé le cryptogramme, notée Y, avec le même
length as X . X longueur. Similarly, the inputs to the decryption function are a numeral string X and a tweak T ; De même, les entrées de la fonction de décryptage sont d'une chaîne numérique X et un tweak T;
the output is a numeral string Y of the same length as X . la sortie Y est une chaîne numérique de la même longueur que X.
For FF1, the encryption function and the decryption function are denoted FF1.Encrypt( K , T , X ) Pour FF1, la fonction de chiffrement et la fonction de déchiffrement sont désignés FF1.Encrypt (K, T, X)
and FF1.Decrypt( K , T , X ), with analogous notation for FF2 and FF3. et FF1.Decrypt (K, T, X), avec notation analogue pour FF2 et FF3.
For a given tweak, the decryption function is the inverse of the encryption function, so that Pour un coup sec donné, la fonction de déchiffrement est l'inverse de la fonction de chiffrement, de sorte que
FF1.Decrypt( K , T , FF1.Encrypt( K , T , X )) = X . FF1.Decrypt (K, T, FF1.Encrypt (K, T, X)) = x.
Thus, when a ciphertext is the input to the decryption function, along with the same tweak that Ainsi, quand un texte chiffré est l'entrée de la fonction de déchiffrement, avec le même coup sec que
was used to generate the ciphertext, the output is the corresponding plaintext. a été utilisé pour produire le texte chiffré, la sortie est du texte en clair correspondant.
2 2
The forward transformation and the inverse transformations are sometimes referred to as the “enrypt” and La transformation directe et la transformation inverse sont parfois désignés sous le nom de «enrypt" et
“decrypt” functions, respectively, of the block cipher; "Décrypter" fonctions, respectivement, du bloc de chiffrage; however, in this publication, those terms are reserved for Cependant, dans cette publication, les termes sont réservés pour
functions of the FPE modes. fonctions des modes FPE.

Page 16 Page 16
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
10 10
The tweak may be any information that can be associated to the input numeral string and does Le tweak peut être n'importe quelle information qui peut être associée à l'entrée chaîne numérique et fait
not need to be kept secret. pas besoin d'être gardé secret. Although implementations may fix the value of the tweak, the use of Bien que les implémentations peuvent fixer la valeur du tweak, l'utilisation de
variable tweaks is strongly recommended as a security enhancement; réglages variables est fortement recommandé comme une amélioration de la sécurité; see Appendix C. In FF1 voir l'annexe C. Dans FF1
and FF3, tweaks are bit strings; et FF3, tweaks sont des chaînes de bits; in FF2, tweaks may also be character strings in a different base. dans FF2, réglages peuvent également être des chaînes de caractères dans une base différente.
The tweak lengths that can be supported differ for each of the three modes; Les longueurs de tweak qui peuvent être pris en charge diffèrent pour chacun des trois modes; see the individual voir l'individu
specifications in Sec. 6. spécifications Sec. 6.
The key, K , is indicated in the notation as an input for the encryption and decryption functions; La clé K, est indiqué dans la notation comme entrée pour les fonctions de chiffrement et de déchiffrement;
however, in the specifications in this publication, the key is listed as a prerequisite, ie, an input Toutefois, dans les spécifications de cette publication, la clé est répertorié comme une condition préalable, c'est-à-une entrée
that is usually established prior to the invocation of the function. qui est habituellement établi avant l'appel de la fonction.
3 3
Several other prerequisites are Plusieurs autres conditions préalables sont
omitted from the above notation, such as the underlying block cipher, the designation of CIPH omis de la notation ci-dessus, tel que le chiffrement par bloc sous-jacent, la désignation de l'ICPC
K K
, ,
and the base for the numeral strings. et le point de départ pour les chaînes de caractères numériques.
5.4 Feistel Structure 5.4 Structure de Feistel
FFX schemes, including FF1, FF2, and FF3, are based on the Feistel structure for encryption. FFX régimes, y compris FF1, FF2, FF3, et sont basés sur la structure de Feistel pour le chiffrement.
The Feistel structure consists of several iterations, called rounds, of a reversible transformation, La structure de Feistel est constitué de plusieurs itérations, appelé tours, d'une transformation réversible,
which consists of three elements: 1) the data is split into two parts; qui se compose de trois éléments: 1) les données est divisé en deux parties; 2) a keyed function, F 2) une fonction clé, F
K K
, ,
called the round function, is applied to one part of the data in order to modify the other part of appelé la fonction de tour, est appliquée à une partie des données de façon à modifier l'autre partie de
the data; les données; and 3) the roles of the two parts are swapped for the next round. et 3) les rôles des deux parties sont inversés pour le prochain tour. The structure is La structure est
illustrated in Figure 1 below. illustré sur la figure 1 ci-dessous. Four rounds are shown in this example, but ten rounds are actually Quatre séries sont présentés dans cet exemple, mais dix tours sont en fait
specified for FF1 and FF2, and eight rounds for FF3. spécifiée pour FF1 et FF2, et huit tours pour FF3.
The two parts of the input numeral string, denoted A Les deux parties de la chaîne d'entrée numérique, noté A
0 0
and B et B
0 0
, consist of u and v characters, , Composé de u et v de caractères,
respectively; respectivement; the total number of characters, u + v , is denoted n . le nombre total de caractères, u + v, est notée n. The rounds are indexed from 0 to Les tours sont indexés de 0 à
3 in the figure. Dans la figure 3. During round i , the round function F Pendant i rond, la fonction de tour F
K K
is applied to B est appliqué à B
i Je
, with the tweak T , the round , Avec le tweak T, le tour
number i , and the length n , as additional inputs, and the result is used to modify A nombre i, et la longueur n, comme entrées supplémentaires, et le résultat est utilisé pour modifier une
i Je
, via modular , Via modulaire
addition addition
4 4
, indicated by +, on the numbers that the strings represent , Indiqué par +, sur les nombres qui représentent les cordes
5 5
. . The string that represents La chaîne qui représente
the resulting number is named with a temporary variable, C le nombre résultant est appelé avec une variable temporaire, C
i Je
. . The roles of the parts are swapped Les rôles des parties sont échangés
for the next round, so that the modified A pour le prochain tour, de façon que la modification
i Je
, ie, C , C'est à dire, C
i Je
, becomes B , Devient B
i +1 i 1
, and B Et B
i Je
becomes A devient un
i +1 i 1
. .
The rectangles containing the two parts of the data in each round are different sizes to illustrate Les rectangles qui contiennent les deux parties des données à chaque cycle sont de tailles différentes afin d'illustrer
that, if n is odd, then u cannot equal v . que, si n est impair, alors u ne peut pas égaler v. In order to accommodate such cases, the round function is Afin de tenir compte de tels cas, la fonction de tour est
constructed so that the lengths of its input and output strings depend on whether the round construit de telle sorte que les longueurs de ses chaînes d'entrée et de sortie varient selon que la ronde
number index, i , is even or odd. numéro d'index, i, est pair ou impair.
The Feistel structure for decryption is almost identical; La structure de Feistel pour le décryptage est presque identique; the only changes are 1) modular addition les seuls changements sont: 1) plus modulaire
is replaced by modular subtraction, and 2) the order of the round indices is reversed. est remplacé par soustraction modulaire, et 2) l'ordre des indices rondes est inversée. For Pour
example, in Figure 1, the arguments to F Ainsi, sur la figure 1, les arguments de F
K K
would begin at n , T , 3 at the top, and end at n , T , 0 at commencerait à n, T, 3 en haut, et se terminera à n, T, 0 à
the bottom. le fond.
3 3
The distinction doesn't affect the execution of the function: all inputs are required, independent of when they were La distinction n'affecte pas l'exécution de la fonction: toutes les entrées sont nécessaires, indépendamment de quand ils étaient
established or provided to the implementation. établis ou fournis à la mise en œuvre.
4 4
In principle, the addition operation can be any other reversible operation on strings that preserves their length; En principe, l'opération d'addition peut être de toute autre opération réversible sur des chaînes qui préserve leur longueur; for pour
example, the FFX specification [1] supports an option for characterwise addition. exemple, la spécification FFX [1] prend en charge une option pour plus de characterwise.
5 5
The ordering convention for the interpretation of strings is different for FF3 than for FF1 and FF2. La convention de commande pour l'interprétation de chaînes est différent pour FF3 que pour FF1 et FF2.

Page 17 Page 17
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
11 11
Figure 1: Illustration of the Feistel Structure Figure 1: Illustration de la structure de Feistel
5.5 Component Functions 5.5 Fonctions des composants
This section gives algorithms for the component functions that are called in the specifications of Cette section donne des algorithmes pour les fonctions des composants que l'on appelle dans le cahier des charges
FF1, FF2, and FF3. FF1, FF2, FF3 et. The conversion functions Les fonctions de conversion
NUM NUM
radix base
( X ) and (X) et
STR STR
m m
radix base
( x )—defined in Sec. (X) -defined en Sec. 4.4 4.4
with examples—are specified in Algorithms 1 and 2. These functions support the ordering avec des exemples-sont spécifiés dans les algorithmes 1 et 2 Ces fonctions prennent en charge la commande
convention for the numeral strings in FF1 and FF2, namely, that the first (ie, left-most) numeral convention pour les chaînes numériques de FF1 et FF2, à savoir que le premier (c'est à dire, plus à gauche) chiffre
of the string is the most-significant numeral. de la chaîne est le chiffre le plus significatif.
A A
0 0
B B
0 0
B B
1 1
← C ← C
0 0
A A
1 1
← B ← B
0 0
A A
2 2
← B ← B
1 1
B B
2 2
← C ← C
1 1
B B
3 3
← C ← C
2 2
A A
3 3
← B ← B
2 2
A A
4 4
← B ← B
3 3
B B
4 4
← C ← C
3 3
n , T , 0 n, T, 0
u characters caractères u
v characters v caractères
F Fa
K K
n , T , 1 n, T, 1
n , T , 2 n, T, 2
n , T , 3 n, T, 3
F Fa
K K
F Fa
K K
F Fa
K K
+ +
+ +
+ +
+ +

Page 18 Page 18
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
12 12
The function La fonction
REV REV
( X ) )—defined in Sec. (X)) -defined en Sec. 4.4 with an example—is specified in Algorithm 3. It is 4.4 avec un exemple-est spécifié dans l'algorithme 3 Il est
used to adapt Permet d'adapter
NUM NUM
radix base
( X ) and (X) et
STR STR
m m
radix base
( x ) to the opposite ordering convention, for the numeral (X) à la convention de commande opposé, pour le chiffre
strings in FF3. chaînes de FF3.
The La
PRF PRF
function, specified in Algorithm 4, essentially invokes the Cipher Block Chaining fonction, spécifiée dans l'algorithme 4, invoque essentiellement la Cipher Block Chaining
encryption mode [ 7] o n the input bit string and returns the final block of the ciphertext; mode de cryptage [ 7] o n la chaîne de bits d'entrée et renvoie le dernier bloc de texte chiffré; this ce
function is the pseudorandom core of the Feistel round function for FF1.Encrypt and fonction est le noyau pseudo-aléatoire de la fonction de tour de Feistel pour FF1.Encrypt et
FF1.Decrypt. FF1.Decrypt.
Algorithm 1: Algorithme 1:
NUM NUM
radix base
( X ) (X)
Prerequisite: Pré-requis:
Base, radix . Base, base.
Input : Entrée:
Numeral string, X . Chaîne numérique, X.
Output : Sortie:
Number, x. Nombre, x.
Steps : Étapes:
1. Let x = 0. 1 Soit x = 0.
2. 2.
For i from 1 to Pour i allant de 1 à
LEN LEN
( X ), let x = x ⋅ radix + X [ i ]. (X), soit x = x ⋅ base + X [i].
3. 3.
Return x . Retour x.
Algorithm 2: Algorithme 2:
STR STR
m m
radix base
( x ) (X)
Prerequisites: Pré-requis:
Base, radix ; Base, base;
String length, m . La longueur des chaînes, m.
Input : Entrée:
Number, x , such that x < radix Nombre, x tels que x <radix
m m
. .
Output : Sortie:
Numeral string, X. Chaîne numérique, X.
Steps : Étapes:
1. For i from 1 to m : 1 Pour i allant de 1 à m:
i. i.
X [ m +1- i ] = x mod radix X [m + 1 i] = x radix mod
; ;
ii. ii.
x =x/ radix . x =x / radix .
2. Return X . 2 Retour X.

Page 19 Page 19
NIST Special Publication 800-38G NIST spécial 800-38G de publication
DRAFT PROJET
13 13
Algorithm 3: Algorithme 3:
REV REV
( X ) (X)
Input : Entrée:
Character string, X . Chaîne de caractères, X.
Output : Sortie:
Character string, Y. Chaîne de caractères, Y.
Steps : Étapes:
1. For i from 1 to 1 Pour i allant de 1 à
LEN LEN
( X ) let Y [ i ]= X [ (X) Soit Y [i] = X [
LEN LEN
( X )+1- i ]. (X) + 1 i].
2. Return Y [0 .. 2. retour Y [0 ..
LEN LEN
( X )-1]. (X) -1].
Algorithm 4: Algorithme 4:
PRF PRF
( X ) (X)
Prerequisites : Pré-requis:
Approved, 128-bit block cipher, Approuvé, chiffrement par blocs de 128 bits,
CIPH ICPC
; ;
Key, K , for the block cipher; Clé, K, pour le chiffrement par bloc;
Input : Entrée:
Nonempty bit string, X , such that Chaîne de bits non vide, X, tels que
LEN LEN
( X ) is a multiple of 128. (X) est un multiple de 128.
Output : Sortie:
Block, Y. Bloquer, Y.
Steps : Étapes:
1. Let m = 1 Soit m =
LEN LEN
( X ) / 128. (X) / 128.
2. 2.
Partition X into m blocks X Cloison X en m blocs X
1 1
,…, X , ..., X
m m
, so that X = X , De sorte que X = X
1 1
|| …|| X || ... || X
m m
and et
LEN LEN
( X (X
i Je
) = 128 for all i ) = 128 pour tout i
from 1 to m . de 1 à m.
3. 3.
Let Y Soit Y
0 0
= 0 = 0
128 128
, and for j from 1 to m let Y , Et pour j de 1 à m laisser Y
j j
= =
CIPH ICPC
K K
( Y (Y
j -1 j -1
⊕ X ⊕ X
j j
). ).
4. Return Y 4. retour Y
m m
. .
6 Mode Specifications 6 mode Spécifications
The specifications of FF1, FF2, and FF3 are presented in this section, organized into Les spécifications de FF1, FF2, FF3 et sont présentés dans cette section, organisée en
prerequisites, inputs, outputs, steps, and descriptions of the steps. conditions, entrées, sorties, marches, et les descriptions des étapes. In addition to the key and En plus de la clé et
designated cipher function, each mode has prerequisites for the choices of the base, radix , and of fonction de chiffrement désigné, chaque mode a conditions pour le choix de la base, base, et de
the range of lengths, [ minlen .. maxlen ], for the numeral string inputs that the implementation la gamme de longueurs, [minlen .. maxlen], pour les entrées de chaînes numériques que la mise en œuvre
supports. soutient. FF1 and FF2 also have a prerequisite for the choice of the maximum tweak length, FF1 et FF2 ont également une condition préalable pour le choix de la longueur maximale de tweak,
maxTlen , that the implementation supports, and FF2 has an additional parameter, tweakradix , for maxTlen, qui soutient la mise en œuvre, et FF2 a un paramètre supplémentaire, tweakradix, pour
the choice of the base for tweak strings. le choix de la base de chaînes de tweak. For all of these parameters, the choices that are allowed Pour l'ensemble de ces paramètres, les choix qui sont autorisés
for the individual modes are described within the prerequisites. Pour chacun des modes sont décrites dans les conditions.
The parameter choices may affect interoperability. Les choix de paramètres peuvent affecter l'interopérabilité. The behavior of an implementation when
presented with incorrect inputs is out of the scope of this Recommendation.

Page 20 Page 20
NIST Special Publication 800-38G
DRAFT
14 14
6.1 FF1
The specifications for the FF1.Encrypt and FF1.Decrypt functions are given in Algorithms 5 and
6 below. The tweak, T , is optional in that it may be the empty string, with byte length t= 0.
The parameters radix , minlen , maxlen , and maxTlen in FF1.Encrypt and FF1.Decrypt shall meet
the following requirements:
• radix ∈ [2 .. 2
16 16
];
• radix
minlen
≥ 100;
• minlen ≥ 2;
• maxlen < 2
32 32
; ; and et
• maxTlen < 2
32 32
. .
Algorithm 5: FF1.Encrypt( K , T , X )
Prerequisites:
Approved, 128-bit block cipher,
CIPH
; ;
Key, K , for the block cipher;
Base, radix , for the character alphabet;
Range of supported message lengths, [ minlen .. maxlen ];
Maximum byte length for tweaks, maxTlen .
Inputs :
Character string, X , in base radix of length n such that n ∈ [ minlen .. maxlen ];
Tweak T , a byte string of byte length t , such that t ∈ [0 .. maxTlen ] .
Output :
Character string, Y, such that
LEN
( Y ) = n.
Steps : Étapes:
1. 1.
Let u =  n /2; v = n – u .
2. Let A = X [1 .. u ]; B = X [ u + 1 .. n ].
3. 3.
Let b =   v
LOG
2 2
( radix ) / 8; d = 4  b/ 4 + 4
4. 4.
Let P = [1]
1 1
|| [2]
1 1
|| [1]
1 1
|| [ radix ]
3 3
|| [10]
1 1
|| [ u mod 256]
1 1
|| [ n ]
4 4
|| [ t ]
4 4
. .
5. 5.
For i from 0 to 9:
i. i.
Let Q = T || [0]
( −t−b− 1) mod 16
|| [ i ]
1 1
|| [
NUM NUM
radix
( B )]
b b
. .
ii. ii.
Let R =
PRF
( P || Q ).
iii. iii. Let S be the first d bytes of the following string of ⌈ d /16⌉ blocks:
R ||
CIPH
K K
( R ⊕ [1]
16 16
) ||
CIPH
K K
( R ⊕ [2]
16 16
) || … ||
CIPH
K K
( R ⊕ [⌈ d /16⌉ -1]
16 16
). ).
iv. iv. Let y =
NUM NUM
2 2
( S ).
v. v.
If i is even, let m = u ; else, let m = v .
vi. Let c = (
NUM NUM
radix
( A ) + y ) mod radix
m m
. .
vii. Let C =
STR
m m
radix
( c ).

Page 21 Page 21
NIST Special Publication 800-38G
DRAFT
15 15
viii. viii. Let A = B .
ix. Let B = C .
6. 6.
Return A || B .
Description Description
The “split” of the numeral string X into two substrings, A and B , is performed in Steps 1 and 2.
If n is even,
LEN
( A )=
LEN
( B ); otherwise, autrement,
LEN
( A )=
LEN
( B )–1. The byte lengths b and d , which are
used in Steps 5i and 5iii, are defined in Step 3.
6 6
A fixed block, P , used as the initial block for the
invocation of the function
PRF
in Step 5ii, is defined in Step 4. An iteration loop for the ten
Feistel rounds of FF1 is initiated in Step 5, executing nine substeps for each round, as follows:
The tweak, T , the substring, B , and the round number, i , are encoded as a binary string, Q , in
Step 5i. The function
PRF
is applied to the concatenation of P and Q in Step 5ii, to produce a
block, R , which is either truncated or expanded to a byte string, S , with the appropriate number
of bytes, d , in Step 5iii. (In Figure 1 Error! Reference source not found. , S corresponds to the
output of F
K K
.) In Steps 5iv to 5vii, S is combined with the substring A to produce a numeral string
C in the same base and with the same length. (In Figure 1, the combining of S with A is indicated
by the “+” operation.) In particular, in Step 5iv, S is converted to a number, y . In Step 5v, the
length , m , of A for this Feistel round is determined. In Step 5vi, y is added to the number
represented by the substring A and the result is reduced modulo the m th power of radix , yielding
a number, c , which is converted to a numeral string in Step 5vii. In Steps 5viii and 5ix, the roles
of A and B are swapped for the next round: the substring B is renamed as the substring A , and the
modified A (ie, C ) is renamed as B .
This completes one round of the Feistel structure in FF1. After the tenth round, the concatenation
of A and B is returned as the output in Step 6.
Algorithm 6: FF1.Decrypt( K , T , X )
Prerequisites: Pré-requis:
Approved, 128-bit block cipher,
CIPH
; ;
Key, K , for the block cipher;
Base, radix , for the character alphabet;
Range of supported message lengths, [ minlen .. maxlen ];
Maximum byte length for tweaks, maxTlen .
Inputs :
Numeral string, X , in base radix of length n such that n ∈ [ minlen .. maxlen ];
Tweak byte string, T , of byte length t such that t ∈ [0 .. maxTlen ] .
Output :
Numeral string, Y, such that
LEN
( Y ) = n.
6 6
When B is encoded as a byte string in Step 5i, b is the number of bytes in the encoding. The definition of d ensures
that the output of the Feistel round function is at least 4 bytes longer than this encoding of B , which minimizes any
bias in the modular reduction in Step 5vi.

Page 22 Page 22
NIST Special Publication 800-38G
DRAFT
16 16
Steps : Étapes:
1. 1.
Let u =  n /2; v = n – u .
2. Let A = X [1 .. u ]; B = X [ u + 1 .. n ].
3. 3.
Let b =   v
LOG
2 2
( radix )  / 8; d = 4  b/ 4 + 4
4. 4.
Let P = [1]
1 1
|| [2]
1 1
|| [1]
1 1
|| [ radix ]
3 3
|| [10]
1 1
[ u mod 256]
1 1
|| [ n ]
4 4
|| [ t ]
4 4
. .
5. 5.
For i from 9 to 0:
i. i.
Let Q = T || [0]
( −t−b− 1) mod 16
|| [ i ]
1 1
|| [
NUM NUM
radix
( B )]
b b
. .
ii. ii.
Let R =
PRF
( P || Q ).
iii. iii. Let S be the first d bytes of the following string of ⌈ d /16⌉ blocks:
R ||
CIPH
K K
( R ⊕ [1]
16 16
) ||
CIPH
K K
( R ⊕ [2]
16 16
) || … ||
CIPH
K K
( R ⊕ [⌈ d /16⌉ -1]
16 16
). ).
iv. iv. Let y =
NUM NUM
2 2
( S ).
v. v.
If i is even, let m = u ; else, let m = v .
vi. Let c = (
NUM NUM
radix
( A ) – y ) mod radix
m m
. .
vii. Let C =
STR
m m
radix
( c ).
viii. viii. Let A = B .
ix. Let B = C .
6. 6.
Return A || B .
Description :
The FF1.Decrypt algorithm is almost identical to the FF1.Encrypt algorithm; the only differences
are in Step 5, where the order of the indices is reversed, and in Step 5vi, where modular addition
is replaced by modular subtraction.
6.2 FF2
The specifications for the FF2.Encrypt and FF2.Decrypt functions are given in Algorithms 7 and
8 below. The tweak, T , is optional in that it may be the empty string, with byte length t= 0.
The parameters radix , tweakradix , minlen , maxlen , and maxTlen in FF2.Encrypt and
FF2.Decrypt shall meet the following requirements:
• radix ∈ [2 .. 2
8 8
];
• tweakradix ∈ [2 .. 2
8 8
];
• radix
minlen
≥ 100;
• minlen ≥ 2;
• maxlen ≤ 2120/
LOG
2 2
( radix ) if radix is a power of 2;
• maxlen ≤ 298/
LOG
2 2
( radix ) if radix is not a power of 2; and et
• maxTlen < 104/
LOG
2 2
( tweakradix ).
Algorithm 7: FF2.Encrypt( K , T , X )
Prerequisites :
Approved, 128-bit block cipher,
CIPH
; ;

Page 23 Page 23
NIST Special Publication 800-38G
DRAFT
17 17
Key, K , for the block cipher;
Base, radix , for the character alphabet;
Base, tweakradix , for the tweak character alphabet;
Range of supported message lengths, [ minlen .. maxlen ]
Maximum supported tweak length, maxTlen .
Inputs :
Numeral string, X , in base radix of length n such that n ∈ [ minlen .. maxlen ];
Tweak numeral string, T , in base tweakradix of length t such that t ∈ [0 .. maxTlen ].
Output :
Numeral string, Y, such that
LEN
( Y ) = n.
Steps : Étapes:
1. 1.
Let u =  n /2; v = n – u .
2. Let A = X [1 .. u ]; B = X [ u + 1 .. n ].
3. 3.
If t >0, P = [ radix ]
1 1
|| [ t ]
1 1
|| [ n ]
1 1
|| [
NUM NUM
tweakradix
( T )]
13 13
; ; else P = [ radix ]
1 1
|| [0]
1 1
|| [ n ]
1 1
|| [0]
13 13
. .
4. 4.
Let J =
CIPH
K K
( P )
5. 5.
For i from 0 to 9:
i. i.
Let Q ← [ i ]
1 1
|| [
NUM NUM
radix
( B )]
15 15
ii. ii.
Let Y ←
CIPH
J J
( Q ).
iii iii
Let y ←
NUM NUM
2 2
( Y ).
iv. iv. If i is even, let m = u ; else, let m = v .
v. v.
Let c = (
NUM NUM
radix
( A ) + y ) mod radix
m m
. .
vi. Let C =
STR
m m
radix
( c ).
vii. Let A = B .
viii. viii. Let B = C .
6. 6.
Return A || B .
Description : Description:
The “split” of the numeral string X into two substrings, A and B , is performed in Steps 1 and 2.
If n is even,
LEN
( A )=
LEN
( B ); otherwise, autrement,
LEN
( A )=
LEN
( B )–1. A fixed block, P , is defined in Step 3
from encodings of the base, radix , and the tweak, T . The block cipher under the key K , ie,
CIPH
K K
, is applied to P in Step 4 to produce a 128-bit subkey, J . An iteration loop for the ten
Feistel rounds of FF2 is initiated in Step 5, executing eight substeps for each round, as follows:
The substring, B , and the round number, i , are encoded as a binary string, Q , in Step 5i. The La
block cipher under the subkey J is applied to Q in Step 5ii to produce a block, Y . (In Error!
Reference source not found. , Y corresponds to the output of F
K K
.) In Steps 5iii to 5vi, Y is
combined with the substring A to produce a numeral string C in the same base and with the same
length. longueur. (In Figure 1, the combining of Y with A is indicated by the “+” operation.) In particular,
in Step 5iii, Y is converted to a number, y . In Step 5iv, the length, m , of A for this Feistel round is
determined, and in Step 5v, the number y is reduced modulo the m th power of the base radix . In Dans
Step 5v, the number y is added to the number represented by the substring A and the result is
reduced modulo the m th power of radix , yielding a number, c , which is converted to a numeral

Page 24 Page 24
NIST Special Publication 800-38G
DRAFT
18 18
string in Step 5vi. In Steps 5vii and 5viii, the roles of A and B are swapped for the next round:
the substring B is renamed as the substring A , and the modified A (ie, C ) is renamed as B .
This completes one round of the Feistel structure in FF2. After the tenth round, the concatenation
of A and B is returned as the output in Step 6.
Algorithm 8: FF2.Decrypt( K , T , X )
Prerequisites: Pré-requis:
Approved, 128-bit block cipher,
CIPH
; ;
Key, K , for the block cipher;
Base, radix , for the character alphabet;
Base, tweakradix , for the tweak character alphabet;
Range of supported message lengths, [ minlen .. maxlen ]
Maximum supported tweak length, maxTlen .
Inputs :
Numeral string, X , in base radix of length n such that n ∈ [ minlen .. maxlen ];
Tweak numeral string, T , in base tweakradix of length t such that t ∈ [0 .. maxTlen ].
Output :
Numeral string, Y, such that
LEN
( Y ) = n.
Steps : Étapes:
1. 1.
Let u =  n /2; v = n – u .
2. Let A = X [1 .. u ]; B = X [ u + 1 .. n ].
3. 3.
If t >0, P = [ radix ]
1 1
|| [ t ]
1 1
|| [ n ]
1 1
|| [
NUM NUM
tweakradix
( T )]
13 13
; ; else P = [ radix ]
1 1
|| [0]
1 1
|| [ n ]
1 1
|| [0]
13 13
. .
4. 4.
Let J =
CIPH
K K
( P )
5. 5.
For i from 9 to 0:
i. i.
Let Q ← [ i ]
1 1
|| | [
NUM NUM
radix
( B )]
15 15
ii. ii.
Let Y ←
CIPH
J J
( Q ).
iii iii
Let y ←
NUM NUM
2 2
( Y ).
iv. iv. If i is even, let m = u ; else, let m = v .
v. v.
Let z = y mod radix
m m
. .
vi. Let c = (
NUM NUM
radix
( A ) – y ) mod radix
m m
. .
vii. Let C =
STR
m m
radix
( c ).
viii. viii. Let A = B .
ix. Let B = C .
6. 6.
Return A || B .
Description : Description:
The FF2.Decrypt algorithm is almost identical to the FF2.Encrypt algorithm: the only differences
are in Step 5, where the order of the indices is reversed, and in Step 5v, where modular addition
is replaced by modular subtraction.

Page 25 Page 25
NIST Special Publication 800-38G
DRAFT
19 19
6.3 FF3
The specifications for the FF3.Encrypt and FF3.Decrypt functions are given in Algorithms 9 and
10 below.
The parameters radix , minlen , and maxlen in FF3.Encrypt and FF3.Decrypt shall meet the
following requirements:
• radix ∈ [2 .. 2
16 16
];
• radix
minlen
≥ 100;
• minlen ≥ 2; and et
• maxlen ≤
2 2
log
radix
(2 (2
96 96
).
Algorithm 9: FF3.Encrypt( K , T , X )
Prerequisites: Pré-requis:
Approved, 128-bit block cipher,
CIPH
; ;
Key, K , for the block cipher;
Base, radix , for the character alphabet such that radix ∈ [2 .. 2
16 16
];
Range of supported message lengths, [ minlen .. maxlen ], such that minlen ≥ 2 and maxlen ≤
2 2
log
radix
(2 (2
96 96
)].
Inputs :
Numeral string, X , in base radix of length n such that n ∈ [ minlen .. maxlen ];
Tweak bit string, T , such that
LEN
( T ) = 64.
Output :
Numeral string, Y, such that
LEN
( Y ) = n.
Steps : Étapes:
1. 1.
Let u = ⌈ n /2⌉ ; v = n – u .
2. Let A = X [1 .. u ]; B = X [ u + 1 .. n ].
3. 3.
Let T
L L
= T [0..31] and T
R R
= T [32..63]
4. 4.
For i from 0 to 7:
i. i.
If i is even, let m = u and W = T
R R
, else let m = v and W =T
L L
. .
ii. ii.
Let P =
REV
([
NUM NUM
radix
( (
REV
( B ))]
12 12
) || W ⊕
REV
([ i ]
4 4
). ).
iii iii
Let Y =
CIPH
K K
( P ).
iv. iv. Let y =
NUM NUM
2 2
( (
REV
( Y )).
v. v.
Let c = (
NUM NUM
radix
( (
REV
( A )) + y ) mod radix
m m
. .
vi. Let C =
REV
( (
STR
m m
radix
( c )).
vii. Let A = B .
viii. viii. Let B = C .
5. 5.
Return A || B .
Description : Description:
The “split” of the numeral string X into two substrings, A and B , is performed in Steps 1 and 2.

Page 26 Page 26
NIST Special Publication 800-38G
DRAFT
20 20
If n is even,
LEN
( A )=
LEN
( B ); otherwise, autrement,
LEN
( A )=
LEN
( B )+1.
7 7
The tweak, T , is partitioned into a
32-bit left tweak, T
L L
, and a 32-bit right tweak, T
R R
, in Step 3. An iteration loop for the eight Feistel
rounds of FF3 is initiated in Step 4, executing eight substeps for each round, as follows:
In Step 4i, the parity of the round number, i , determines the length, m , of the substring A , and
whether T
L L
or T
R R
will be used as W in Step 4ii, in which a 32-bit encoding of i , XORed with W , is
concatenated with a 96-bit encoding of B to produce a block, P . In Step 4iii, the block cipher
under the key, ie, CIPH
K K
, is applied to P , to produce a block, Y . (In Figure 1, Y corresponds to
the output of F
K K
.) In Steps 4iv to 4vii, Y is combined with the substring A to produce a numeral
string C in the same base and with the same length. (In Figure 1, the combining of Y with A is
indicated by the “+” operation, although this operation is different than for FF1 and FF2 in that
FF3 uses the opposite ordering convention for the conversion of strings to numbers and vice
versa.) In particular, in Step 4iv, Y is converted to a number, y . In Step 4v, the number y is added
to the number represented by the substring A and the result is reduced modulo the m th power of
radix , yielding a number, c , which is converted to a numeral string in Step 5vi. In Steps 4vii and
4viii, the roles of A and B are swapped for the next round: the substring B is renamed as the
substring A , and the modified A (ie, C ) is renamed as B .
This completes one round of the Feistel structure in FF3. After the eighth round, the
concatenation of A and B is returned as the output in Step 5.
Algorithm 10: FF3.Decrypt( K , T , X )
Prerequisites: Pré-requis:
Approved, 128-bit block cipher,
CIPH
; ;
Key, K , for the block cipher;
Base, radix , for the character alphabet such that radix ∈ [2 .. 2
16 16
];
Range of supported message lengths, [ minlen .. maxlen ], such that minlen ≥ 2 and maxlen ≤
2 2
log
radix
(2 (2
96 96
).
Inputs :
Numeral string, X , in base radix of length n such that n ∈ [ minlen .. maxlen ];
Tweak bit string, T , such that
LEN
( T ) = 64.
Output :
Numeral string, Y, such that
LEN
( Y ) = n.
Steps : Étapes:
1. 1.
Let u = ⌈ n /2⌉ ; v = n – u .
2. Let A = X [1 .. u ]; B = X [ u + 1 .. n ].
3. 3.
Let T
L L
= T [0..31] and T
R R
= T [32..63]
4. 4.
For i from 7 to 0:
i. i.
If i is even, let m = u and W = T
R R
, else let m = v and W =T
L L
. .
ii. ii.
Let P =
REV
([
NUM NUM
radix
( (
REV
( B ))]
12 12
) || W ⊕
REV
([ i ]
4 4
). ).
7 7
If n is odd, A is one character longer than B , in contrast to FF1 and FF2, where B is one character longer than A .

Page 27 Page 27
NIST Special Publication 800-38G
DRAFT
21 21
iii iii
Let Y =
CIPH
K K
( P ).
iv. iv. Let y =
NUM NUM
2 2
( (
REV
( Y )).
vi. Let c = (
NUM NUM
radix
( (
REV
( A )) – y ) mod radix
m m
. .
vii. Let C =
REV
( (
STR
m m
radix
( c )).
viii. viii. Let A = B .
ix. Let B = C .
5. 5.
Return A || B .
Description : Description:
The FF3.Decrypt algorithm is almost identical to the FF3.Encrypt algorithm: the only differences
are in Step 4, where the order of the indices is reversed, and in Step 4v, where modular addition
is replaced by modular subtraction.
7 Conformance
An implementation may claim conformance to any of the following six functions:
FF1.Encrypt
FF2.Encrypt
FF3.Encrypt
FF1.Decrypt
FF2.Decrypt
FF3.Decrypt
Component functions such as
PRF
are not approved for use independent of these eight functions.
In order to claim conformance with this Recommendation, an implementation of FF1, FF2, or
FF3 must support at least one set of values for its parameters.
Two implementations can only interoperate when they support a common value for the base.
Similarly, two implementations of FF2 can only interoperate when they also support a common
value for the tweak base.
Moreover, each mode has two parameters, minlen and maxlen , that determine the lengths for the
numeral strings that are supported by an implementation of the encryption or decryption function
for the mode. FF1 and FF2 also have a parameter, maxTlen , that determines the lengths of the
tweak strings they support. The selection of these parameters may also affect interoperability.
For every algorithm that is specified in this Recommendation, a conforming implementation may
replace the given set of steps with any mathematically equivalent set of steps. In other words, En d'autres termes,
different procedures that produce the correct output for any input are permitted.
8 References
[1] [1]
M. Bellare, P. Rogaway, T. Spies, The FFX Mode of Operation for Format-Preserving
Encryption, Draft 1.1, Natl. Inst. Inst. Stand. Stand. Technol. Technol. [Web page], http://csrc.nist.gov
/groups/ST/toolkit/BCM/documents/proposedmodes/ffx/ffx-spec.pdf , February, 2010.

Page 28 Page 28
NIST Special Publication 800-38G
DRAFT
22 22
[2] [2]
M. Bellare, P. Rogaway, T. Spies, Addendum to “The FFX Mode of Operation for
Format-Preserving Encryption”: A parameter collection for enciphering strings of
arbitrary radix and length, Draft 1.0, Natl. Inst. Inst. Stand. Stand. Technol. Technol. [Web page],
http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/ffx/ffx-spec2.pdf,
September 2010.
[3] [3]
E. Brier, T. Peyrin, and J. Stern, BPS: a Format-Preserving Encryption Proposal Natl.
Inst. Inst. Stand. Stand. Technol. Technol. [Web page], http://csrc.nist.gov/groups/ST/toolkit/BCM/documents
/proposedmodes/bps/bps-spec.pdf.
[4] [4]
M. Liskov, R. Rivest, and D. Wagner. Tweakable block ciphers. CRYPTO 2002,
LNCSvol. 2442, Springer, pp. 31–46, 2002
[5] [5]
M. Luby and C. Rackoff. How to construct pseudorandom permutations from
pseudorandomfunctions. SIAM Journal on Computing, 17(2), pp. 373–386, 1988
[6] [6]
National Institute of Standards and Technology. FIPS 197, The Advanced Encryption
Standard (AES). 2001. 2001.
[7] [7]
National Institute of Standards and Technology. NIST Special Publication 800-38A:
Recommendation for Block Cipher Modes of Operation—Methods and Techniques ,
December, 2001. Décembre 2001.
[8] [8]
National Institute of Standards and Technology. NIST Special Publication 800-67
Revision 1: Recommendation for the Triple Data Encryption Algorithm (TDEA) Block
Cipher , January, 2012.
[9] [9]
National Institute of Standards and Technology. NIST Special Publication 800-133:
Recommendation for Cryptographic Key Generation , December, 2012.
[10] J. Patarin. Generic attacks on Feistel schemes. Cryptology ePrint report 2008/036.
January24, 2008. Also ASIACRYPT 2001, LNCS vol. 2248, Springer, pp. 222–238,
2001. 2001.
[11] R. Schroeppel. Hasty Pudding Cipher specification. Unpublished manuscript, [Web page]
athttp://richard.schroeppel.name:8015/hpc/hpc-spec, June 1998 (revised May 1999).
[12] T. Spies. Feistel finite set encryption. NIST submission, February 2008.
[13] J. Vance, VAES3 scheme for FFX: An addendum to “The FFX Mode of Operation for
Format-Preserving Encryption”: A parameter collection for encipher strings of arbitrary
radix with subkey operation to lengthen life of the enciphering key, Natl. Inst. Inst. Stand. Stand.
Technol. Technol.
[Web
page],
http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/
proposedmodes/ffx/ffx-ad-VAES3.pdf.

Page 29 Page 29
NIST Special Publication 800-38G
DRAFT
23 23
Appendix A: Parameter Choices
The length of the key affects its resistance to brute-force search. The requirement for each mode
that radix
minlen
≥ 100 precludes a generic meet-in-the-middle attack on the Feistel structure [10].
A requirement on maxlen for FF2—namely, that maxlen ≤ 298/
LOG
2 2
( radix ) if radix is not a
power of 2—minimizes the bias in the generation of z.
Otherwise, the choices of the mode parameters, eg, radix , minlen , and maxlen , are determined
by the needs of the application, not by security considerations.
Two potential parameters of the Feistel structure are fixed for FF1, FF2, and FF3, namely, the
number of Feistel rounds and the imbalance, ie, the lengths into which the input numeral string
is split: these were chosen in each case to balance performance requirements and security
considerations. See H of [1] for a discussion.
For FF1 and FF2, the maximum tweak length parameter, maxTlen , should be chosen to
accommodate non-secret information that may be associated to a plaintext. The security rationale
for tweaks is discussed in Appendix C.
Appendix B: Security Goal
The designers of FFX aimed to achieve strong-pseudorandom permutation (PRP) security for a
conventional block cipher [5] . In the FFX proposal to NIST [1], the designers of FFX cite the
history of cryptographic results concerning Feistel networks as underlying their selection of the
FFX mechanism. They assert that, under the assumption that the underlying round function is a
good pseudorandom function (PRF), contemporary cryptographic results and experience indicate
that FFX achieves cryptographic goals including nonadaptive message-recovery security,
chosen-plaintext, and even PRP-security against an adaptive chosen-ciphertext attack. The La
quantitative security depends on the number of rounds used, the imbalance, and the adversary's
access to plaintext/ciphertext pairs. See [ 1] f or details.
Appendix C: Tweaks
Tweaks have been supported in stand-alone block ciphers, such as Schroeppel's Hasty Pudding
[11], and the notion was later formalized and investigated by Liskov, Rivest, and Wagner [4].
Tweaks are important for FPE modes, because FPE may be used in settings where the number of
character strings is relatively small. In such settings, the tweak should vary with each instance of
the encryption whenever possible.
For example, suppose that in an application for CCNs the leading six digits and the trailing four
digits need to be available, unencrypted, to the application, so that only the remaining six digits
in the middle of the CCNs are encrypted. There are a million different possibilities for these
middle-six digits, so, in a database of 100 million CCNs, about a hundred distinct CCNs would
be expected to share each possible value for these six digits. If these hundred CCNs were
encrypted with the same tweak, then their ciphertexts would be the same.

Page 30 Page 30
NIST Special Publication 800-38G
DRAFT
24 24
If, however, the other ten digits had been the tweak for the encryption of the middle-six digits,
then the hundred ciphertexts would almost certainly be different. Therefore, for example,
learning that CCN 123456-123456-9876 encrypts to 123456-770611-9876 would not allow the
decryption of 111111-770611-9999, as the mapping of 123456 to 770611 is specific to the
surrounding digits 123456/9876.
In general, it is recommended to use information that is available and statically associated to a
plaintext as a tweak for that plaintext. Ideally, the non-secret tweak associated to a plaintext is
associated only to that plaintext.
Extensive tweaking means that fewer plaintexts are enciphered under any given tweak. This Ce
corresponds, in the security model that is described in [1], to fewer queries to the target instance
of the encryption. The relevant metric is the maximum number of plaintexts that are encrypted
with the same tweak, which is likely to be significantly less than the total number of plaintexts
enciphered.