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 or for the intermediate data. More precisely, the purpose of the method is to produce a version of the algorithm which is not vulnerable to certain types of attack through introduction of one or more errors—known as Differential Fault Analysis or Extended Fault Analysis—which attempt to obtain information about one or more data items or operations involved in the algorithm calculation by studying the calculation procedure of the electronic assembly when one or more errors are introduced.
The algorithms considered in the remainder of the document are given as non-limiting examples of cryptographic algorithms using a secret key to calculate output information according to input information; it may concern an encryption, decryption, signature, signature check, authentication or non-repudiation operation. They are built so that an attacker, knowing the inputs and the outputs, is unable in practice to deduce any information concerning the secret key itself.
However, this invention covers those algorithms where tests must be carried out to ensure that all intermediate steps and data involved in the calculation are free from errors.
The first time attacks using error introduction appeared dates back to 1996:
An example of this type of attack on the cryptographic algorithm with DES secret key —ref (1)— can be found in article —ref (2)— published by Eli Biham and Adi Shamir in 1996.
The invention proposed also concerns extended attacks such as those where the attacker uses the fact that certain functions have an output which is smaller than the input; there are several inputs which give the same output. Consequently, by modifying the input, a correct result can still be obtained at the output, which is sometimes interesting.
The purpose of the method according to this invention is to eliminate the risks of DFA attacks on electronic assemblies or systems by modifying the functions involved in the calculation.
Another purpose of this invention is to modify a cryptographic calculation process implemented by cryptography electronic assemblies protected so that the above-mentioned basic assumption is no longer satisfied, i.e. no intermediate variable or function where an error could be introduced remains undetected by the system.
This invention concerns a method to secure the execution of a program in an electronic assembly comprising information processing means and information storage means, characterised in that it consists in performing an additional calculation by a verification function on at least one intermediate result in order to obtain a calculation signature.
This invention also concerns an electronic assembly and for example a smart card and a program used to implement said method.
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 cryptographic calculation process using a secret key. The electronic assembly includes information processing means such as a processor and information storage means such as a memory. The cryptographic calculation process is installed in the memory, for example ROM type, of said assembly. The processor of said system executes the calculation process by using a secret key, stored in a secret area of a memory, EEPROM type for example.
The method to secure said electronic assembly implementing a traditional calculation process which must be error free, subject of this invention and illustrated on
The principle of super-function f′ according to this invention is described below, referring to
Error detection is carried out by a verification function V. A verification function is one used to check the intermediate results (or those considered to be critical) of an algorithm.
Formally, if we write:
A verification function V is a function which associates a binary word of fixed length N with every element of E: V: E→{0,1}N
In practice, in more concrete terms:
The security principle according to this invention consists in combining the two methods previously described: firstly the principle of super-function is applied, in order to protect the functions individually, then a verification function. This produces a calculation signature. All or part of the calculation can now be repeated one or more times in order to recalculate a new signature, then the signatures are compared in order to detect any errors. The verification function performs a calculation on at least one intermediate result from an operation of the calculation process or of a super-function. An intermediate result is a result obtained during execution of a cryptographic calculation process, as opposed to the final result. As an illustration, according to a special form of realisation, it is recommended to apply one or more verification functions on intermediate results obtained at sensitive points during execution of the algorithm considered.
A first example of applying the security method according to this invention to the DES algorithm is given below.
Concerning the super-functions, only one is used in order to protect the S-boxes. The S-boxes have indeed one 6-bit input and one 4-bit output. Several 6-bit values may therefore give the same result on 4 bits, which an attacker can use. In the present case:
We then introduce
The verification function as such must then be chosen: several examples are given below.
We write in the remainder of the document X={xi}0<i<n+1 the set of values to be checked and V the verification function. The intermediate verification value taking into account the first j values xi is sometimes written Vj. We therefore have V(x)=Vn
A first example of verification function is the concatenation of values: this means that a trace is kept throughout the calculation, which is costly in terms of memory but which is efficient since there is no risk of collision.
Vj+1=Vj∥xj+1
A second example is the exclusive or of the values:
V(x1, . . . , xn)=x1XOR . . . XORxn
A third example is addition modulo 2N (N is the length of the result). This is the same as adding the intermediate results and truncating the result at the required length:
Vj+1=(Vj+xj+1) modulo 2N
A fourth example is the usual CRC of the values:
V(x1, . . . , xn)=CRC(x1, . . . , xn)
A fifth example is the exclusive or of the values where a cyclic shift is carried out on the intermediate result of a random number of bits (e.g. 1):
Vj+1=(Vj<<1)XORxj+1
A sixth example is the exclusive or of the values with multiplication. At each step, an XOR is carried out on the intermediate verification value with the product of the truncated intermediate verification value and the current xi.
Vj+1=VjXOR((Vjxxj+1) modulo 2N)
A seventh example is data hashing by a cryptographic function. For example, all the values can be concatenated, hashed using the SHA-1 function and the required number of bits of the result can be kept.
V=SHA−1(X)
A second example of applying the security method according to this invention to the RSA algorithm is given below, in which the following loop, using variables M,C1,C2,N, and a bit string D, is sometimes executed.
C1=1
For i=0 to N do:
C2=C1×C1
C1=C2×M
If bit i of D=0 then
We can see that if the attacker modifies for example C1 before the “If” and if the If instruction is executed, the result is correct: the attacker can therefore obtain information concerning the value of D.
No super-functions are used in this case; application of a simple exclusive or on the intermediate values C1 and C2 will detect any errors.
Sometimes, the attacker does not control the error introduction fully. By working on a larger space and by checking the consistency of the results, an error introduced can therefore be detected since it generates an impossible result. For example, if two eight-bit numbers are added and the result is stored on 16 bits, an error introduced on the result has a strong chance of affecting the 7 most significant bits (generally 0 using the laws of arithmetic) which means that the error will be detected.
Number | Date | Country | Kind |
---|---|---|---|
02291728 | Jul 2002 | EP | regional |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/IB03/03120 | 7/7/2003 | WO | 00 | 1/10/2005 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2004/006074 | 1/15/2004 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
6539092 | Kocher | Mar 2003 | B1 |
6658569 | Patarin et al. | Dec 2003 | B1 |
6832316 | Sibert | Dec 2004 | B1 |
20020003876 | Lim | Jan 2002 | A1 |
20020101986 | Roelse | Aug 2002 | A1 |
20050021990 | Liardet et al. | Jan 2005 | A1 |
Number | Date | Country |
---|---|---|
02-252027 | Sep 1990 | JP |
Number | Date | Country | |
---|---|---|---|
20080130869 A1 | Jun 2008 | US |