EP3745638A1 - Methods for implementation and obfuscation of a cryptographic algorithm with secret data key - Google Patents

Methods for implementation and obfuscation of a cryptographic algorithm with secret data key Download PDF

Info

Publication number
EP3745638A1
EP3745638A1 EP20176724.1A EP20176724A EP3745638A1 EP 3745638 A1 EP3745638 A1 EP 3745638A1 EP 20176724 A EP20176724 A EP 20176724A EP 3745638 A1 EP3745638 A1 EP 3745638A1
Authority
EP
European Patent Office
Prior art keywords
instruction
operand
code
cmov
displacement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
EP20176724.1A
Other languages
German (de)
French (fr)
Inventor
Hervé Chabanne
Alberto Battistello
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Idemia Identity and Security France SAS
Original Assignee
Idemia Identity and Security France SAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Idemia Identity and Security France SAS filed Critical Idemia Identity and Security France SAS
Publication of EP3745638A1 publication Critical patent/EP3745638A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2123Dummy operation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/04Masking or blinding
    • H04L2209/046Masking or blinding of operations, operands or results of the operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/08Randomization, e.g. dummy operations or using noise
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/16Obfuscation or hiding, e.g. involving white box
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/24Key scheduling, i.e. generating round keys or sub-keys for block encryption

Definitions

  • the present invention relates to the field of cryptography, and in particular to a “white box” type encryption / decryption method.
  • a function is considered as a “black box” when we cannot access its internal functioning, i.e. we can know its inputs and outputs but not its secret parameters or its intermediate states.
  • Cryptographic algorithms for example for encryption or signature are thus conventionally assumed to be black boxes when their reliability (resistance to attacks) is assessed.
  • white box cryptography aims to meet this challenge by proposing implementations of cryptographic algorithms which are supposed to make the extraction of secrets impossible, even in the event of an attack allowing the attacker full access to the software implementation of the 'algorithm. More precisely, a function is considered a "white box" when its mechanisms are visible. In other words, we make the direct assumption that the attacker has access to everything he wants (the binary is completely visible and modifiable by the attacker and he has full control of the platform of execution). Therefore, the implementation itself is the only line of defense.
  • the resistance of the products developed is based on a mixture of mathematical principles and software obfuscation. It has for example been proposed to “mask” the internal states by random permutations (unknown but constant) called internal encodings. However, the resistance of protections based solely on mathematical principles does not appear sufficient today, cf. Brecht Wyseur Software Security: White-Box Cryptography. PhD Thesis 2009.
  • the present invention relates to a method for implementing a cryptographic algorithm with a given secret key comprising the execution by data processing means of a device of a code implementing said cryptographic algorithm stored on means for storing data of the equipment, the method being characterized in that at least one so-called obfuscated part of said code parameterized with said secret key uses only a single so-called cmov instruction , which is a conditional movement instruction in a first operand of the instruction of a second operand of the instruction, at least one occurrence of said cmov instruction in said obfuscated part of the code being dummy.
  • cmov instruction which is a conditional movement instruction in a first operand of the instruction of a second operand of the instruction, at least one occurrence of said cmov instruction in said obfuscated part of the code being dummy.
  • the invention relates to a computer program product comprising code instructions for the execution of a method according to the first aspect or according to the second aspect of implementation or obfuscation of. a cryptographic algorithm with a given secret key; and a storage means readable by a computer equipment on which a computer program product comprises code instructions for the execution of a method according to the first aspect or according to the second aspect of implementing obfuscation of a cryptographic algorithm with given secret key.
  • a method of implementing a “white box” cryptographic algorithm implemented within a device 10a such as a mobile terminal (smartphone, touch pad, etc.), ie a device not having particularly secure hardware that can be the object of attacks on hardware implementation, and for which the white box approach is of great interest; as well as a method of obfuscating the cryptographic algorithm allowing this white box implementation.
  • the equipment 10a comprises data processing means 11a (a processor) and data storage means 12a (a memory, for example flash).
  • the equipment 10a is for example connected to a server 10b, for example via the internet 20. It may be required to receive from this server 10b (for example that of a security solutions provider) pieces of code (which one will describe below) containing secrets which will be stored in the memory 12a and used for the implementation of the present method
  • the equipment 10a can itself be connected to other servers 10c of third parties with which it can exchange data encrypted using the present method.
  • the method according to the first aspect is a method for implementing a cryptographic algorithm, in particular an “encryption or decryption” method, this means that it makes it possible, depending on the case, to encrypt data. data or decrypt it. It is thus in particular of symmetric type, or “with a secret key”, or of asymmetric type (for example a signature algorithm, for which the third parties have a public key).
  • the present method is a new implementation of known algorithms, such as 3DES or AES which are the current standards. More precisely, it does not propose a new encryption strategy, but only a new implementation of the algorithm, and thus a new way of handling the data within the algorithm which is resistant to all "white box" attacks.
  • the present method conventionally comprising the execution by the data processing means 11a of the equipment 10a of a code implementing in an obfuscated manner (for at least a part of the code called the obfuscated part) said cryptographic function stored on the means data storage 12a.
  • Said code is preferably in a language that can be directly interpreted by the data means 11a, called assembly language.
  • the processors of the x86 family which constitute the vast majority of processors in use today
  • recognize an x86 assembly language using an x86 instruction set In the remainder of the present description, the example of x86 will be taken.
  • the present method preferably encrypts or decrypts a data tuple ⁇ a i ⁇ i ⁇ n with a predetermined secret key tuple ⁇ k i ⁇ i ⁇ n .
  • the substitution function f is a function parameterized with a secret key k i which takes as input an input element of F 2 k and outputs an output element of the same size (i.e. of F 2 k ).
  • These functions are well known, and for example in the case of DES and AES the function f is often tabulated and then called box S (“S-box”).
  • the algorithm typically comprises the alternation of a stage of use of f to permute elements then of a stage of use of L to broadcast the data, until having processed the whole block, it is this is called a round (or "round") of the algorithm.
  • the present method advantageously comprises the repetition of this so as to encrypt or decrypt a set of data comprising those of said n-tuple ⁇ a i ⁇ i ⁇ n .
  • the sensitive parts which will be obfuscated in accordance with what will be described can be limited in particular to the first and / or the last turns (for example the first / last three in AES), in other words the applications in the first and / or last rounds of the substitution functions using said secret key.
  • the cmov instruction can either exist natively in the set of instructions recognized by the data processing means (note that this is not the case in the original x86 instruction set, but more versions).
  • the original instruction set includes a cmovz instruction for "conditional move if zero" which is conditional but does not have the condition as a parameter: more precisely, the move is performed if a flag of zero ( Zero Flag, ZF) has the value 1), or be obtained by means of a “wrapper” (encapsulation) using the basic instructions. Specifically, a basic mov instruction is wrapped in the wrapper.
  • wrapper in original x86 instructions (using the cmovz instruction) following, proposed in the document Ashay Rane, Calvin Lin, Mohit Tiwari: Raccoon: Closing Digital Side-Channels through Obfuscated Execution. USENIX Security Symposium 2015:
  • the small code size of this wrapper allows each instruction to be thoroughly inspected for possible information leaks. Because the code acts only on the processor registers and never accesses memory, it can operate within a secure area of the processor.
  • the secret condition is loaded into register% 1.
  • the mov instruction on line 4 initializes the destination register with t_val.
  • the test instruction on line 5 checks if pred is zero and updates a zero flag (Zero Flag, ZF), a sign flag (Sign Flag, SF), and a parity flag (Parity Flag, PF) to reflect the comparison.
  • the following cmovz instruction copies the f_val value to the destination register only if pred is zero. At this point, ZF, SF and PF still contain the results of the comparison.
  • the test instruction on line 7 overrides these flags by comparing known non-secret values.
  • SGX proposes to allocate private memory regions (called secure enclaves), the content of which is protected and inaccessible in reading or writing, including by processes executed at higher privilege levels, ie to have a space where programs can be executed with confidentiality and integrity, in particular, protected from the OS, in order to safely implement sensitive algorithms.
  • secure enclaves private memory regions
  • SGX does not in itself offer any white box protection: the programs that are executed in the enclave are generally written in an ordinary way, with keys and internal states accessible, the protection being ensured by the watertight nature of the enclave.
  • this architecture has turned out to be susceptible to attack in many ways, for example by auxiliary channel attacks (leaks, cache attacks, on data access reasons) or by Specter type attacks.
  • OBLIVIATE / OBFSCURO solutions aim to correct some of these vulnerabilities by adding “obliviousness”, that is to say the fact of not leaving traces (for example the cache) that could be detected by attacks by auxiliary channels.
  • Oblivious RAM type algorithms E. Stefanov, M. Van Dijk, E. Shi, C. Fletcher, L. Ren, X. Yu, and S.
  • OBFSCURO thus manages to prevent certain attacks by auxiliary channels, in this case those by timing or by cache.
  • OBFSCURO is effective in the case of cryptographic algorithms implemented on remote equipment such as a server, this is not the case for equipment 10a of the mobile terminal type.
  • N mov instructions if only N cmov instructions are used, then the condition is true all the time and none of them simulate a movement. If we use N '> N cmov instructions , then even knowing that there are only N instructions which are really to be implemented, an attacker would not know which they are and could not distinguish them from N'-N > 0 dummy instructions.
  • the dummy instruction is for implementing a displacement simulation in the first operand of the second operand.
  • each cmov instruction will be executed, whether real or dummy, but only the execution of the real cmovs will give rise to an effective and correct displacement (the execution of the dummy cmovs giving either a false displacement or an incorrect displacement)
  • a method of obfuscating a cryptographic algorithm with a given secret key is proposed represented by a first computer code, ie a method of obtaining said obfuscated code (which will be designated as the third code) for the implementation of the algorithm, in accordance with the first aspect.
  • the first code is typically the assembly language code such as written directly or compiled from a classical programming language, ie unobfused and using various instructions.
  • This method is typically implemented in a secure manner on the server 10b.
  • the data processing means 11b of the server 10b begin with a step (a) of rewriting the first code into a second code in which at least one so-called obfuscated part of said code using said secret key uses only one instruction said mov, which is an unconditional movement instruction in a first operand of the instruction of a second operand of the instruction.
  • the original code is turned into mov-only through the use of a tool such as M / o / Vfuscator.
  • the second code can be directly compiled from a first code which is not in an assembly language.
  • step (b) a third code is generated corresponding to the second code in which each mov instruction of the obfuscated part is replaced by an instruction called cmov, which is a conditional displacement instruction in a first operand of the instruction d 'a second operand of the instruction.
  • each cmov instruction is an actual instruction, which is why step (b) includes adding at least one dummy cmov instruction in the third code.
  • the obfuscation method can comprise a step (c) of transmission to the equipment 10a of the third code for storage on storage means 12a of an equipment 10a with a view to execution by data processing means. 11a of the equipment 10a for setting implementation of said cryptographic algorithm, ie the method according to the first aspect.
  • the invention relates to a computer program product comprising code instructions for execution (in particular on the data processing means 11a, 11b of the equipment 10a and / or of the server. 10b) of a method according to the first or second aspect of the invention for implementing or obfuscating a cryptographic algorithm with a given secret key, as well as storage means readable by computer equipment (a memory 12a , 12b of the equipment 10a and / or of the server 10b) on which this computer program product is found.

