The present invention relates to the field of securing and protecting the execution of a computer code by a processing unit of an item of electronic equipment, as well as the devices associated thereto, for example, chip cards.
Chip cards are the subject of many hacking attempts, through either active or passive attacks. An active attack consists in injecting a fault for physically disturbing the integrated circuit of the chip card, with a view to modifying the behavior of the latter and to trap the software code towards another type of execution.
On the contrary, a passive attack for example through a side-channel, the hacker tries to make a statistical analysis of measurable magnitudes in the chip such as the electric supply current or the electromagnetic radiations emitted by the chip in order to master or to deduce the chip execution tasks.
In order to remedy such attacks, it is known to use and insert, upon the execution of a command, random delays, i.e. delays the duration of which is selected in a random or pseudo-random way, as a countermeasure to such attacks in order to make these more complex. As a matter of fact, the presence of such random delays makes it difficult to determine the moment at which the fault must be injected by the pirate, upon the execution of a process and prevents the pirate from being synchronized to carry out side channel measurements.
In the present description and in the claims, “source code” means a sequence of executable instructions forming the whole or a part of a computer application.
Similarly, an “executed code” will mean a sequence of instructions really played by the processor upon the execution of the whole or a part of the corresponding application.
It is known to insert into the source coder portions of the code the result of which is not necessary for the normal execution of the code in question. These code portions are generally called “decoys”. The characteristic of these decoys, during a side channel analysis, consists in that they look like true important sequences of code.
The common aim of such countermeasures (decoys or random delays) consist in making attacks from the outside more difficult by preventing the pirate from understanding and/or predicting with accuracy the execution of the program.
Inserting such countermeasures at multiple locations during the execution of a source code by the chip is frequent. More particularly, it has been found to secure the execution of delicate or risky operations (such as the writing/reading in or from the memory, a cryptographic calculation, a decision making algorithm) with such countermeasures. As a matter of fact, these delicate operations are much solicited by the pirates and it seems right to insert many countermeasures all along the execution of the source code, prior to or during such delicate operations.
A drawback of this solution lies in the fact that it is possible to identify the presence of these countermeasures during the side channel analysis in spite of the efforts to make them as little visible as possible. These countermeasures are generally positioned close to the critical sequences of the source code and their detection may allow positioning the attacks as close to the crucial points as possible.
The present invention aims at solving this disadvantage by providing to vary the number of countermeasures really accomplished from one execution to the other.
For this purpose, the present invention firstly aims at a method for securing the execution of a source code by a processing unit of an item of electronic equipment, with this method comprising a step of inserting dummy operations, a part of the dummy operations not executing in full. in the following description, these particular dummy operations will be called “partial countermeasures”.
The number of partial countermeasures may vary between two executions of the program in question. These variations may occur according to calculation rules, or in an unpredictable way. A possible way to obtain an unpredictable item of information is to generate it randomly.
To reach this goal, the invention provides cutting the countermeasures into two parts, one part which will be called the introductory part and one part which will be called the body. The countermeasures which execute only partially, execute only the introductory part thereof.
Preferably, when the number of partial countermeasures is defined, the selection of the countermeasures becoming partial can be done according to defined rules or unpredictably.
Other characteristics and advantages of the invention will appear upon reading the following description which is made hereinunder as an indication and not a limitation, and referring to the appended drawings wherein:
This figure shows a source code 11 wherein a countermeasure 112 has been inserted. The latter includes a body 16 preceded by an introductory part 15. Similarly, a second countermeasure 114 includes a body 18 preceded by the introductory part 17 thereof. A third particular countermeasure 111 is composed of two bodies 13 and 14 and the introductory part 12 thereof. This Figure further includes a fourth countermeasure 113 having a composition identical to the countermeasure 111.
In this exemplary embodiment, four countermeasures 111 to 114 are thus inserted into the source code 11. According to the invention, these countermeasures can be divided into two parts. It should be noted that the introductory part is always executed by the application. In order to prevent the identification of the countermeasures by a hacker, it any, these introductory parts must be reduced to the minimum, as regards their size.
In a preferred embodiment, the introductory part will be limited to the calling of instructions already called regularly in the course of the code. These current instructions are, for example, modifications in the general purpose register of the microprocessor, or modifications in internal variables. The aim is that, during a side channel analysis, the introductory parts of the countermeasures cannot be distinguished from the executed code.
In this embodiment, particular countermeasures 111 and 113 can be seen. These countermeasures have the particularity of having several bodies 13 and 14 for only one introductory part 12. Each body 13 and 14 is an independent countermeasure, for example a delay or a decoy. Thus, the introductory part 12 will decide to execute the body or not, but will also decide which of the available bodies will be executed.
When looking at
In one embodiment, the countermeasures used are random delays and abridged in Rnd in the following. This function can be divided into two parts:
Upon the creation of the code, the programmers made a point to insert a large number of Rnds almost everywhere in the code. For example, approximately three times as many Rnds are inserted as in a so-called protected standard code, which is protected against side channel attacks, not implementing the present invention. Thus, by executing in full only one third of these Rnds, the thus protected code will be, upon the execution thereof, almost as fast as the same code protected by conventional Rnds, all executed in full but with a highly increased safety.
In one embodiment, upon the initiation of the program, two random values are drawn:
Thus, upon the execution of a code, upon each execution of a Rnd, the Rnd function itself, during the execution of the introductory part thereof, tests the wch and nbr values, and decides whether it will let the body of the function execute or not.
Another embodiment of the invention relates to material countermeasures. A known utilization of countermeasures consists in making dummy activations of peripheral members such as cryptographic accelerators (AC) and or random numbers generators. The invention provides to position a large number of AC potential activation sites which can be compared to the introductory parts of countermeasures. The AC, which can be compared to the body of the countermeasure, will be activated only at some locations.
In one preferred embodiment of the invention, everything is made so that it is impossible to predict which of the positions will be activated between two executions.
In one preferred embodiment of the invention, the invention will be implemented in a portable device such as a chip card.
Number | Date | Country | Kind |
---|---|---|---|
06301265.2 | Dec 2006 | EP | regional |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/EP07/63148 | 12/3/2007 | WO | 00 | 6/16/2009 |