Method for protecting an electronic system with modular exponentiation-based cryptography against attacks by physical analysis6973190Abstract The invention concerns a method for protecting an electronic system implementing a cryptographic calculation process involving a modular exponentiation of a quantity (x), said modular exponentiation using a secret exponent (d), characterized in that said secret exponent is broken down into a plurality of k unpredictable values (d1, d2, . . . , dk), the sum of which is equal to said secret exponent. Claims 1. A method adapted to protect a smart card implementing a cryptographic process involving calculation of a modular exponentiation of a quantity (x), said modular exponentiation using a secret exponent (d), comprising breaking down said secret exponent (d) into unpredictable values (d1, d2, . . . , dk), wherein k is reater than 2, and at least one of said (k-1) values has a length at least equal to 64 bits, the sum of which is equal to said secret exponent (d) including: Description FIELD OF THE INVENTION
The RSA algorithm uses a whole number n that is the product of two large prime numbers p and q, and a whole number e, prime with ppcm(p-1, q-1), and such that e·±1 mod ppcmp-1, q-1). The whole numbers n and e constitute the public key. The public key calculation uses the function g of Z/nz in Z/nz defined by g(x)=xe mod n. The secret key calculation uses the function g-1(y)=yd mod n, where d is the secret exponent (also called the secret or private key) defined by ed·1 mod ppcm(p-1, q-1). Attacks of the DPA or HO-DPA type can pose a threat to the standard implementations of the RSA algorithm. In essence, the latter very often use the so called square and multiply principle to perform the calculation of xd mod n. This principle consists of writing the breakdown of the secret exponent d in base 2, the performing the calculation in the following way:
In this calculation, it is clear that among the successive values assumed by the variable z, the prime numbers depend on only a few bits of the secret key d. The fundamental hypothesis that makes the DPA attack possible is therefore fulfilled. It is thus possible to guess, for example, the 10 high-order bits of d by concentrating on the consumption measurements in the part of the algorithm that corresponds to i running from m-1 to m-10, which makes it possible to find the next ten bits of d, and so on. Eventually, all the bits of the secret exponent d are found. A First Protection Method, and its Disadvantages A conventional method (proposed by Ronald Rivest in 1995) for protecting the RSA algorithm against DPA type attacks consists of using a "blinding" principle. This uses the fact that: Thus, the calculation of y=xd mod n is broken down into four steps:
The disadvantage of this method is that it makes it necessary, for each calculation, to calculate the modular inverse r-1 of the random value r, this operation generally being time-consuming (the duration of such a calculation is on the same order as that of a modular exponentiation such as ud mod n). Consequently, this new implementation (protected against DPA attacks) of the calculation of xd mod n takes about twice as long as the initial implementation (not protected against DPA attacks). In other words, this protection of RSA against DPA attacks increases the calculation time by approximately 100% (assuming that the public exponent e is very small, for example e=3; if the exponent e is larger, this calculation time is even longer). A Second Method: The Method of the Present Invention According to the invention, a method for protecting an electronic system implementing a cryptographic calculation process involving a modular exponentiation of a quantity (x), said modular exponentiation using a secret exponent (d), is characterized in that said secret exponent is broken down into a plurality of k unpredictable values (d1, d2, . . . , dk), the sum of which is equal to said secret exponent. Advantageously, said values (d1, d2, . . . , dk), are obtained in the following way:
Advantageously, the calculation of the modular exponentiation is performed in the following way:
Advantageously, at least one of said (k-1) values obtained by means of a random generator has a length greater than or equal to 64 bits. Some of the details and advantages of the present invention will emerge from the following description of some preferred but non-limiting embodiments, in reference to the sole attached figure, which represents a smart card. According to the invention, we use the fact that: if d=d1+d2, then xd mod n=xd Thus, the calculation of y=x mod n is broken down into five steps:
The advantage is that, this way, there is no modular inverse to calculate. In general, the calculation time of a modular exponentiation is proportional to the size of the exponent. Thus, if we let · be the ratio between the size of d1 and the size of d2, it is clear that the total calculation time in this new implementation (protected against DPA attacks) is about (1+· ) times the calculation time in the initial implementation (not protected against DPA attacks). Note that, in order to obtain an unpredictable value d1, it necessary for its size to be at least 64 bits. The method thus described renders attacks of the DPA or HO-DPA type described above ineffective. In essence, in deciding whether or not two inputs (respectively two outputs) of the algorithm give the same value for an intermediate variable appearing during the calculation, it is no longer enough to know the key bits involved. It is also necessary to know the breakdown of the secret key d into k values d1, d2, . . . , dk such that d=d1+d2+ . . . +dk. Assuming that this breakdown is secret, and that at least one of the k values has a size of at least 64 bits, the hacker cannot predict the values of d1, . . . , dk, and therefore the fundamental hypothesis that would make it possible to implement a DPA or HO-DPA type attack, is no longer verified. EXAMPLES
2. If n has a length of 1024 bits, by choosing to take a random value d1 of 64 bits, we obtain ·=1/16, which means that this protection of RSA against DPA attacks increases the calculation time by about 6.25%. Second Example: the Rabin Algorithm We will now consider the asymmetrical cryptographic algorithm developed by Rabin in 1979. For a more detailed description of this algorithm, it may be useful to refer to the following document:
The Rabin algorithm uses a whole number n that is the product of two large prime numbers p and q, which also verify the following two conditions:
The public key calculation uses the function g of Z/nZ in Z/nZ defined by g(x)=x2 mod n. The secret key calculation uses the function g-1(y)=yd mod n, where d is the secret exponent (also called the secret or private key) defined by d=((p-1)(q-1)/4+1)/2. The function implemented by the secret key calculation being exactly the same as that used by the RSA algorithm, the same DPA or HO-DPA attacks are applicable and can pose the same threats to the Rabin algorithm. Protecting the Algorithm Since the function is exactly the same as the one in RSA, the protection method described in the RSA context is applied in the same way in the case of the Rabin algorithm. The increase in the calculation time caused by the application of this method is also the same as in the case of the RSA algorithm. BRIEF DESCRIPTION OF THE DRAWING FIG. 1 is a representation of a smart card. The invention can be implemented in any electronic system performing a cryptographic calculation involving a modular exponentiation, including a smart card 8 as shown in FIG. 1. The chip includes information processing means 9, connected on one end to a nonvolatile memory 10 and a volatile working memory RAM 11, and connected on another end to means 12 for cooperating with an information processing device. The nonvolatile memory 10 can comprise a non-modifiable ROM part and a modifiable part constituted by an EPROM, an EEPROM or a RAM of the "flash" type, or FRAM, (the latter being a ferromagnetic RAM)), i.e., having the characteristics of an EEPROM but with access times identical to those of a standard RAM. For the chip, it is possible to use, in particular, a self-programmable microprocessor with a nonvolatile memory, as described in U.S. Pat. No. 4,382,279 assigned to the assignee of the present invention. In a variant, the microprocessor of the chip is replaced, or at least supplemented, by logical circuits installed in a semiconductor chip. In essence, such circuits are capable of performing calculations, including authentication and signature calculations, as a result of hard-wired, rather than microprogrammed, electronics. In particular, they can be of the ASIC ("Application Specific Integrated Circuit") type. Advantageously, the chip is designed in monolithic form. In the case of the utilization of such an electronic system, the invention consists in a method for protecting an electronic system comprising information processing means and information storage means, the method implementing a cryptographic calculation process involving a modular exponentiation of a quantity (x) stored in the information storage means, said modular exponentiation using a secret exponent (d) stored in the storage means, characterized in that, by means of said information processing means, said secret exponent read in said information storage means is broken down into a plurality of k unpredictable values (d1, d2, . . . , dk), the sum of which is equal to said secret exponent, said k unpredictable values being stored in the information storage means. Advantageously, said values (d1, d2, . . . , dk) are obtained in the following way:
Advantageously, the calculation of the modular exponentiation is performed in the following way:
Advantageously, at least one of said (k-1) values obtained by means of a random generator has a length greater than or equal to 64 bits. While this invention has been described in conjunction with specific embodiments thereof, it is evident that many alternatives, modifications and variations will be apparent to those skilled in the art. Accordingly, the preferred embodiments of the invention as set forth herein, are intended to be illustrative, not limiting. Various changes may be made without departing from the true spirit and full scope of the invention as set forth herein and defined in the claims.
|
Same subclass Same class Consider this |
||||||||||