Abstract

La présente invention concerne un procédé de mise en oeuvre d'un algorithme cryptographique à clé secrète donnée comprenant l'exécution par des moyens de traitement de données (11a) d'un équipement (10a) d'un code implémentant ledit algorithme cryptographique stocké sur des moyens de stockage de données (12a) de l'équipement (10a), le procédé étant caractérisé en ce qu'au moins une partie dite obfusquée dudit code paramétrée avec ladite clé secrète n'utilise qu'une seule instruction dite cmov, qui est une instruction de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction, au moins une occurrence de ladite instruction cmov dans ladite partie obfusquée du code étant factice.The present invention relates to a method of implementing a cryptographic algorithm with a given secret key comprising the execution by data processing means (11a) of an item of equipment (10a) of a code implementing said cryptographic algorithm stored on it. means for storing data (12a) of the equipment (10a), the method being characterized in that at least one so-called obfuscated part of said code parameterized with said secret key uses only a single so-called cmov instruction, which is a conditional displacement instruction in a first operand of the instruction of a second operand of the instruction, at least one occurrence of said cmov instruction in said obfuscated part of the code being dummy.

Description

DOMAINE TECHNIQUE GENERALGENERAL TECHNICAL FIELD

La présente invention concerne le domaine de la cryptographie, et en particulier un procédé de chiffrement/déchiffrement de type « boite blanche ».The present invention relates to the field of cryptography, and in particular to a “white box” type encryption / decryption method.

ETAT DE L'ARTSTATE OF THE ART

Une fonction est considérée comme une « boîte noire » lorsqu'on ne peut pas accéder à son fonctionnement interne, i.e. qu'on peut connaître ses entrées et ses sorties mais pas ses paramètres secrets ou ses états intermédiaire.A function is considered as a “black box” when we cannot access its internal functioning, i.e. we can know its inputs and outputs but not its secret parameters or its intermediate states.

Les algorithmes cryptographiques (par exemple pour du chiffrement ou de la signature) sont ainsi classiquement supposés des boites noires lorsqu'on évalue leur fiabilité (résistance aux attaques).Cryptographic algorithms (for example for encryption or signature) are thus conventionally assumed to be black boxes when their reliability (resistance to attacks) is assessed.

Par exemple, si l'on prend les algorithmes cryptographiques typiques tels que DES (« Data Encryption Standard »), 3DES (Triple DES) ou AES (« Advanced Encryption Standard »), ceux-ci travaillent sur des blocs d'un taille 64 ou 128 bit (et demain 256 bit), mais ne peuvent en une seule opération traiter un tel bloc (il y a déjà plus de 1019 valeurs possibles de blocs de 64 bit). Il est ainsi nécessaire de travailler au sein d'un bloc sur des éléments plus petits, typiquement de taille 8 bit (seulement 256 possibilités) en enchainant des opérations non-linéaires avec des opérations linéaires.For example, if we take the typical cryptographic algorithms such as DES ("Data Encryption Standard"), 3DES (Triple DES) or AES ("Advanced Encryption Standard"), these work on blocks of a size 64 or 128 bit (and tomorrow 256 bit), but cannot process such a block in a single operation (there are already more than 10 19 possible values of 64 bit blocks). It is thus necessary to work within a block on smaller elements, typically of 8 bit size (only 256 possibilities) by chaining non-linear operations with linear operations.

L'hypothèse de boite noire suppose dans ce cas que les clés ou les états intermédiaires sont inaccessibles. Cette hypothèse impose une contrainte forte sur le stockage et la manipulation de ces paramètres. En effet, des outils ont été récemment publiés pour permettre l'automatisation d'attaques sur implémentation matérielle, attaques dites par canaux auxiliaires ou par fautes.The black box hypothesis in this case assumes that the keys or the intermediate states are inaccessible. This hypothesis imposes a strong constraint on the storage and handling of these parameters. In fact, tools have recently been published to allow the automation of attacks on hardware implementation, so-called auxiliary channel or fault attacks.

Aujourd'hui, pour de nombreux cas d'usages incluant le paiement sur mobile, il est nécessaire de déployer des algorithmes cryptographiques en faisant le moins d'hypothèses possibles sur la sécurité du matériel cible. Le stockage et la manipulation sécurisés des paramètres secrets doivent alors être assurés au niveau applicatif.Today, for many use cases including mobile payment, it is necessary to deploy cryptographic algorithms by making the fewer assumptions about the security of the target hardware. The secure storage and handling of the secret parameters must then be ensured at the application level.

La cryptographie dite boite blanche vise à répondre à ce défi en proposant des implémentations des algorithmes cryptographiques qui sont sensés rendre l'extraction des secrets impossible, même en cas d'attaque permettant à l'attaquant un accès complet à l'implémentation logicielle de l'algorithme. Plus précisément, une fonction est considérée comme une « boîte blanche » lorsque ses mécanismes sont visibles. En d'autres termes, on fait directement l'hypothèse que l'attaquant a accès à tout ce qu'il souhaite (le binaire est complètement visible et modifiable par l'attaquant et celui-ci a le plein contrôle de la plateforme d'exécution). Par conséquent, l'implémentation elle-même est la seule ligne de défense.The so-called white box cryptography aims to meet this challenge by proposing implementations of cryptographic algorithms which are supposed to make the extraction of secrets impossible, even in the event of an attack allowing the attacker full access to the software implementation of the 'algorithm. More precisely, a function is considered a "white box" when its mechanisms are visible. In other words, we make the direct assumption that the attacker has access to everything he wants (the binary is completely visible and modifiable by the attacker and he has full control of the platform of execution). Therefore, the implementation itself is the only line of defense.

La résistance des produits développés repose sur un mélange de principes mathématiques et d'obfuscation logicielle. Il a par exemple été proposé de « masquer » les états internes par des permutations aléatoires (inconnues mais constantes) appelées encodages internes. Cependant, la résistance des protections s'appuyant uniquement sur des principes mathématiques n'apparait pas aujourd'hui suffisante, cf. Brecht Wyseur Software Security: White-Box Cryptography. PhD Thesis 2009. The resistance of the products developed is based on a mixture of mathematical principles and software obfuscation. It has for example been proposed to “mask” the internal states by random permutations (unknown but constant) called internal encodings. However, the resistance of protections based solely on mathematical principles does not appear sufficient today, cf. Brecht Wyseur Software Security: White-Box Cryptography. PhD Thesis 2009.

En outre, il a été montré dans les articles Joppe W. Bos, Charles Hubain, Wil Michiels, Philippe Teuwen: Differential Computation Analysis: Hiding Your White-Box Designs is Not Enough, CHES2016, Sanfelix, Eloi, Cristofaro Mune, and Job de Haas. "Unboxing the white-box." Black Hat EU 2015. 2015, et Jacob, M., Boneh, D., & Felten, E. (2002, November). Attacking an obfuscated cipher by injecting faults. In ACM Workshop on Digital Rights Management (pp. 16-31). Springer, Berlin, Heidelberg, que les attaques dites par canaux auxiliaires ou par fautes peuvent être transposées avec succès dans la cryptographie boite blanche.In addition, it has been shown in the articles Joppe W. Bos, Charles Hubain, Wil Michiels, Philippe Teuwen: Differential Computation Analysis: Hiding Your White-Box Designs is Not Enough, CHES2016, Sanfelix, Eloi, Cristofaro Mune, and Job de Haas. “Unboxing the white-box.Black Hat EU 2015. 2015, and Jacob, M., Boneh, D., & Felten, E. (2002, November). Attacking an obfuscated cipher by injecting faults. In ACM Workshop on Digital Rights Management (pp. 16-31). Springer, Berlin, Heidelberg, that so-called side-channel or fault-based attacks can be successfully transposed into white box cryptography.

Il serait par conséquent souhaitable de disposer d'une nouvelle solution de cryptographie « boite blanche » utilisant les mécanismes standards comme le DES et l'AES qui soit complètement résistante à toutes attaques connues (par analyse de canaux, par faute, etc.).It would therefore be desirable to have a new “white box” cryptography solution using standard mechanisms such as DES and AES which is completely resistant to all known attacks (by channel analysis, fault, etc.).

PRESENTATION DE L'INVENTIONPRESENTATION OF THE INVENTION

Selon un premier aspect, la présente invention concerne un procédé de mise en œuvre d'un algorithme cryptographique à clé secrète donnée comprenant l'exécution par des moyens de traitement de données d'un équipement d'un code implémentant ledit algorithme cryptographique stocké sur des moyens de stockage de données de l'équipement, le procédé étant caractérisé en ce qu'au moins une partie dite obfusquée dudit code paramétrée avec ladite clé secrète n'utilise qu'une seule instruction dite cmov, qui est une instruction de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction, au moins une occurrence de ladite instruction cmov dans ladite partie obfusquée du code étant factice.According to a first aspect, the present invention relates to a method for implementing a cryptographic algorithm with a given secret key comprising the execution by data processing means of a device of a code implementing said cryptographic algorithm stored on means for storing data of the equipment, the method being characterized in that at least one so-called obfuscated part of said code parameterized with said secret key uses only a single so-called cmov instruction , which is a conditional movement instruction in a first operand of the instruction of a second operand of the instruction, at least one occurrence of said cmov instruction in said obfuscated part of the code being dummy.

