This invention concerns a method to secure an electronic assembly implementing any algorithm where a check must be carried out to ensure that the algorithm was executed correctly, whether for the intermediate steps of the various functions (execution of code, loops, tests, etc.) or for the calls between functions. More precisely, the purpose of the method is to produce a version of the implementation which is not vulnerable to certain types of attack through introduction of one or more errors—known as Fault Analysis or Extended Fault Analysis—which attempt to obtain information about one or more data items or operations involved in the calculation by studying the calculation procedure of the electronic assembly when one or more errors are introduced.
This invention covers all implementations where it is essential to ensure that all steps involved during the calculation were error-free. The first appearance of such attacks dates back to 1996:
Another objective of the method is to propose a defence against attacks by radiation, flash, light, laser, glitch or other and more generally against any attack disturbing the execution of the program instructions known as disturbance attack. These attacks modify the instructions to be executed, resulting in non-execution or incorrect execution of certain parts of the program.
The purpose of the method according to this invention is to eliminate the risks of attacks by disturbance or attacks by fault injection on electronic assemblies or systems by modifying the functions involved in the calculation.
The method to secure an electronic assembly implementing a traditional calculation process which must be error free, subject of this invention, is remarkable in that the functions implemented in the calculation are modified by adding in several positions and automatically:
The method uses the control flow graph of the program to be protected to generate the static information used by the verification functions.
The beacon is information defining the characteristics of the corresponding passage point and/or one or more other passage points.
According to one form of realisation of the invention, the beacon is an integer locating the beacon in the code to be protected.
According to another form of realisation, the beacon is a Boolean variable defining whether it is the first or the last beacon.
According to a special form of the invention, the beacon is a data structure characterising, according to the value of a register or a given variable, all beacons through which passage will be forbidden (using a verification function) in the remaining execution.
According to another special form of realisation of the invention, the beacon is a data structure characterising, according to the value of a register or a given variable, all beacons whose passage will be forced (using a verification function) in the remaining execution.
The forms of realisation mentioned can be combined: the beacon may consist of several of the elements described above.
The beacon and verification functions use a shared area of the system memory.
The shared memory contains a data structure of type stack, of type Boolean array and/or of type number storing a checksum.
A beacon function is one which is called by the program at each passage by a beacon and which consists in storing dynamically in the shared memory various items of information concerning the beacon, and possibly of performing a check on the execution.
According to a special form of realisation of the invention, the beacon function is one which pushes the beacon onto the stack in the shared memory.
According to another form of realisation, the beacon function is one which updates a checksum contained in the shared memory with the beacon data.
Said forms of realisation can be combined.
A history verification function is one called at each check point to check the consistency of the information stored in the shared memory during the successive calls of the beacon functions.
The static memory calculated by the automatic process is a beacon stack list representing a valid beacon passage history and/or a list of checksums obtained from a valid beacon passage history.
With a checksum, the checksum is obtained by using the add function, by using the Exclusive Or (XOR) function, by using an ordinary checksum and/or by using a hashing cryptographic function.
The “Beacon” and “Check point” objects, the “Beacon Function” and “History Verification Functions” as well as the shared memory will be described generically below and examples will also be given.
Other purposes, features and advantages of the invention will appear on reading the description which follows of the implementation of the method according to the invention and of a mode of realisation of an electronic assembly designed for this implementation, given as a non-limiting example, and referring to the attached drawings in which:
The purpose of the method according to the invention is to secure an electronic assembly and for example an onboard system such as a smart card implementing a program. The electronic assembly comprises at least a processor and a memory. The program to be secured is installed in the memory, for example ROM type, of said assembly.
As a non-limiting example, the electronic-assembly described below corresponds to an onboard system comprising an electronic module 1 illustrated on
The microprocessor electronic module 1 comprises a microprocessor CPU 3 with a two-way connection via an internal bus 5 to a non volatile memory 7 of type ROM, EEPROM, Flash, FeRam or other containing the program PROG 9 to be executed, a volatile memory 11 of type RAM, input/output means I/O 13 to communicate with the exterior.
1. Principle
1.1 Beacons and Beacon Function
Definition
A beacon could be, for example:
A beacon function could, for example, perform the following operations:
1.2 Check Points, History Verification
Definition
2. Form of Realisation
We will now describe as an example the operation of a C code preprocessor which implants the error detection semi-automatically.
The C source code is input to the preprocessor which converts this code to include the error detection.
This conversion is guided by the directives included in the code and which specify the beacons which must be introduced. These directives may take the following forms:
An example will now be given in language C including directives intended for the preprocessor. Function int f(int x, int d) performs action1(d) three times, then action2(d) if x is equal to 1. Function action2(int d) performs action21(d) then action22(d).
The directives are placed in the code as #pragma. Their effects are indicated in comments.
The precompiler defines the data structures used for the check. These data structures can be divided into two types: static and dynamic. The dynamic data structures are as follows:
The static data describes the permissible beacon stacks; in our case:
This data is calculated by the preprocessor using the control flow graph of the program, also calculated by the preprocessor (see
The precompiler also defines a set of functions, C macros in fact, used during the beacon passages. These functions are as follows:
The following functions are used to implant the error detection:
In the example proposed, the checks are carried out at the end of function f and in function action2. The arrays _fcPath0 and _fcPath1 define the permissible executions. There are two execution families, the first consists of _fcPath0 and the second of _fcPath1. _fcPath0 corresponds to the execution which does not pass by the call of action2(d); _fcPath1 corresponds to the execution which passes by the call of action2(d).
If a check fails, this means that the stack representing the beacons crossed successively does not agree with the control flow graph of the program. We can deduce that an error has been injected during execution.
The securing method is remarkable in that the functions implemented in the calculation are modified by adding in several positions and automatically:
Number | Date | Country | Kind |
---|---|---|---|
03290688 | Mar 2003 | EP | regional |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/IB2004/000776 | 3/17/2004 | WO | 00 | 9/19/2005 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2004/084073 | 9/30/2004 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
5301325 | Benson | Apr 1994 | A |
5450575 | Sites | Sep 1995 | A |
5961636 | Brooks et al. | Oct 1999 | A |
6571363 | Steiss | May 2003 | B1 |
6622263 | Stiffler et al. | Sep 2003 | B1 |
6766471 | Meth | Jul 2004 | B2 |
6874138 | Ziegler et al. | Mar 2005 | B1 |
7117354 | Browning et al. | Oct 2006 | B1 |
7418630 | Vick et al. | Aug 2008 | B1 |
7516361 | Vick et al. | Apr 2009 | B2 |
20020147891 | Saulsbury et al. | Oct 2002 | A1 |
20040034814 | Thompson | Feb 2004 | A1 |
20040153834 | Oshima et al. | Aug 2004 | A1 |
20050055605 | Blumenthal et al. | Mar 2005 | A1 |
20050114736 | Larsen | May 2005 | A1 |
20050120191 | Akkary et al. | Jun 2005 | A1 |
20050193269 | Haswell et al. | Sep 2005 | A1 |
20060009150 | Leung et al. | Jan 2006 | A1 |
20080276127 | McFarland et al. | Nov 2008 | A1 |
Number | Date | Country | |
---|---|---|---|
20060282741 A1 | Dec 2006 | US |