Selon des caractéristiques avantageuses et non limitatives :

  • ladite instruction cmov de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction met en œuvre :
    • soit, si une condition est vérifiée, le déplacement effectif dans le premier opérande du deuxième opérande ;
    • soit, si ladite condition n'est pas vérifiée, une simulation de déplacement dans le premier opérande du deuxième opérande ;
  • ladite occurrence factice de l'instruction cmov étant destinée à mettre en œuvre ladite simulation de déplacement dans le premier opérande du deuxième opérande lors de l'exécution normale dudit code ;
  • ladite simulation de déplacement dans le premier opérande du deuxième opérande comprend soit le déplacement effectif dans le premier opérande du premier opérande, soit le déplacement effectif du deuxième opérande ailleurs que dans le premier opérande ;
  • chaque instruction cmov de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction est exprimée à partir d'une instruction dite mov de déplacement non-conditionnel dans le premier opérande du deuxième opérande, encapsulée ;
  • les moyens de traitement de données mettent en œuvre un environnement d'exécution sécurisée dans lequel ledit code implémentant ledit algorithme cryptographique est exécuté, tel que l'environnement Secure Guard Extension ;
  • ladite partie de code obfusquée comprend une pluralité d'occurrences factices d'instructions cmov pour chaque occurrence réelle d'une instruction cmov ;
  • pour un ensemble d'une occurrence réelle et des M-1 occurrences factices correspondantes d'instructions cmov, correspondant à toutes les M valeurs possibles oi d'un objet noté o, dont une valeur attendue r, on a :
    • pour la i-ème occurrence de l'ensemble, la condition de déplacement est « o est égal à oi » ;
    • l'occurence réelle est la j-ième telle que oj=r ;
    • toutes les autres occurrences de l'ensemble sont des occurrences factices ;
  • ledit code est dans un langage d'assemblage des moyens de traitement de données ;
  • ledit langage d'assemblage est l'assembleur x86 ;
  • ledit algorithme cryptographique est un algorithme de chiffrement symétrique, ladite partie obfusquée du code implémentant au moins un tour dudit algorithme de chiffrement symétrique.
According to advantageous and non-limiting characteristics:
  • said cmov conditional displacement instruction in a first operand of the instruction of a second operand of the instruction implements:
    • that is, if a condition is verified, the effective displacement in the first operand of the second operand;
    • or, if said condition is not verified, a displacement simulation in the first operand of the second operand;
  • said dummy occurrence of the cmov instruction being intended to implement said displacement simulation in the first operand of the second operand during the normal execution of said code;
  • said displacement simulation in the first operand of the second operand comprises either the actual displacement in the first operand of the first operand, or the effective displacement of the second operand elsewhere than in the first operand;
  • each instruction cmov of conditional displacement in a first operand of the instruction of a second operand of the instruction is expressed on the basis of an instruction called mov of unconditional displacement in the first operand of the second operand, encapsulated;
  • the data processing means implement a secure execution environment in which said code implementing said cryptographic algorithm is executed, such as the Secure Guard Extension environment;
  • said obfuscated portion of code includes a plurality of dummy instances of cmov instructions for each actual occurrence of a cmov instruction;
  • for a set of a real occurrence and the M-1 corresponding dummy occurrences of cmov instructions , corresponding to all the M possible values oi of an object noted o , whose expected value r , we have:
    • for the i-th occurrence of the set, the displacement condition is “ o is equal to oi ”;
    • the real occurrence is the j-th such that oj = r ;
    • all other occurrences of the set are dummy occurrences;
  • said code is in an assembly language of the data processing means;
  • said assembly language is x86 assembler;
  • said cryptographic algorithm is a symmetric encryption algorithm, said obfuscated part of the code implementing at least one turn of said symmetric encryption algorithm.

Selon un deuxième aspect, l'invention concerne un procédé d'obfuscation d'un algorithme cryptographique à clé secrète donnée représentée par un premier code informatique, comprenant la mise en œuvre par des moyens de traitement de données d'un serveur d'étapes de :

  1. (a) réécriture du premier code en un deuxième code dans lequel au moins une partie dite obfusquée dudit code utilisant ladite clé secrète n'utilise qu'une seule instruction dite mov, qui est une instruction de déplacement non-conditionnelle dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction ;
  2. (b) génération d'un troisième code correspondant au deuxième code dans lequel chaque instruction mov de la partie obfusquée est remplacée par une instruction dite cmov, qui est une instruction de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction, au moins une instruction cmov factice étant ajoutée.
Selon des caractéristiques avantageuses mais non limitatives, le procédé comprend une étape (c) de transmission à l'équipement du troisième pour stockage sur des moyens de stockage d'un équipement en vue de l'exécution par des moyens de traitement de données de l'équipement pour mise en œuvre dudit algorithme cryptographique.According to a second aspect, the invention relates to a method of obfuscating a cryptographic algorithm with a given secret key represented by a first computer code, comprising the implementation by means of data processing of a server of steps of :
  1. (a) rewriting the first code into a second code in which at least a so-called obfuscated part of said code using said secret key uses only a single instruction called mov, which is a move instruction unconditional in a first operand of the instruction of a second operand of the instruction;
  2. (b) generation of a third code corresponding to the second code in which each mov instruction of the obfuscated part is replaced by a so-called cmov instruction , which is a conditional displacement instruction in a first operand of the instruction of a second operand of the instruction, at least one dummy cmov instruction being added.
According to advantageous but non-limiting characteristics, the method comprises a step (c) of transmission to the equipment of the third for storage on storage means of an item of equipment with a view to execution by data processing means of the. equipment for implementing said cryptographic algorithm.

Selon un troisième et un quatrième aspect, l'invention concerne un produit programme d'ordinateur comprenant des instructions de code pour l'exécution d'un procédé selon le premier aspect ou selon le deuxième aspect de mise en œuvre ou d'obfuscation d'un algorithme cryptographique à clé secrète donnée ; et un moyen de stockage lisible par un équipement informatique sur lequel un produit programme d'ordinateur comprend des instructions de code pour l'exécution d'un procédé selon le premier aspect ou selon le deuxième aspect de mise en œuvre d'obfuscation d'un algorithme cryptographique à clé secrète donnée.According to a third and a fourth aspect, the invention relates to a computer program product comprising code instructions for the execution of a method according to the first aspect or according to the second aspect of implementation or obfuscation of. a cryptographic algorithm with a given secret key; and a storage means readable by a computer equipment on which a computer program product comprises code instructions for the execution of a method according to the first aspect or according to the second aspect of implementing obfuscation of a cryptographic algorithm with given secret key.

PRESENTATION DES FIGURESPRESENTATION OF FIGURES

D'autres caractéristiques et avantages de la présente invention apparaîtront à la lecture de la description qui va suivre d'un mode de réalisation préférentiel. Cette description sera donnée en référence aux dessins annexés dans lesquels :

  • la figure 1 est un schéma d'une architecture pour la mise en œuvre des procédés selon l'invention ;
  • la figure 2 illustre un mode de réalisation d'un procédé d'obfuscation selon l'invention.
Other characteristics and advantages of the present invention will emerge on reading the following description of a preferred embodiment. This description will be given with reference to the accompanying drawings in which:
  • the figure 1 is a diagram of an architecture for the implementation of the methods according to the invention;
  • the figure 2 illustrates an embodiment of an obfuscation method according to the invention.

DESCRIPTION DETAILLEEDETAILED DESCRIPTION ArchitectureArchitecture

En référence à la figure 1 , sont proposés un procédé de mise en œuvre d'un algorithme cryptographique « boite blanche » mis en œuvre au sein d'un équipement 10a tel qu'un terminal mobile (smartphone, tablette tactile, etc.), i.e. un équipement ne disposant pas particulièrement d'un matériel sécurisé et qui peut faire l'objet d'attaques sur implémentation matérielle, et pour lequel l'approche boite blanche prend tout son intérêt ; ainsi qu'un procédé d'obfuscation de l'algorithme cryptographique permettant cette implémentation boite blanche.With reference to the figure 1 , a method of implementing a “white box” cryptographic algorithm implemented within a device 10a such as a mobile terminal (smartphone, touch pad, etc.), ie a device not having particularly secure hardware that can be the object of attacks on hardware implementation, and for which the white box approach is of great interest; as well as a method of obfuscating the cryptographic algorithm allowing this white box implementation.

L'équipement 10a comprend des moyens de traitement de données 11a (un processeur) et des moyens de stockage de données 12a (une mémoire, par exemple flash).The equipment 10a comprises data processing means 11a (a processor) and data storage means 12a (a memory, for example flash).

L'équipement 10a est par exemple relié à un serveur 10b par exemple via le réseau internet 20. Il peut être amené à recevoir depuis ce serveur 10b (par exemple celui d'un fournisseur de solutions de sécurité) des morceaux de code (qu'on décrira plus loin) contenant des secrets qui vont être stockées dans la mémoire 12a et utilisées pour la mise en œuvre du présent procédé L'équipement 10a peut lui-même être connecté à d'autres serveurs 10c de tiers avec lesquels il pourra échanger des données chiffrées au moyen du présent procédé.The equipment 10a is for example connected to a server 10b, for example via the internet 20. It may be required to receive from this server 10b (for example that of a security solutions provider) pieces of code (which one will describe below) containing secrets which will be stored in the memory 12a and used for the implementation of the present method The equipment 10a can itself be connected to other servers 10c of third parties with which it can exchange data encrypted using the present method.

Procédé cryptographiqueCryptographic process

Le procédé selon le premier aspect est un procédé de mise en œuvre d'un algorithme cryptographique, en particulier un procédé de « chiffrement ou de déchiffrement », cela signifie qu'il permet selon les cas de chiffrer des données ou d'en déchiffrer. Il est ainsi notamment de type symétrique, ou « à clé secrète », ou de type asymétrique (par exemple un algorithme de signature, pour lequel les tiers disposent d'une clé publique).The method according to the first aspect is a method for implementing a cryptographic algorithm, in particular an “encryption or decryption” method, this means that it makes it possible, depending on the case, to encrypt data. data or decrypt it. It is thus in particular of symmetric type, or “with a secret key”, or of asymmetric type (for example a signature algorithm, for which the third parties have a public key).

On comprendra que le présent procédé est une nouvelle implémentation d'algorithmes connus, tels que 3DES ou AES qui sont les standards actuels. Plus précisément, il ne propose pas une nouvelle stratégie de chiffrement, mais seulement une nouvelle implémentation de l'algorithme, et ainsi une nouvelle façon de manipuler les données au sein de l'algorithme qui soit résistante à toutes les attaques en « boite blanche ». Ainsi, le présent procédé comprenant classiquement l'exécution par les moyens de traitement de données 11a de l'équipement 10a d'un code implémentant de manière obfusquée (pour au moins une partie du code dite partie obfusquée) ladite fonction cryptographique stocké sur les moyens de stockage de données 12a. Ledit code est préférentiellement dans un langage directement interprétable par les moyens de données 11a, dit langage d'assemblage. Par exemple les processeurs de la famille x86 (qui constituent la grande majorité des processeurs aujourd'hui en service) reconnaissent un langage d'assemblage x86 utilisant un jeu d'instructions x86. Dans la suite de la présente description, on prendra l'exemple de x86.It will be understood that the present method is a new implementation of known algorithms, such as 3DES or AES which are the current standards. More precisely, it does not propose a new encryption strategy, but only a new implementation of the algorithm, and thus a new way of handling the data within the algorithm which is resistant to all "white box" attacks. . Thus, the present method conventionally comprising the execution by the data processing means 11a of the equipment 10a of a code implementing in an obfuscated manner (for at least a part of the code called the obfuscated part) said cryptographic function stored on the means data storage 12a. Said code is preferably in a language that can be directly interpreted by the data means 11a, called assembly language. For example, the processors of the x86 family (which constitute the vast majority of processors in use today) recognize an x86 assembly language using an x86 instruction set. In the remainder of the present description, the example of x86 will be taken.

Par « obfuscation », on entend ici le fait de rendre « illisible ou incompréhensible » le code informatique pour prévenir de façon générale le reverse engineering et notamment prévenir l'accès à l'algorithme et ses clés. On notera que le code de tout l'algorithme n'a pas nécessairement besoin d'être intégralement obfusqué de la façon qui va être décrite, il suffit en pratique que des parties dites « sensibles » le soient, en particulier celles représentatives des opérations paramétrées avec ladite clé secrète, et tout particulièrement celles comprenant l'application de fonctions de substitution. Plus précisément, selon un schéma classique, l'algorithme mis en œuvre traite les données blocs par bloc, et au sein d'un bloc il manipule des éléments d'une taille plus petite, par exemple 16 éléments d'un octet pour un bloc 128 bits (cas de AES par exemple). Ces éléments sont manipulés typiquement deux par deux.By “obfuscation” is meant here making the computer code “illegible or incomprehensible” in order to generally prevent reverse engineering and in particular to prevent access to the algorithm and its keys. It will be noted that the code of the whole algorithm does not necessarily need to be completely obfuscated in the way which will be described, it suffices in practice for so-called "sensitive" parts to be so, in particular those representative of the parameterized operations. with said secret key, and more particularly those comprising the application of substitution functions. More precisely, according to a conventional diagram, the algorithm implemented processes the data block by block, and within a block it handles elements of a smaller size, for example 16 elements of one byte for a block 128 bits (case of AES for example). These elements are typically handled two by two.

Ainsi le présent procédé préférentiellement chiffre ou déchiffre un n-uplet de données {ai}i<n avec un n-uplet de clés secrètes {ki}i<n prédéterminées. Chaque élément ai dudit n-uplet de données {ai}i<n est à valeur dans un espace {0;1}k qu'on notera F 2 k

Figure imgb0001
et a avantageusement une taille d'un octet (un « byte » de 8 bits, i.e. k=8).Thus, the present method preferably encrypts or decrypts a data tuple {a i } i <n with a predetermined secret key tuple {k i } i <n . Each element a i of said data tuple {a i } i <n has a value in a space {0; 1} k that we will denote F 2 k
Figure imgb0001
and advantageously has a size of one byte (an 8-bit “byte”, ie k = 8 ).

Pour traiter un bloc complet à partir d'éléments plus petits, il est nécessaire de multiplier les opérations au sein du bloc, et pour cela le présent procédé comprenant avantageusement de façon classique l'utilisation d'une fonction non-linéaire de substitution f, combinée à l'utilisation d'une fonction linéaire de multiplexage L, chacune donnée en fonction de l'algorithme cryptographique à implémenter.To process a complete block from smaller elements, it is necessary to multiply the operations within the block, and for this the present method advantageously comprising in a conventional manner the use of a non-linear substitution function f , combined with the use of a linear multiplexing function L , each given as a function of the cryptographic algorithm to be implemented.

La fonction de substitution f est une fonction paramétrée avec une clé secrète ki qui prend en entrée un élément d'entrée de F 2 k

Figure imgb0002
et génère en sortie un élément de sortie de la même taille (i.e. de F 2 k
Figure imgb0003
). Ces fonctions sont bien connues, et par exemple dans le cas de DES et AES la fonction f est souvent tabulée et alors appelée boite S (« S-box »).The substitution function f is a function parameterized with a secret key k i which takes as input an input element of F 2 k
Figure imgb0002
and outputs an output element of the same size (i.e. of F 2 k
Figure imgb0003
). These functions are well known, and for example in the case of DES and AES the function f is often tabulated and then called box S (“S-box”).

L'algorithme comprend typiquement l'alternance d'un étage d'utilisation de f pour permuter des éléments puis d'un étage d'utilisation de L pour diffuser les données, et ce jusqu'à avoir traité tout le bloc, c'est ce que l'on appelle un tour (ou « round ») de l'algorithme. On comprend ainsi que le présent procédé comprend avantageusement la répétition de cette de sorte à chiffrer ou déchiffrer un ensemble de données comprenant celles dudit n-uplet {ai}i<n. Les parties sensibles qui vont être obfusquées conformément à ce qui va être décrit peuvent être limitées notamment aux premiers et/ou aux derniers tours (par exemple les trois premiers/derniers dans AES), en d'autres termes les applications dans les premiers et/ou derniers tours des fonctions de substitution utilisant ladite clé secrète.The algorithm typically comprises the alternation of a stage of use of f to permute elements then of a stage of use of L to broadcast the data, until having processed the whole block, it is this is called a round (or "round") of the algorithm. It is thus understood that the present method advantageously comprises the repetition of this so as to encrypt or decrypt a set of data comprising those of said n-tuple {a i } i <n . The sensitive parts which will be obfuscated in accordance with what will be described can be limited in particular to the first and / or the last turns (for example the first / last three in AES), in other words the applications in the first and / or last rounds of the substitution functions using said secret key.

A noter qu'il existe des attaques qui ne ciblent que les tours du milieu, il est donc possible d'obfusquer les parties correspondant à tous les tours si l'on souhaite totalement se protéger.Note that there are attacks that only target the middle towers, so it is possible to obfuscate the parts corresponding to all the towers if you want to fully protect yourself.

A noter également que, protéger seulement la fonction de substitution n'est pas toujours suffisant, il peut être intéressant de protéger la donnée sensible a travers toutes les opérations jusqu'au moment où elle dépend de trop de bits de clé pour qu'une attaque soit possible. Par exemple, pour AES, cela correspond à aller jusqu'au « mix colonnes » du deuxième tour.Note also that, protecting only the substitution function is not always sufficient, it may be advantageous to protect sensitive data. through all operations until it depends on too many key bits for an attack to be possible. For example, for AES, this corresponds to going up to the “column mix” of the second round.

Principe de l'inventionPrinciple of the invention

Le présent procédé se distingue en ce que l'au moins une partie dite obfusquée dudit code n'utilise qu'une seule instruction dite cmov, qui est une instruction de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction, au moins une occurrence de ladite instruction cmov dans ladite partie obfusquée du code étant factice.
Plus précisément, ladite partie obfusquée est constitué d'une pluralité d'instruction, chacune étant une instruction cmov, i.e. il n'y a pas d'autres instructions que des instructions cmov. Naturellement, deux instructions cmov de ladite partie ne seront pas identiques, elles pourront avoir des opérandes (i.e. des arguments, paramètres) différents. On note que chaque opérande peut être un registre, une adresse mémoire, une valeur littérale ou une étiquette, et dans le cas typique il s'agit de deux registres de sorte que le déplacement consiste en l'écriture du contenu du registre désigné par le deuxième opérande dans le registre désigné par le premier opérande.
L'instruction cmov de déplacement conditionnel s'entend par comparaison avec une instruction traditionnelle (en particulier du set d'instruction x86) dite mov de déplacement non-conditionnel dans le premier opérande du deuxième opérande de l'instruction, i.e. juste de déplacement.
En effet, cmov met en œuvre le déplacement si et seulement si une condition est vérifiée, alors que mov le met toujours en œuvre. Typiquement cette condition est la valeur d'un booléen appelé « flag ».
Avantageusement, l'instruction cmov met plus précisément en œuvre :

  • soit, si la condition est vérifiée, le déplacement effectif dans le premier opérande du deuxième opérande (i.e. l'instruction mov normale) ;
  • soit, si la condition n'est pas vérifiée, une simulation de déplacement dans le premier opérande du deuxième opérande.
L'idée est qu'un attaquant ayant accès au matériel ne puisse pas faire la différence entre les deux branches de l'instruction, i.e. ne puisse pas dire si le déplacement a été effectivement effectué.
La simulation comprend ainsi avantageusement comme un vrai déplacement un accès mémoire et une écriture mémoire, mais naturellement la simulation ne comprend pas le déplacement effectif dans le premier opérande du deuxième opérande.
Notamment, la destination (le premier opérande) sera accédée mais y sera copié son contenu actuel au lieu du deuxième opérande. On peut ainsi d'une certaine façon voir la simulation de déplacement dans le premier opérande du deuxième opérande comme un déplacement dans le premier opérande du premier opérande (ce qui laisse la mémoire en l'état).
Alternativement, la simulation peut comprendre le déplacement vers une autre destination qui ne sera pas utilisée, i.e. voir la simulation de déplacement dans le premier opérande du deuxième opérande comme un déplacement du deuxième opérande ailleurs que dans le premier opérande.The present method is distinguished in that at least one so-called obfuscated part of said code uses only one so-called cmov instruction , which is a conditional displacement instruction in a first operand of the instruction of a second operand of the instruction, at least one occurrence of said cmov instruction in said obfuscated part of the code being dummy.
More precisely, said obfuscated part consists of a plurality of instructions, each being a cmov instruction , ie there are no instructions other than cmov instructions . Of course, two cmov instructions of said part will not be identical, they can have different operands (ie arguments, parameters). We note that each operand can be a register, a memory address, a literal value or a label, and in the typical case it is about two registers so that the displacement consists in the writing of the contents of the register designated by the second operand in the register designated by the first operand.
The cmov instruction of conditional displacement is understood by comparison with a traditional instruction (in particular of the x86 instruction set) called mov of unconditional displacement in the first operand of the second operand of the instruction, ie just displacement.
Indeed, cmov implements the displacement if and only if a condition is verified, whereas mov always implements it. Typically this condition is the value of a boolean called "flag".
Advantageously, the cmov instruction more precisely implements:
  • that is, if the condition is verified, the effective displacement in the first operand of the second operand (ie the normal mov instruction);
  • or, if the condition is not verified, a displacement simulation in the first operand of the second operand.
The idea is that an attacker having access to the hardware cannot differentiate between the two branches of the instruction, ie cannot say if the move has actually been carried out.
The simulation thus advantageously comprises a memory access and a memory write as a real movement, but naturally the simulation does not include the actual movement in the first operand of the second operand.
In particular, the destination (the first operand) will be accessed but its current content will be copied there instead of the second operand. We can thus in a certain way see the simulation of displacement in the first operand of the second operand as a displacement in the first operand of the first operand (which leaves the memory as it is).
Alternatively, the simulation can include the displacement to another destination which will not be used, ie see the displacement simulation in the first operand of the second operand as a displacement of the second operand elsewhere than in the first operand.

A noter que l'instruction cmov, peut soit exister nativement dans le set d'instructions reconnu par les moyens de traitement de données (à noter que ce n'est pas le cas dans le set d'instructions x86 originales, mais des versions plus récentes la comprennent. On note que le set d'instructions originale comprend une instruction cmovz pour « conditional move if zero » qui est conditionnelle mais n'a pas la condition en paramètre : plus précisément, le déplacement est effectué si un indicateur de zéro (Zero Flag, ZF) a pour valeur 1), soit être obtenue grâce à un « wrapper » (encapsulation) utilisant les instructions de base. Plus précisément, une instruction mov de base est encapsulée dans le wrapper.
Notamment, on pourra par exemple utiliser le wrapper en instructions x86 originales (utilisant l'instruction cmovz) suivant, proposé dans le document Ashay Rane, Calvin Lin, Mohit Tiwari: Raccoon: Closing Digital Side-Channels through Obfuscated Execution. USENIX Security Symposium 2015 :

Figure imgb0004
Note that the cmov instruction can either exist natively in the set of instructions recognized by the data processing means (note that this is not the case in the original x86 instruction set, but more versions We note that the original instruction set includes a cmovz instruction for "conditional move if zero" which is conditional but does not have the condition as a parameter: more precisely, the move is performed if a flag of zero ( Zero Flag, ZF) has the value 1), or be obtained by means of a “wrapper” (encapsulation) using the basic instructions. Specifically, a basic mov instruction is wrapped in the wrapper.
In particular, we can for example use the wrapper in original x86 instructions (using the cmovz instruction) following, proposed in the document Ashay Rane, Calvin Lin, Mohit Tiwari: Raccoon: Closing Digital Side-Channels through Obfuscated Execution. USENIX Security Symposium 2015:
Figure imgb0004

La petite taille du code de ce wrapper permet d'inspecter minutieusement chaque instruction pour détecter d'éventuelles fuites d'informations. Étant donné que le code agit uniquement sur les registres du processeur et n'accède jamais à la mémoire, il peut fonctionner dans les limites d'une zone sécurisée du processeur. La condition secrète est chargée dans le registre %1. L'instruction mov de la ligne 4 initialise le registre de destination avec t_val. L'instruction de test à la ligne 5 vérifie si pred est égal à zéro et met à jour un indicateur de zéro (Zero Flag, ZF), un indicateur de signe (Sign Flag, SF) et un indicateur de parité (Parity Flag, PF) pour refléter la comparaison. L'instruction cmovz suivante copie la valeur f_val dans le registre de destination uniquement si pred est égal à zéro. À ce stade, ZF, SF et PF contiennent toujours les résultats de la comparaison. L'instruction de test à la ligne 7 écrase ces indicateurs en comparant des valeurs non secrètes connues.The small code size of this wrapper allows each instruction to be thoroughly inspected for possible information leaks. Because the code acts only on the processor registers and never accesses memory, it can operate within a secure area of the processor. The secret condition is loaded into register% 1. The mov instruction on line 4 initializes the destination register with t_val. The test instruction on line 5 checks if pred is zero and updates a zero flag (Zero Flag, ZF), a sign flag (Sign Flag, SF), and a parity flag (Parity Flag, PF) to reflect the comparison. The following cmovz instruction copies the f_val value to the destination register only if pred is zero. At this point, ZF, SF and PF still contain the results of the comparison. The test instruction on line 7 overrides these flags by comparing known non-secret values.

L'utilisation de l'instruction cmov a été décrite dans le document Adil Ahmad, Byunggill Joe, Yuan Xiao, Yinqian Zhang, Insik Shin, and Byoungyoung Lee, OBFSCURO: A Commodity Obfuscation Engine on Intel SGX, NDSS 2019, auquel l'homme du métier pourra se reporter (voir également Adil Ahmad, Kyungtae Kim, Muhammad Ihsanulhaq Sarfaraz, Byoungyoung Lee: OBLIVIATE: A Data Oblivious Filesystem for Intel SGX. NDSS 2018) comme solution aux failles de l'environnement SGX (Secure Guard Extensions).
Plus précisément, SGX propose d'attribuer des régions de mémoire privées (appelées enclaves sécurisée), dont le contenu est protégé et inaccessible en lecture ou écriture, y compris par des processus exécutés à des niveaux de privilèges supérieurs, i.e. d'avoir un espace où peuvent s'exécuter des programmes à l'abri en confidentialité et en intégrité, en particulier, à l'abri de l'OS, en vue d'y implémenter en toute sécurité des algorithmes sensibles. On peut voir l'enclave comme une « sandbox inversée », autorisant une implémentation boite noire plus robuste. En d'autres termes, on comprend que SGX n'offre en soi aucune protection boite blanche : les programmes qui sont exécutés dans l'enclave sont généralement écrits de façon ordinaire, avec des clés et des états internes accessibles, la protection étant assurée par le caractère étanche de l'enclave.
Et de surcroit, cette architecture s'est avérée susceptible d'être attaquée de nombreuses façons, par exemple par des attaques par canaux auxiliaires (fuites, cache attack, sur les motifs d'accès aux données) ou par des attaques type Spectre.
Les solutions OBLIVIATE/OBFSCURO visent à corriger certaines de ces vulnérabilités en ajoutant de l'« obliviousness », c'est-à-dire le fait de ne pas laisser de traces (par exemple le cache) qui pourraient être repérées par les attaques par canaux auxiliaires. Pour cela, le recours à des algorithmes type Oblivious RAM (E. Stefanov, M. Van Dijk, E. Shi, C. Fletcher, L. Ren, X. Yu, and S. Devadas, "Path oram: an extremely simple oblivious ram protocol, " in Proceedings of the 20th ACM Conference on Computer and Communications Security (CCS), Berlin, Germany, Oct. 2013) permettant de cacher les accès à une ressource, combinés aux instructions cmov, est proposé.
OBFSCURO parvient ainsi à prévenir certaines attaques par canaux auxiliaires, en l'espèce celles par timing ou par cache.
The use of the cmov instruction has been described in the document Adil Ahmad, Byunggill Joe, Yuan Xiao, Yinqian Zhang, Insik Shin, and Byoungyoung Lee, OBFSCURO: A Commodity Obfuscation Engine on Intel SGX, NDSS 2019, to which those skilled in the art may refer (see also Adil Ahmad, Kyungtae Kim, Muhammad Ihsanulhaq Sarfaraz, Byoungyoung Lee: OBLIVIATE: A Data Oblivious Filesystem for Intel SGX. NDSS 2018 ) as a solution to vulnerabilities in the SGX (Secure Guard Extensions) environment.
More specifically, SGX proposes to allocate private memory regions (called secure enclaves), the content of which is protected and inaccessible in reading or writing, including by processes executed at higher privilege levels, ie to have a space where programs can be executed with confidentiality and integrity, in particular, protected from the OS, in order to safely implement sensitive algorithms. We can think of the enclave as a “reverse sandbox”, allowing a more robust black box implementation. In other words, we understand that SGX does not in itself offer any white box protection: the programs that are executed in the enclave are generally written in an ordinary way, with keys and internal states accessible, the protection being ensured by the watertight nature of the enclave.
In addition, this architecture has turned out to be susceptible to attack in many ways, for example by auxiliary channel attacks (leaks, cache attacks, on data access reasons) or by Specter type attacks.
OBLIVIATE / OBFSCURO solutions aim to correct some of these vulnerabilities by adding “obliviousness”, that is to say the fact of not leaving traces (for example the cache) that could be detected by attacks by auxiliary channels. For this, the use of Oblivious RAM type algorithms ( E. Stefanov, M. Van Dijk, E. Shi, C. Fletcher, L. Ren, X. Yu, and S. Devadas, "Path oram: an extremely simple oblivious ram protocol, " in Proceedings of the 20th ACM Conference on Computer and Communications Security (CCS), Berlin, Germany, Oct. 2013 ) allowing to hide accesses to a resource, combined with cmov instructions , is proposed.
OBFSCURO thus manages to prevent certain attacks by auxiliary channels, in this case those by timing or by cache.

Cependant, on constate que de nombreuses autres attaques par canaux auxiliaires restent possibles, en particulier les attaques par consommation, émanations électromagnétiques, fautes, et de manière générale les attaques possibles dès que l'on a un accès intégral au matériel.
En d'autres termes, si OBFSCURO est efficace dans le cas d'algorithmes cryptographiques implémentés sur un équipement distant tel qu'un serveur, ce n'est pas le cas pour un équipement 10a de type terminal mobile.
However, we note that many other attacks by auxiliary channels remain possible, in particular attacks by consumption, electromagnetic emanations, faults, and in general the attacks possible as soon as one has full access to the equipment.
In other words, if OBFSCURO is effective in the case of cryptographic algorithms implemented on remote equipment such as a server, this is not the case for equipment 10a of the mobile terminal type.

L'idée à la base du présent procédé est que tout code informatique peut n'être écrit QUE en utilisant l'instruction cmov, et de là de résoudre les limitations d'OBFSCURO.
En effet, il a été démontré que l'instruction (non-conditionnelle) mov est Turing-complète, et donc que l'on peut réécrire tout code entièrement à partir de l'instruction mov.
Il existe notamment le compilateur M/o/Vfuscator qui prend en entrée du code x86 et le récrit en utilisant uniquement l'instruction mov. Naturellement le code obtenu est inutilement long et complexe et de ce fait obfusqué. On note qu'en moyenne la taille du fichier de code est multipliée par 35 par la réécriture.
A partir de là, le même code écrit cette fois-ci avec des instructions cmov au lieu de mov devient inattaquable, y compris en cas de matériel accessible et donc en environnement boite blanche, car chaque instruction du code est intraçable du fait du caractère conditionnel.
Naturellement, il faut qu'au moins une occurrence de ladite instruction cmov dans ladite partie obfusquée du code soit factice. Par « factice », on entend telle que la condition n'est vraie durant l'exécution normale dudit code, et donc que le déplacement défini par cette instruction n'est pas destiné à être mis en œuvre. On parle également d'instruction leurre dans le sens où elle n'est là que pour tromper un attaquant et non pour contribuer à l'algorithme. En d'autres termes, si le déplacement indiqué par cette instruction était réellement effectué, l'exécution entrainerait une erreur.
The idea behind the present process is that any computer code can be written ONLY using the cmov instruction , and hence overcome the limitations of OBFSCURO.
Indeed, it has been shown that the (unconditional) mov instruction is Turing-complete, and therefore that we can rewrite any code entirely from the mov instruction .
In particular, there is the M / o / Vfuscator compiler which takes x86 code as input and rewrites it using only the mov instruction . Naturally, the code obtained is unnecessarily long and complex and therefore obfuscated. It is noted that on average the size of the code file is multiplied by 35 by the rewrite.
From there, the same code written this time with cmov instructions instead of mov becomes unassailable, including in the case of accessible hardware and therefore in a white box environment, because each instruction of the code is untraceable due to the conditional character .
Of course, at least one occurrence of said cmov instruction in said obfuscated part of the code must be dummy. The term “dummy” is understood to mean such that the condition is not true during the normal execution of said code, and therefore that the displacement defined by this instruction is not intended to be implemented. We also talk about a decoy instruction in the sense that it is only there to deceive an attacker and not to contribute to the algorithm. In other words, if the movement indicated by this instruction was actually performed, execution would result in an error.

Plus précisément, supposons que le code puisse être écrit avec N instructions mov, si seules N instructions cmov sont utilisées c'est que la condition est vraie tout le temps et qu'aucune ne simule de déplacement. Si on utilise N'>N instructions cmov, alors même en sachant qu'il n'y a que N instructions qui sont réellement à mettre en œuvre, un attaquant ne saurait pas lesquelles elles sont et ne pourrait les distinguer des N'-N>0 instructions factices.
Dans le mode de réalisation préféré où chaque instruction cmov déclenche un déplacement réel ou une simulation, l'instruction factice est destinée à mettre en œuvre une simulation de déplacement dans le premier opérande du deuxième opérande.
En résumé, lors de l'exécution de la partie obfusquée chaque instruction cmov sera exécutée, qu'elle soit réelle ou factice, mais seule l'exécution des cmov réelles donnera lieu à un déplacement effectif et correct (l'exécution des cmov factices donnant lieu soit à un faux déplacement, soit à un déplacement incorrect)
More precisely, suppose that the code can be written with N mov instructions , if only N cmov instructions are used, then the condition is true all the time and none of them simulate a movement. If we use N '> N cmov instructions , then even knowing that there are only N instructions which are really to be implemented, an attacker would not know which they are and could not distinguish them from N'-N > 0 dummy instructions.
In the preferred embodiment where each cmov instruction triggers an actual displacement or a simulation, the dummy instruction is for implementing a displacement simulation in the first operand of the second operand.
In summary, during the execution of the obfuscated part each cmov instruction will be executed, whether real or dummy, but only the execution of the real cmovs will give rise to an effective and correct displacement (the execution of the dummy cmovs giving either a false displacement or an incorrect displacement)

Selon un premier mode de réalisation, on pourra exécuter le code obfusqué dans un environnement d'exécution sécurisée tel que SGX en utilisant par exemple pour chaque cmov le wrapper tel que défini précédemment.
Si l'on souhaite un environnement intégralement boite blanche (i.e. exécuté de manière conventionnelle et non-sécurisée sur tout processeur), selon un deuxième mode de réalisation on pourra utiliser un wrapper inspiré de ce qui est décrit dans le document Emmanuel Prouff, Matthieu Rivain: A Generic Method for Secure SBox Implementation. WISA 2007.
Ce document propose une implémentation d'une S-Box dans laquelle on considère toutes les valeurs possibles de 0 à 2k -1 (en supposant la S-Box à valeurs dans F 2 k

Figure imgb0005
) d'un objet qui sont toutes fausses sauf une. On peut étendre ce principe aux instructions cmov : chaque instruction mov est dupliquée en une pluralité d'instructions cmov dont une « vraie » et le reste factice. En d'autres termes, en supposant que le code puisse être écrit avec N instructions mov et que l'on a M valeurs possibles d'un objet, on utilise NxM instructions cmov dont N instructions réelles et Nx(M-1) factices.
Plus précisément, pour un ensemble d'instructions cmovi,i<M (cmovi désignant la i-ème instruction cmov de l'ensemble) « associées » dont une réelle et M-1 factices, correspondant à toutes les M valeurs possibles oi d'un objet noté o, dont une valeur attendue r, on a :

  • pour chaque cmovi, la condition est « o est égal à oi » ;
  • l'instruction réelle est cmovj telle que oj =r ;
  • toutes les autres cmovi (i.e. oi r) sont des instructions factices.
A ce titre, l'homme du métier pourra utiliser comme wrapper l'un des algorithmes de ce document Emmanuel Prouff, Matthieu Rivain: A Generic Method for Secure SBox Implementation. WISA 2007.
Alternativement ou en complément, pour être sur de pouvoir contrer un adversaire voulant fauter l'exécution, on peut utiliser des techniques de duplications en implémentant des threads d'exécution parallèle des différentes instructions cmov alternatives (réelles ou factices, en particulier d'exécution simultanée des M instructions cmov correspondant aux M différentes valeurs d'un objet), voir le document Oscar Reparaz, Lauren De Meyer, Begül Bilgin, Victor Arribas, Svetla Nikova, Ventzislav Nikov, Nigel P. Smart: CAPA: The Spirit of Beaver Against Physical Attacks. CRYPTO (1) 2018.
En combinant toutes ces techniques d'obfuscation, et en prenant M=28 =256 on note que la taille du code d'origine implémentant l'algorithme cryptographique est typiquement multipliée par au moins 10000. Sachant que chacune des instructions peut être aussi bien réelle que factice, on comprend qu'il n'est plus possible par aucune attaque par canal auxiliaire que ce soit d'identifier d'information exploitable.According to a first embodiment, the obfuscated code can be executed in a secure execution environment such as SGX by using, for example, for each cmov the wrapper as defined above.
If you want a fully white box environment (ie executed in a conventional and non-secure manner on any processor), according to a second embodiment, you can use a wrapper inspired by what is described in the document Emmanuel Prouff, Matthieu Rivain : A Generic Method for Secure SBox Implementation. WISA 2007.
This document proposes an implementation of an S-Box in which we consider all possible values from 0 to 2 k - 1 (assuming the S-Box with values in F 2 k
Figure imgb0005
) of an object which are all false except one. We can extend this principle to cmov instructions: each mov instruction is duplicated in a plurality of cmov instructions, one of which is “real” and the rest dummy. In other words, assuming the code can be written with N mov and that one has M possible values of an object instructions are used NxM instructions cmov which actual instructions N and Nx (M-1) dummy.
More precisely, for a set of cmov i instructions , i <M ( cmov i designating the i-th cmov instruction of the set) “associated” including one real and M-1 dummy, corresponding to all the M possible values o i of an object denoted o , with an expected value r , we have:
  • for each cmov i , the condition is “ o is equal to o i ”;
  • the actual instruction is cmov j such that o j = r ;
  • all other cmov i (ie o i r ) are dummy instructions.
As such, a person skilled in the art may use as a wrapper one of the algorithms of this document Emmanuel Prouff, Matthieu Rivain: A Generic Method for Secure SBox Implementation. WISA 2007.
Alternatively or in addition, to be sure to be able to counter an adversary wanting to fault the execution, one can use duplicating techniques by implementing parallel execution threads of the various alternative cmov instructions (real or dummy, in particular simultaneous execution. M cmov instructions corresponding to the M different values of an object), see the document Oscar Reparaz, Lauren De Meyer, Begül Bilgin, Victor Arribas, Svetla Nikova, Ventzislav Nikov, Nigel P. Smart: CAPA: The Spirit of Beaver Against Physical Attacks. CRYPTO (1) 2018.
By combining all these obfuscation techniques, and taking M = 2 8 = 256, we note that the size of the original code implementing the cryptographic algorithm is typically multiplied by at least 10,000. Knowing that each of the instructions can be as well real than fictitious, we understand that it is no longer possible by any attack by auxiliary channel whatsoever to identify exploitable information.

Procédé d'obfuscationObfuscation process

Selon un deuxième aspect, et en référence à la figure 2 , est proposé un procédé d'obfuscation d'un algorithme cryptographique à clé secrète donnée représentée par un premier code informatique, i.e. un procédé d'obtention dudit code obfusqué (qui sera désigné comme troisième code) pour la mise en œuvre de l'algorithme, conformément au premier aspect. Le premier code est typiquement le code en langage d'assemblage tel qu'écrit directement ou compilé depuis un langage de programmation classique, i.e. non-obfusqué et utilisant des instructions variées.According to a second aspect, and with reference to the figure 2 , a method of obfuscating a cryptographic algorithm with a given secret key is proposed represented by a first computer code, ie a method of obtaining said obfuscated code (which will be designated as the third code) for the implementation of the algorithm, in accordance with the first aspect. The first code is typically the assembly language code such as written directly or compiled from a classical programming language, ie unobfused and using various instructions.

Ce procédé est typiquement mis en œuvre de manière sécurisée sur le serveur 10b.This method is typically implemented in a secure manner on the server 10b.

Ainsi, les moyens de traitement de données 11b du serveur 10b commencent par une étape (a) de réécriture du premier code en un deuxième code dans lequel au moins une partie dite obfusquée dudit code utilisant ladite clé secrète n'utilise qu'une seule instruction dite mov, qui est une instruction de déplacement non-conditionnelle dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction.Thus, the data processing means 11b of the server 10b begin with a step (a) of rewriting the first code into a second code in which at least one so-called obfuscated part of said code using said secret key uses only one instruction said mov, which is an unconditional movement instruction in a first operand of the instruction of a second operand of the instruction.

En d'autres termes, le code d'origine est transformé en mov-only par l'utilisation d'un outil tel que M/o/Vfuscator. In other words, the original code is turned into mov-only through the use of a tool such as M / o / Vfuscator.

A noter que le deuxième code peut être directement compilé depuis un premier code qui ne serait pas en un langage d'assemblage.Note that the second code can be directly compiled from a first code which is not in an assembly language.

Dans une étape (b) suivante, est généré un troisième code correspondant au deuxième code dans lequel chaque instruction mov de la partie obfusquée est remplacée par une instruction dite cmov, qui est une instruction de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction. A ce stade, chaque instruction cmov est une instruction réelle, c'est pourquoi l'étape (b) comprend l'ajout dans le troisième code d'au moins une instruction cmov factice.In a following step (b), a third code is generated corresponding to the second code in which each mov instruction of the obfuscated part is replaced by an instruction called cmov, which is a conditional displacement instruction in a first operand of the instruction d 'a second operand of the instruction. At this point, each cmov instruction is an actual instruction, which is why step (b) includes adding at least one dummy cmov instruction in the third code.

Pour cela, comme expliqué, il est possible d'ajouter une pluralité d'instruction cmov factice pour chaque instruction cmov réelle, notamment en dupliquant l'instruction cmov réelle autant de fois qu'un objet peut prendre de valeurs.For this, as explained, it is possible to add a plurality of dummy cmov instruction for each real cmov instruction, in particular by duplicating the real cmov instruction as many times as an object can take values.

Enfin, le procédé d'obfuscation peut comprendre une étape (c) de transmission à l'équipement 10a du troisième code pour stockage sur des moyens de stockage 12a d'un équipement 10a en vue de l'exécution par des moyens de traitement de données 11a de l'équipement 10a pour mise en œuvre dudit algorithme cryptographique, i.e. le procédé selon le premier aspect.Finally, the obfuscation method can comprise a step (c) of transmission to the equipment 10a of the third code for storage on storage means 12a of an equipment 10a with a view to execution by data processing means. 11a of the equipment 10a for setting implementation of said cryptographic algorithm, ie the method according to the first aspect.

Produit programme d'ordinateurComputer program product

Selon un troisième et un quatrième aspects, l'invention concerne un produit programme d'ordinateur comprenant des instructions de code pour l'exécution (en particulier sur les moyens de traitement de données 11a, 11b de l'équipement 10a et/ou du serveur 10b) d'un procédé selon le premier ou le deuxième aspect de l'invention de mise en œuvre ou d'obfuscation d'un algorithme cryptographique à clé secrète donnée, ainsi que des moyens de stockage lisibles par un équipement informatique (une mémoire 12a, 12b de l'équipement 10a et/ou du serveur 10b) sur lequel on trouve ce produit programme d'ordinateur.According to a third and a fourth aspect, the invention relates to a computer program product comprising code instructions for execution (in particular on the data processing means 11a, 11b of the equipment 10a and / or of the server. 10b) of a method according to the first or second aspect of the invention for implementing or obfuscating a cryptographic algorithm with a given secret key, as well as storage means readable by computer equipment (a memory 12a , 12b of the equipment 10a and / or of the server 10b) on which this computer program product is found.

Claims (14)

Procédé de mise en œuvre d'un algorithme cryptographique à clé secrète donnée comprenant l'exécution par des moyens de traitement de données (11a) d'un équipement (10a) d'un code implémentant ledit algorithme cryptographique stocké sur des moyens de stockage de données (12a) de l'équipement (10a), le procédé étant caractérisé en ce qu'au moins une partie dite obfusquée dudit code paramétrée avec ladite clé secrète n'utilise qu'une seule instruction dite cmov, qui est une instruction de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction, au moins une occurrence de ladite instruction cmov dans ladite partie obfusquée du code étant factice.Method for implementing a cryptographic algorithm with a given secret key comprising the execution by data processing means (11a) of an item of equipment (10a) of a code implementing said cryptographic algorithm stored on storage means of data (12a) of the equipment (10a), the method being characterized in that at least one so-called obfuscated part of said code parameterized with said secret key uses only a single so-called cmov instruction , which is a move instruction conditional in a first operand of the instruction of a second operand of the instruction, at least one occurrence of said cmov instruction in said obfuscated part of the code being dummy. Procédé selon la revendication 1, dans lequel ladite instruction cmov de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction met en œuvre : - soit, si une condition est vérifiée, le déplacement effectif dans le premier opérande du deuxième opérande ; - soit, si ladite condition n'est pas vérifiée, une simulation de déplacement dans le premier opérande du deuxième opérande ; ladite occurrence factice de l'instruction cmov étant destinée à mettre en œuvre ladite simulation de déplacement dans le premier opérande du deuxième opérande lors de l'exécution normale dudit code.The method of claim 1, wherein said conditional displacement cmov instruction in a first operand of the instruction of a second operand of the instruction implements: - or, if a condition is verified, the effective displacement in the first operand of the second operand; - or, if said condition is not verified, a displacement simulation in the first operand of the second operand; said dummy occurrence of the cmov instruction being intended to implement said displacement simulation in the first operand of the second operand during the normal execution of said code. Procédé selon la revendication 2, dans lequel ladite simulation de déplacement dans le premier opérande du deuxième opérande comprend soit le déplacement effectif dans le premier opérande du premier opérande, soit le déplacement effectif du deuxième opérande ailleurs que dans le premier opérande.The method of claim 2, wherein said simulating displacement in the first operand of the second operand comprises either the actual displacement in the first operand of the first operand or the effective displacement of the second operand elsewhere than in the first operand. Procédé selon l'une des revendications 1 et 3, dans lequel chaque instruction cmov de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction est exprimée à partir d'une instruction dite mov de déplacement non-conditionnel dans le premier opérande du deuxième opérande, encapsulée.Method according to one of claims 1 and 3, wherein each cmov conditional displacement instruction in a first operand of instructing a second operand of the instruction is expressed from a said mov non-conditional move instruction in the first operand from the second operand, encapsulated. Procédé selon l'une des revendications 1 et 4, dans lequel les moyens de traitement de données (11a) mettent en œuvre un environnement d'exécution sécurisée dans lequel ledit code implémentant ledit algorithme cryptographique est exécuté, tel que l'environnement Secure Guard Extension.Method according to one of claims 1 and 4, wherein the data processing means (11a) implement a secure execution environment in which said code implementing said cryptographic algorithm is executed, such as the Secure Guard Extension environment. . Procédé selon l'une des revendications 1 et 5, dans lequel ladite partie de code obfusquée comprend une pluralité d'occurrences factices d'instructions cmov pour chaque occurrence réelle d'une instruction cmov. The method of one of claims 1 and 5, wherein said obfuscated portion of code comprises a plurality of dummy instances of cmov instructions for each actual occurrence of a cmov instruction . Procédé selon la revendication 6, dans lequel, pour un ensemble d'une occurrence réelle et des M-1 occurrences factices correspondantes d'instructions cmov, correspondant à toutes les M valeurs possibles oi d'un objet noté o, dont une valeur attendue r, on a : - pour la i-ème occurrence de l'ensemble, la condition de déplacement est « o est égal à oi » ; - l'occurence réelle est la j-ième telle que oj =r ; - toutes les autres occurrences de l'ensemble sont des occurrences factices. Method according to Claim 6, in which, for a set of a real occurrence and of the corresponding M-1 dummy occurrences of cmov instructions , corresponding to all the M possible values o i of an object denoted o , of which an expected value r , we have: - for the i-th occurrence of the set, the displacement condition is “ o is equal to o i ”; - the real occurrence is the j-th such that o j = r ; - all the other occurrences of the set are dummy occurrences. Procédé selon l'une des revendications 1 à 7, dans lequel ledit code est dans un langage d'assemblage des moyens de traitement de données (11a).Method according to one of claims 1 to 7, wherein said code is in an assembly language of the data processing means (11a). Procédé selon la revendication 8, dans lequel ledit langage d'assemblage est l'assembleur x86.A method according to claim 8, wherein said assembly language is x86 assembler. Procédé selon l'une des revendications 1 à 9, dans lequel ledit algorithme cryptographique est un algorithme de chiffrement symétrique, ladite partie obfusquée du code implémentant au moins un tour dudit algorithme de chiffrement symétrique.Method according to one of claims 1 to 9, wherein said cryptographic algorithm is a symmetric encryption algorithm, said obfuscated part of the code implementing at least one turn of said symmetric encryption algorithm. Procédé d'obfuscation d'un algorithme cryptographique à clé secrète donnée représentée par un premier code informatique, comprenant la mise en œuvre par des moyens de traitement de données (11b) d'un serveur (10b) d'étapes de : (a) réécriture du premier code en un deuxième code dans lequel au moins une partie dite obfusquée dudit code utilisant ladite clé secrète n'utilise qu'une seule instruction dite mov, qui est une instruction de déplacement non-conditionnelle dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction ; (b) génération d'un troisième code correspondant au deuxième code dans lequel chaque instruction mov de la partie obfusquée est remplacée par une instruction dite cmov, qui est une instruction de déplacement conditionnel dans un premier opérande de l'instruction d'un deuxième opérande de l'instruction, au moins une instruction cmov factice étant ajoutée. Method of obfuscating a cryptographic algorithm with a given secret key represented by a first computer code, comprising the implementation by means of data processing (11b) of a server (10b) of steps of: (a) rewriting the first code into a second code in which at least a so-called obfuscated part of said code using said secret key uses only a single so-called mov instruction , which is an unconditional displacement instruction in a first operand of instruction of a second operand of the instruction; (b) generation of a third code corresponding to the second code in which each mov instruction of the obfuscated part is replaced by a so-called cmov instruction , which is a conditional displacement instruction in a first operand of the instruction of a second operand of the instruction, at least one dummy cmov instruction being added. Procédé selon la revendication 11, comprenant une étape (c) de transmission à l'équipement (10a) du troisième pour stockage sur des moyens de stockage (12a) d'un équipement (10a) en vue de l'exécution par des moyens de traitement de données (11a) de l'équipement (10a) pour mise en œuvre dudit algorithme cryptographique.Method according to claim 11, comprising a step (c) of transmitting to the equipment (10a) of the third for storage on storage means (12a) of an equipment (10a) with a view to execution by means of processing of data (11a) of the equipment (10a) for implementing said cryptographic algorithm. Produit programme d'ordinateur comprenant des instructions de code pour l'exécution d'un procédé selon l'une des revendications 1 à 12 de mise en œuvre ou d'obfuscation d'un algorithme cryptographique à clé secrète donnée, lorsque ledit programme est exécuté par un ordinateur.Computer program product comprising code instructions for executing a method according to one of claims 1 to 12 for implementing or obfuscating a cryptographic algorithm with a given secret key, when said program is executed by a computer. Moyen de stockage lisible par un équipement informatique sur lequel un produit programme d'ordinateur comprend des instructions de code pour l'exécution d'un procédé selon l'une des revendications 1 à 12 de mise en œuvre ou d'obfuscation d'un algorithme cryptographique à clé secrète donnée.Storage means readable by computer equipment on which a computer program product comprises code instructions for the execution of a method according to one of claims 1 to 12 for setting work or obfuscation of a cryptographic algorithm with a given secret key.
EP20176724.1A 2019-05-27 2020-05-27 Methods for implementation and obfuscation of a cryptographic algorithm with secret data key Pending EP3745638A1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
FR1905592A FR3096851B1 (en) 2019-05-27 2019-05-27 METHODS FOR IMPLEMENTING AND OBFUSCING A CRYPTOGRAPHIC ALGORITHM WITH A GIVEN SECRET KEY

Publications (1)

Publication Number Publication Date
EP3745638A1 true EP3745638A1 (en) 2020-12-02

Family

ID=68581848

Family Applications (1)

Application Number Title Priority Date Filing Date
EP20176724.1A Pending EP3745638A1 (en) 2019-05-27 2020-05-27 Methods for implementation and obfuscation of a cryptographic algorithm with secret data key

Country Status (6)

Country Link
US (1) US20200382271A1 (en)
EP (1) EP3745638A1 (en)
JP (1) JP2020194157A (en)
KR (1) KR20200136315A (en)
CA (1) CA3081448A1 (en)
FR (1) FR3096851B1 (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6449713B1 (en) * 1998-11-18 2002-09-10 Compaq Information Technologies Group, L.P. Implementation of a conditional move instruction in an out-of-order processor
US8312297B2 (en) * 2005-04-21 2012-11-13 Panasonic Corporation Program illegiblizing device and method
US9794602B2 (en) * 2012-10-29 2017-10-17 Echostar Technologies L.L.C. Systems and methods for securely providing streaming media content on-demand
US10089500B2 (en) * 2015-09-25 2018-10-02 Intel Corporation Secure modular exponentiation processors, methods, systems, and instructions
FR3063857B1 (en) * 2017-03-08 2020-02-14 Safran Identity & Security METHOD FOR ELECTRONIC SIGNING OF A DOCUMENT WITH A PREDETERMINED SECRET KEY
US10620961B2 (en) * 2018-03-30 2020-04-14 Intel Corporation Apparatus and method for speculative conditional move operation
US11503000B2 (en) * 2019-03-29 2022-11-15 Intel Corporation Technologies for establishing secure channel between I/O subsystem and trusted application for secure I/O data transfer

Non-Patent Citations (14)

* Cited by examiner, † Cited by third party
Title
ADIL AHMAD ET AL: "OBFUSCURO: A Commodity Obfuscation Engine on Intel SGX", PROCEEDINGS 2019 NETWORK AND DISTRIBUTED SYSTEM SECURITY SYMPOSIUM, 24 February 2019 (2019-02-24), Reston, VA, XP055673374, ISBN: 978-1-891562-55-6, DOI: 10.14722/ndss.2019.23513 *
ADIL AHMADBYUNGGILL JOEYUAN XIAOYINQIAN ZHANGINSIK SHINBYOUNGYOUNG LEE: "OBFSCURO: A Commodity Obfuscation Engine on Intel SGX", NDSS, 2019
ADIL AHMADKYUNGTAE KIMMUHAMMAD IHSANULHAQ SARFARAZBYOUNGYOUNG LEE: "OBLIVIATE: A Data Oblivious Filesystem for Intel SGX", NDSS, 2018
ASHAY RANE ET AL: "Raccoon: Closing Digital Side-Channels through Obfuscated Execution", 12 August 2015 (2015-08-12), pages 442 - 457, XP061024840, Retrieved from the Internet <URL:https://www.usenix.org/sites/default/files/sec15_full_proceedings_interior.pdf> [retrieved on 20150812] *
ASHAY RANECALVIN LINMOHIT TIWARI: "Raccoon: Closing Digital Side-Channels through Obfuscated Execution", USENIX SECURITY SYMPOSIUM, 2015
BRECHT WYSEUR SOFTWARE SECURITY: WHITE-BOX CRYPTOGRAPHY. PHD THESIS, 2009
E. STEFANOVM. VAN DIJKE. SHIC. FLETCHERL. RENX. YUS. DEVADAS: "Path oram: an extremely simple oblivious ram protocol", PROCEEDINGS OF THE 20TH ACM CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY (CCS), October 2013 (2013-10-01)
EMMANUEL PROUFFMATTHIEU RIVAIN: "A Generic Method for Secure SBox Implementation", WISA, 2007
JACOB, M.BONEH, D.FELTEN, E.: "ACM Workshop on Digital Rights Management", November 2002, SPRINGER, article "Attacking an obfuscated cipher by injecting faults", pages: 16 - 31
JOPPE W BOSCHARLES HUBAINWIL MICHIELSPHILIPPE TEUWEN: "Differential Computation Analysis: Hiding Your White-Box Designs is Not Enough", CHES2016
OSCAR REPARAZLAUREN DE MEYERBEGÜL BILGINVICTOR ARRIBASSVETLA NIKOVAVENTZISLAV NIKOVNIGEL P. SMART: "CAPA: The Spirit of Beaver Against Physical Attacks", CRYPTO, vol. 1, 2018
SANFELIXELOICRISTOFARO MUNEAND JOB DE HAAS: "Unboxing the white-box", BLACK HAT EU 2015, 2015
SÉBASTIEN DUQUETTE: "REcon 2015 - The movfuscator (Christopher Domas)", YOUTUBE, 16 February 2016 (2016-02-16), pages 1 - 2, XP054980284, Retrieved from the Internet <URL:https://www.youtube.com/watch?v=2VF_wPkiBJY> [retrieved on 20200305] *
TILLICH STEFAN ET AL: "Protecting AES Software Implementations on 32-Bit Processors Against Power Analysis", 5 June 2007, ROBOCUP 2008: ROBOCUP 2008: ROBOT SOCCER WORLD CUP XII; [LECTURE NOTES IN COMPUTER SCIENCE; LECT.NOTES COMPUTER], SPRINGER INTERNATIONAL PUBLISHING, CHAM, PAGE(S) 141 - 157, ISBN: 978-3-319-10403-4, XP047503088 *

Also Published As

Publication number Publication date
KR20200136315A (en) 2020-12-07
JP2020194157A (en) 2020-12-03
US20200382271A1 (en) 2020-12-03
FR3096851B1 (en) 2021-05-21
FR3096851A1 (en) 2020-12-04
CA3081448A1 (en) 2020-11-27

Similar Documents

Publication Publication Date Title
EP2380305B1 (en) Cryptography circuit particularly protected against information-leak observation attacks by the ciphering thereof
US10097342B2 (en) Encoding values by pseudo-random mask
EP2893431B1 (en) Protection against side channel attacks
US9455833B2 (en) Behavioral fingerprint in a white-box implementation
EP3169017B1 (en) Split-and-merge approach to protect against dfa attacks
CN106888081B (en) Wide coding of intermediate values within white-box implementations
EP1745366A1 (en) Method for protecting a cryptographic assembly by a homographic masking
CN107273724B (en) Watermarking input and output of white-box implementations
FR3011653A1 (en) MASKING AND DEMASQUING METHODS AND DEVICES
KR20100031106A (en) Data security
FR3069935A1 (en) DEVICES AND METHODS FOR INTELLECTUAL PROPERTY PROTECTION OF SOFTWARE FOR INTEGRATED PLATFORMS
EP3745638A1 (en) Methods for implementation and obfuscation of a cryptographic algorithm with secret data key
EP2940917A1 (en) Behavioral fingerprint in a white-box implementation
CA2988357C (en) Encryption method, corresponding encryption method, devices and programs
FR3069993A1 (en) DEVICES AND METHODS FOR MASKING RSA ENCRYPTION OPERATIONS
FR2922393A1 (en) TRACABLE SYSTEM FOR THE ENCRYPTION / ENCRYPTION OF DIFFUSED DIGITAL DATA
EP3278259B1 (en) Data protection
EP3547602A1 (en) Method for implementing a cryptographic function for a secret key
EP2153575B1 (en) Obtaining derived values depending on a secret master value
EP3267618A1 (en) Equality check implemented with secret sharing
WO2024083849A1 (en) White box encoding
FR2995110A1 (en) Method for optimizing use of e.g. memory, of electronic device i.e. smart card, involves protecting smart card from physical attacks by masking from substitution box and inverse substitution box upon implementing cryptographic algorithm
FR3112643A1 (en) Apparatus, method and program for secure communication between white boxes

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: REQUEST FOR EXAMINATION WAS MADE

17P Request for examination filed

Effective date: 20200527

AK Designated contracting states

Kind code of ref document: A1

Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

AX Request for extension of the european patent

Extension state: BA ME

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: EXAMINATION IS IN PROGRESS

17Q First examination report despatched

Effective date: 20211105

P01 Opt-out of the competence of the unified patent court (upc) registered

Effective date: 20230919

GRAP Despatch of communication of intention to grant a patent

Free format text: ORIGINAL CODE: EPIDOSNIGR1

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: GRANT OF PATENT IS INTENDED

INTG Intention to grant announced

Effective date: 20231031