Method for securing a cryptographic process with SBOX against high-order side-channel attacks

11256478 · 2022-02-22

Assignee

Inventors

Cpc classification

International classification

Abstract

The present invention relates to a method for securing against N-order side-channel attacks a cryptographic process using in a plurality of encryption rounds an initial Substitution box S.sub.0 comprising the steps of: —generating (E12) a first randomized substitution box S.sub.1 by masking said initial substitution box S.sub.0 such that S.sub.1(x XOR m.sub.1)=S.sub.0(x) XOR m.sub.2, with m.sub.1, m.sub.2 uniformly-distributed random values, for any input value x of the initial substitution box S.sub.0, —generating (E13) a first transrandomized Substitution box S(1,1) from the first randomized substitution box S.sub.1 and from masks m.sub.1,1, m′.sub.1,1 such that S(1, 1)[x]=S.sub.1[x xor (m.sub.1 xor m.sub.1,1)] xor (m.sub.2 xor m′.sub.1,1) for any input value x of the first transrandomized Substitution box S(1,1), —generating (E14) from the first transrandomized Substitution box S(1,1) a N−1th transrandomized Substitution box S(1, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box S(1, i) from a i−1th transrandomized substitution box S(1, i−1) and from a plurality of masks m 1,i, m′.sub.1,i, m.sub.1,i−1, m′.sub.1,i−1 such that S(1, i)[x]=S(1, i−1)[x xor (m.sub.1,i-1 xor m.sub.1,i)] xor (m′.sub.1,i−1 xor m′.sub.1,i) for any input value x of the ith transrandomized substitution box S(1, i), with i an integer comprised in {2, . . . N−1}, —performing the cryptographic process using (E15) the N−1th transrandomized Substitution box S(1, N−1) instead of the initial Substitution box S.sub.0 in at least said first round of the cryptographic process.

Claims

1. A method for securing a cryptographic device against N-order side-channel attacks, wherein N is a predetermined integer, wherein the method comprises: performing the following steps by a processing system of the cryptographic device using a cryptographic process, comprising a plurality of encryption rounds including an initial Substitution box S.sub.0, stored in a computer readable memory circuit of the cryptographic device that includes the processing system having at least one hardware processor: accessing in the computer readable memory circuit said initial Substitution box S0, generating a first randomized substitution box S.sub.1 by masking said initial substitution box S0 such that S.sub.1(x XOR m.sub.1)=S.sub.0(x) XOR m.sub.2, with m.sub.1, m.sub.2 uniformly-distributed random values, for any input value x of the initial substitution box S.sub.0, generating a first transrandomized Substitution box S(1,1) from the first randomized substitution box S.sub.1 and from masks m.sub.1,1, m′.sub.1,1 such that S(1, 1) [x]=S.sub.1[x xor (m.sub.1 xor m.sub.1,1)] xor (m.sub.2 xor m′.sub.1,1) for any input value x of the first transrandomized Substitution box S(1,1), generating from the first transrandomized Substitution box S(1,1) a N−1th transrandomized Substitution box S(1, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box S(1, i) from a i−1th transrandomized substitution box S(1, i−1) and from a plurality of masks m.sub.1,i, m′.sub.1,i, m.sub.1,i−1, m′.sub.1,i−1 such that S(1, i)[x]=S(1, i−1)[x xor (m.sub.1,i−1 xor m.sub.1,i)] xor (m′.sub.1,i−1 xor m′.sub.1,i) for any input value x of the ith transrandomized substitution box S(1, i), with i an integer comprised in {2, . . . N−1}, performing the cryptographic process using the N−1th transrandomized Substitution box S(1, N−1) instead of the initial Substitution box S0 in at least said first round of the cryptographic process, where said masks are uniformly-distributed random values, XOR is the Boolean exclusive OR operation, and performing said transrandomization of a Substitution box S from (m.sub.i, m.sub.j) to (m.sub.k, m.sub.l) consists in computing said Substitution box S masked with said masks m.sub.k and m.sub.l, called transrandomized Substitution box, from said Substitution box S masked with said masks m.sub.i and m.sub.j with i, j, k and l comprising integers in {2, . . . N−1}.

2. The method of claim 1, wherein the N−1th transrandomized Substitution box S(1, N−1) is used instead of the initial Substitution box S.sub.0 in all rounds of the cryptographic process.

3. The method of claim 1, further comprising when performing each round r, r>1, among said plurality of encryption rounds, called a current round: generating a first transrandomized Substitution box for the current round r S(r, 1) from a N−1th transrandomized substitution box S(r−1, N−1) used instead of the initial Substitution box S0 in the last round (r−1) performed before the current round r and from masks m.sub.r,1, m′.sub.r,1 such that S(r, 1)[x]=S(r−1, N−1)[x xor (m.sub.r−1, N−1 xor m.sub.r,1)] xor (m′.sub.r−1,N−1 xor m′.sub.r,1) for any input value x of the first transrandomized substitution box for the current round S(r, 1), generating from the first transrandomized Substitution box for the current round r S(r, 1) a N−1th transrandomized Substitution box for the current round r S(r, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box for the current round r S(r, i) from a i−1th transrandomized substitution box for the current round r S(r, i−1) and from a plurality of masks m.sub.r,i, m′.sub.r,i, m.sub.r,i−1, m′.sub.r,i−1 such that S(r, i)[x]=S(r,i−1)[x xor (m.sub.r,i−1 xor m.sub.r,i)] xor (m′.sub.r,i−1 xor m′r,i) for any input value x of the ith transrandomized substitution box for the current round S(r, 1), with i an integer comprised in {2, . . . N−1}, and using the N−1th transrandomized Substitution box for the current round r S(r, N−1) instead of the initial Substitution box S.sub.0 in said current round r of the cryptographic process.

4. The method of claim 1, wherein the cryptographic process is a block cipher algorithm.

5. The method of claim 4, wherein the block cipher algorithm is selected among the set including Advanced Encryption Standard (AES) algorithm, Data Encryption Standard (DES) algorithm, Blowfish algorithm, Serpent algorithm, and Gost algorithm.

6. The method of claim 3, wherein a memory scrambling is performed to generate the transrandomized Substitution box S(r,i) at round r with i an integer comprised in (1, . . . N−1).

7. A computer program product stored in the memory of at least one cryptographic device, having at least one hardware processor, comprising software code instructions, when executed by the at least one processor, secures the at least one cryptographic device against N-order side-channel attacks, wherein N is a predetermined integer, the software instructions comprising instructions causing the at least one hardware processor to: perform the following steps using a cryptographic process, comprising a plurality of encryption rounds including an initial Substitution box S.sub.0, stored in a computer readable memory circuit of the cryptographic device: accessing in the computer readable memory circuit said initial Substitution box S0, generating a first randomized substitution box S.sub.1 by masking said initial substitution box S0 such that S.sub.1 (x XOR m.sub.1)=S.sub.0(x) XOR m.sub.2, with m1, m2 uniformly-distributed random values, for any input value x of the initial substitution box S.sub.0, generating a first transrandomized Substitution box S(1,1) from the first randomized substitution box S.sub.1 and from masks m.sub.1, 1, m′.sub.1,1 such that S(1, 1) [x]=S.sub.1[x xor (m.sub.1 xor m.sub.1,1)] xor (m.sub.2 xor m′.sub.1,1) for any input value x of the first transrandomized Substitution box S(1,1), generating from the first transrandomized Substitution box S(1,1) a N−1th transrandomized Substitution box S(1, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box S(1, i) from a i−1th transrandomized substitution box S(1, i−1) and from a plurality of masks m.sub.1,i, m′.sub.1,i, m.sub.1,i−1, m′.sub.1,i−1 such that S(1, i)[x]=S(1, i−1)[x xor (m.sub.1,i−1 xor m.sub.1,i)] xor (m′.sub.1,i−1 xor m′.sub.1,i) for any input value x of the ith transrandomized substitution box S(1, i), with i an integer comprised in {2, . . . N−1}, performing the cryptographic process using (E15) the N−1th transrandomized Substitution box S(1, N−1) instead of the initial Substitution box S0 in at least said first round of the cryptographic process, where said masks are uniformly-distributed random values, XOR is the Boolean exclusive OR operation, and performing said transrandomization of a Substitution box S from (m.sub.i, m.sub.j) to (m.sub.k, m.sub.l) consists in computing said Substitution box S masked with said masks m.sub.k and m.sub.l called transrandomized Substitution box, from said Substitution box S masked with said masks m.sub.i and m.sub.j, with i, j, k and l comprising integers in {2, . . . N−1}.

8. A non-transitory computer readable medium storing executable computer code that when executed by a cryptographic device, having a processing system including at least one hardware processor, secures the at least one cryptographic device against N-order side-channel attacks, wherein N is a predetermined integer, the computer code comprising computer code for causing the at least one hardware processor to: perform the following steps using a cryptographic process, including a plurality of encryption rounds including an initial Substitution box S.sub.0, stored in a computer readable memory circuit of the cryptographic device: accessing in the computer readable memory circuit said initial Substitution box S0, generating a first randomized substitution box S.sub.1 by masking said initial substitution box S0 such that S.sub.1 (x XOR m.sub.1)=S.sub.0(x) XOR m.sub.2, with m1, m2 uniformly-distributed random values, for any input value x of the initial substitution box S.sub.0, generating a first transrandomized Substitution box S(1,1) from the first randomized substitution box S.sub.1 and from masks m.sub.1,1, m′.sub.1,1 such that S(1, 1)[x]=S.sub.1[x xor (m.sub.1 xor m.sub.1,1)] xor (m.sub.2 xor m′.sub.1,i) for any input value x of the first transrandomized Substitution box S(1,1), generating from the first transrandomized Substitution box S(1,1) a N−1th transrandomized Substitution box S(1, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box S(1, i) from a i−1th transrandomized substitution box S(1, i−1) and from a plurality of masks m.sub.1,i, m′.sub.1,i, m.sub.1,i−1, m′.sub.1,i−1 such that S(1, i)[x]=S(1, i−1)[x xor (m.sub.1,i−1 xor m.sub.1,i)] xor (m′.sub.1,i−1 xor m′.sub.1,i) for any input value x of the ith transrandomized substitution box S(1, i), with i an integer comprised in {2, . . . N−1}, performing the cryptographic process using (E15) the N−1th transrandomized Substitution box S(1, N−1) instead of the initial Substitution box S0 in at least said first round of the cryptographic process, where said masks are uniformly-distributed random values, XOR is the Boolean exclusive OR operation, and performing said transrandomization of a Substitution box S from (m.sub.i, m.sub.j) to (m.sub.k, m.sub.l) consists in computing said Substitution box S masked with said masks m.sub.k and m.sub.l called transrandomized Substitution box, from said Substitution box S masked with said masks m.sub.i and m.sub.j, with i, j, k and l comprising integers in {2, . . . N−1}.

9. A cryptographic device comprising: a processing system having at least one hardware processor, a computer readable memory circuit configured for storing substitution boxes, wherein the processing system performs the following steps to secure against N-order side-channel attacks, wherein N comprises a predetermined integer, using a cryptographic process in a plurality of encryption rounds: accessing in the computer readable memory circuit of the cryptographic device an initial Substitution box S.sub.0, generating a first randomized substitution box S.sub.1 by masking said initial substitution box S.sub.0 such that S.sub.1 (x XOR m.sub.1)=S.sub.0 (x) XOR m.sub.2, with m.sub.1, m.sub.2 uniformly-distributed random values, for any input value x of the initial substitution box S.sub.0, generating a first transrandomized Substitution box S(1,1) from the first randomized substitution box S.sub.1 and from masks m.sub.1,1, m′.sub.1,1 such that S(1, 1) [x]=S.sub.1 [x xor (m.sub.1 xor m.sub.1,1)] xor (m.sub.2 xor m′.sub.1,1) for any input value x of the first transrandomized Substitution box S(1,1), generating from the first transrandomized Substitution box S(1,1) a N−1th transrandomized Substitution box S(1, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box S(1, i) from a i−1th transrandomized substitution box S(1, i−1) and from a plurality of masks m.sub.1,i, m′.sub.1,i, m.sub.1,i−1, m′.sub.1,i−1 such that S(1, i)[x]=S(1, i−1)[x xor (m.sub.1,i−1 xor m.sub.1,i)] xor (m′.sub.1,i−1 xor m′.sub.1,i) for any input value x of the ith transrandomized substitution box S(1, i), with i an integer comprised in {2, . . . N−1}, performing the cryptographic process using the N−1th transrandomized Substitution box S(1, N−1) instead of the initial Substitution box S.sub.0 in at least said first round of the cryptographic process, where said masks are uniformly-distributed random values, XOR is the Boolean exclusive OR operation, and said transrandomization operation of a Substitution box S from (m.sub.i, m.sub.j) to (m.sub.k, m.sub.l) consists in computing said Substitution box S masked with said masks m.sub.k and m.sub.l called a transrandomized Substitution box, from said Substitution box S masked with said masks m.sub.i and m.sub.j, with i, j, k and l comprising integers in {2, . . . N−1}.

10. The computer program of claim 7, wherein the N−1th transrandomized Substitution box S(1, N−1) is used instead of the initial Substitution box S.sub.0 in all rounds of the cryptographic process.

11. The computer program of claim 7, wherein the method further includes, when performing each round r, r>1, among said plurality of encryption rounds, called current round: generating a first transrandomized Substitution box for the current round r S(r, 1) from a N−1th transrandomized substitution box S(r−1, N−1) used instead of the initial Substitution box S0 in the last round (r−1) performed before the current round r and from masks m.sub.r,1, M′.sub.r,1 such that S(r, 1)[x]=S(r−1, N−1)[x xor (m.sub.r−1,N−1 xor m.sub.r,1)] xor (m′.sub.r−1,N−1 xor m′.sub.r,1) for any input value x of the first transrandomized substitution box for the current round S(r, 1), generating from the first transrandomized Substitution box for the current round r S(r, 1) a N−1th transrandomized Substitution box for the current round r S(r, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box for the current round r S(r, i) from a i−1th transrandomized substitution box for the current round r S(r,i−1) and from a plurality of masks m.sub.r,i, m′.sub.r,i, m.sub.r,i−1, m′.sub.r,i−1 such that S(r, i)[x]=S(r, i−1)[x xor (m.sub.r,i−1 xor m.sub.r,i)] xor (m′.sub.r,i−1 xor m′.sub.r,i) for any input value x of the ith transrandomized substitution box for the current round S(r, 1), with i an integer comprised in {2, . . . N−1}, and using the N−1th transrandomized Substitution box for the current round r S(r, N−1) instead of the initial Substitution box S.sub.0 in said current round r of the cryptographic process.

12. The computer program of claim 7, wherein a memory scrambling is performed to generate the transrandomized Substitution box S(r,i) at round r with i an integer comprised in {1, . . . N−1}.

13. The non-transitory memory of claim 8 wherein the N−1th transrandomized Substitution box S(1, N−1) is used instead of the initial Substitution box S0 in all rounds of the cryptographic process.

14. The non-transitory memory of claim 8, wherein the method further includes, when performing each round r, r>1, among said plurality of encryption rounds, called current round: generating a first transrandomized Substitution box for the current round r S(r, 1) from a N−1th transrandomized substitution box S(r−1, N−1) used instead of the initial Substitution box S0 in the last round (r−1) performed before the current round r and from masks m.sub.r,1, m′.sub.r,1 such that S(r, 1)[x]=S(r−1, N−1)[x xor (m.sub.r−1,N−1 xor m.sub.r,1)] xor (m′.sub.r−1,N−1 xor m′.sub.r,1) for any input value x of the first transrandomized substitution box for the current round S(r, 1), generating from the first transrandomized Substitution box for the current round r S(r, 1) a N−1th transrandomized Substitution box for the current round r S(r, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box for the current round r S(r, i) from a i−1th transrandomized substitution box for the current round r S(r,i−1) and from a plurality of masks m.sub.r,i, m′.sub.r,i, m.sub.r,i−1, m′.sub.r,i−1 such that S(r, i)[x]=S(r,i−1)[x xor (m.sub.r,i−1 xor m.sub.r,i)] xor (m′.sub.r,i−1 xor m′r,i) for any input value x of the ith transrandomized substitution box for the current round S(r, 1), with i an integer comprised in {2, . . . N−1}, and using the N−1th transrandomized Substitution box for the current round r S(r, N−1) instead of the initial Substitution box S.sub.0 in said current round r of the cryptographic process.

15. The non-transitory memory of claim 8, wherein a memory scrambling is performed to generate the transrandomized Substitution box S(r,i) at round r with i an integer comprised in {1, . . . N−1}.

16. The cryptographic device of claim 9, wherein the N−1th transrandomized Substitution box S(1, N−1) is used instead of the initial Substitution box S0 in all rounds of the cryptographic process.

17. The cryptographic device of claim 9, wherein the method further includes, when performing each round r, r>1, among said plurality of encryption rounds, called current round: generating a first transrandomized Substitution box for the current round r S(r, 1) from a N−1th transrandomized substitution box S(r−1, N−1) used instead of the initial Substitution box S0 in the last round (r−1) performed before the current round r and from masks m.sub.r,1, m′.sub.r,1 such that S(r, 1)[x]=S(r−1, N−1)[x xor (m.sub.r−1,N−1 xor m.sub.r,1)] xor (m′.sub.r−1,N−1 xor m′.sub.r,1) for any input value x of the first transrandomized substitution box for the current round S(r, 1), generating from the first transrandomized Substitution box for the current round r S(r, 1) a N−1th transrandomized Substitution box for the current round r S(r, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box for the current round r S(r, i) from a i−1th transrandomized substitution box for the current round r S(r,i−1) and from a plurality of masks m.sub.r,i, m′.sub.r,i, m.sub.r,i−1, m′.sub.r,i−1 such that S(r, i)[x]=S(r,i−1)[x xor (m.sub.r,i−1 xor m.sub.r,i)] xor (m′.sub.r,i−1 xor m′.sub.r,i) for any input value x of the ith transrandomized substitution box for the current round S(r, 1), with i an integer comprised in {2, . . . N−1}, and using the N−1th transrandomized Substitution box for the current round r S(r, N−1) instead of the initial Substitution box S.sub.0 in said current round r of the cryptographic process.

18. The cryptographic device of claim 9, wherein a memory scrambling is performed to generate the transrandomized Substitution box S(r,i) at round r with i an integer comprised in {1, . . . N−1}.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) The following description and the annexed drawings set forth in detail certain illustrative aspects and are indicative of but a few of the various ways in which the principles of the embodiments may be employed. Other advantages and novel features will become apparent from the following detailed description when considered in conjunction with the drawings and the disclosed embodiments are intended to include all such aspects and their equivalents.

(2) FIG. 1 is a schematic illustration of a system according to an embodiment of the present invention;

(3) FIG. 2 is a schematic illustration of a cryptographic device according to an embodiment of the present invention;

(4) FIG. 3 is a schematic illustration of a high-order side-channel attack;

(5) FIG. 4 is a schematic illustration of a transrandomization mechanism iteratively repeated according to an embodiment of the present invention;

(6) FIG. 5 illustrates schematically a method of securing against N-order side-channel attacks according to an embodiment of the present invention.

DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION

(7) In the description detailed below, reference is made to the accompanying drawings that show, by way of illustration, specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention. It is to be understood that the various embodiments of the invention, although different, are not necessarily mutually exclusive. For example, a particular feature, structure, or characteristic described herein in connection with one embodiment may be implemented within other embodiments without departing from the spirit and scope of the invention. In addition, it is to be understood that the location or arrangement of individual elements within each disclosed embodiment may be modified without departing from the spirit and scope of the invention. The description detailed below is, therefore, not to be taken in a limiting sense, and the scope of the present invention is defined only by the appended claims, appropriately interpreted, along with the full range of equivalents to which the claims are entitled.

(8) The invention aims at providing a system, and an associated encryption method, solving the issue of protecting against high-order side-channel attacks block cypher encryption operations performed by a cryptographic device 101.

(9) As depicted on FIG. 1, such a cryptographic device 101 may be connected to a personal computer or server 102 operated by a user and sending commands to the cryptographic device for cryptographic operations such as data encryption or decryption using a block cipher algorithm such as the Advanced Encryption Standard (AES) algorithm, the Data Encryption Standard (DES), Blowfish, Serpent or Gost algorithms. Alternatively, the cryptographic device 101 may be embedded in the computer 102.

(10) The cryptographic device 101 may include a tamper resistant device 103 secured against any unauthorized access including a processing system having at least one hardware processor for performing cryptographic operations, and a computer readable memory circuit configured for storing the data needed for such operations. Such a cryptographic device may for example be a smartcard reader housing a smartcard device, or an electronic device, such as a smartphone, including a smartchip.

(11) FIG. 2 is a schematic illustration of the cryptographic device 101. The cryptographic device 101 may include a processing system 201 having at least one hardware processor, connected via a bus 202 to a computer readable memory circuit including a random access memory (RAM) 203, a read-only memory (ROM) 204, and/or a non-volatile memory (NVM) 205. The cryptographic device 101 may also include a random number generator (RNG) 206, included in the hardware processor or connected to it via the bus. The cryptographic device 101 may further include an interface 207 used to connect the cryptographic device 101 to the computer 102. Such an interface may be either a wired interface such as a USB, Ethernet or Thunderbolt interface, or a wireless interface, such as a Bluetooth interface. The interface 207 may also be used to connect the cryptographic device 101 to a wireless network, e.g., wide-area networks, WiFi networks, or mobile telephony networks through which communication may be performed with the computer 102.

(12) The following paragraphs describe the steps of a method for securing against N-order side-channel attacks, with N a predetermined integer, a cryptographic process performed by the cryptographic device 101 according to a first aspect of the invention.

(13) As described above, a commonly used countermeasure against side-channel attacks such as DPA is masking. More particularly in order to protect a block cipher encryption calculation, SBOX calculations can be masked in order to protect the secret data provided as input to the SBOX calculation.

(14) In the rest of this document it is assumed that all masks used in the cryptographic processes are uniformly-distributed random numbers generated by the random number generator 206 of the cryptographic device. In an exemplary embodiment masking any data is done by applying a XOR operation, the Boolean exclusive OR operation, between such data and a mask, but any other arithmetic operation combining the data and the mask, such as an addition, a subtraction, a multiplication . . . may be used instead.

(15) SBOX calculations may be masked on the input side. A data x to be used as input to the SBOX calculation is then masked by an input mask m.sub.1 before being provided to the SBOX S for performing the SBOX calculation S(x xor m.sub.1).

(16) SBOX calculations may also be masked on the output side. Any output data of the SBOX S(x) is then masked by an output mask m.sub.2, producing from an input data x the value S(x) xor m.sub.2.

(17) Both input masking and output masking may be combined. In the following paragraphs, masking a SBOX calculation using a SBOX S with both an input mask m.sub.1 and an output mask m.sub.2 will be called “masking the SBOX S with masks (m.sub.1, m.sub.2)”.

(18) In order to get the value S(x) masked with an output mask m.sub.2 from a SBOX calculation using as input masked inputs, despite the non-linearity of the SBOX calculation, a masked SBOX S′ masked with (m.sub.1,m.sub.2) may be computed from an original unmasked SBOX S such that S'(x XOR m.sub.1)=S(x) XOR m.sub.2.

(19) Masking inputs with m.sub.1 in S′ is then equivalent to a permutation of the values in S: a value S(x) located in the original SBOX S at the location corresponding to the input data shall be located in the masked SBOX S′ at the location corresponding to the input data x XOR m.sub.1 in order to get S(x) from the evaluation S′(x XOR m.sub.1).

(20) Instead of actually generating a masked SBOX by permuting all the elements of the original SBOX, input masking may be performed by memory scrambling. Matching between a value of the masked SBOX S′(x xor m.sub.1) and the input x xor m.sub.1 is then memorized using virtual memory addressing and input masking is performed by updating memory pointers in order to point towards a masked input x xor m.sub.1 instead of the original input x. Such a memory scrambling may be performed by software operations handheld by the processing system 201 of the cryptographic device 101 or by a dedicated hardware circuit included in the cryptographic device.

(21) In addition to such an input masking, in order to have S′(x XOR m.sub.1)=S(x) XOR m.sub.2, values in the masked SBOX S′ are obtained by masking all the values in the original SBOX S with the output mask m.sub.2. Such an output masking may also be performed by software operations handheld by the processing system 201 of the cryptographic device 101 or by a dedicated hardware circuit included in the cryptographic device.

(22) Performing the SBOX calculation using the masked SBOX S′ then enables to perform such calculation using a masked value as input (x xor m.sub.1) and still to get in output the value of interest S(x), protected with the output mask m.sub.2, despite the non-linearity of the SOX operation.

(23) Unfortunately, such a (m.sub.1, m.sub.2) masking only protects against a first-order attack. An attacker would still be able to recover the input data x of such a SBOX calculation by combining two leakages obtained by side channel analysis attacks, as depicted on FIG. 3, for example using an oscilloscope 104 as depicted on FIG. 1. For example an attacker might get a leakage on (m.sub.1,m.sub.2) from an analysis of the masked SBOX computation, and another leakage on x or S(x) masked with (m.sub.1,m.sub.2) from the block cipher encryption itself, and combine both leakages in order to get information on x or S(x).

(24) In order to defeat such an attack, a first goal of the invention is to prevent such a successful combination of only two leakages by performing the block cipher encryption using a masked SBOX that would not be computed in one step from the original unmasked SBOX. In other words, no masked SBOX computation from the original unmasked SBOX shall be performed using the same masks as the ones masking the masked SBOX used for the block cipher encryption.

(25) In order to do so, the masked SBOX used for the block cipher encryption, for example S.sub.2 masked with (m.sub.3, m.sub.4) shall be computed from an already masked SBOX table using different masks, for example S.sub.1 masked with (m.sub.1, m.sub.2), itself obtained from the original table. Such an operation is called “transrandomization” from (m.sub.1, m.sub.2) to (m.sub.3, m.sub.4). The transrandomized table S.sub.2 is then such that S.sub.2[x]=S.sub.1[x xor (m.sub.1 xor m.sub.3)] xor (m.sub.2 xor m.sub.4) for any input value x of the other masked table S.sub.1. It can be obtained from S.sub.1 by: masking the input of S.sub.1 with (m.sub.1 xor m.sub.3) which replaces the input masking of S.sub.1 using m.sub.1 by an input masking of S.sub.2 using m.sub.3, and masking the output of S.sub.2 with (m.sub.2 xor m.sub.4), which replaces the output masking of S.sub.1 using m.sub.2 by an output masking of S.sub.2 using m.sub.4.

(26) When the block cipher encryption is performed using such a masked SBOX obtained by transrandomization, assuming that an attacker is able to perform side-channel analysis attacks when the block cipher encryption is performed and when a masked SBOX computation is performed, such an attacker would get: from an analysis of the block cipher encryption a leakage on x or S(x) masked with (m.sub.3, m.sub.4), and from an analysis of the masking of the original SBOX, ie of the computation of S.sub.1, a leakage on (m.sub.1,m.sub.2).

(27) Therefore the attacker cannot get information on the secret input data x or S(x) from the combination of only these two leakages. He must in addition combine these leakages with a third one from the analysis of the transrandomization operation, ie the computation of S.sub.2 from S.sub.1, giving information on the link between (m.sub.1, m.sub.2) and (m.sub.3, m.sub.4).

(28) As a result such a single transrandomization enables to protect the block cipher encryption against a second order attack and requires the attacker to perform a third order attack in order to be successful.

(29) In order to protect the block cipher encryption against higher-order attacks, such a transrandomization may be iteratively repeated, as depicted on FIG. 4. In this example, in order to secure against N-order side-channel attacks a block cipher encryption initially designed to be performed with an unmasked initial Substitution box S.sub.0, the processing system of the cryptographic device may first generate a first randomized substitution box S.sub.1 by masking said initial substitution box S.sub.0 such that S.sub.1(x XOR m.sub.1)=S.sub.0(x) XOR m.sub.2, with m.sub.1, m.sub.2 uniformly-distributed random values, for any input value x of the initial substitution box S.sub.0.

(30) Then, the processing system of the cryptographic device may generate from the first randomized substitution box S.sub.1 a Nth Substitution box S.sub.N by performing iteratively N−1 times a step of generation of a (i+1)th transrandomized Substitution box S.sub.i+1 from a ith randomized, when i=1, or transrandomized, when i>1, substitution box S.sub.1 and from a plurality of masks m.sub.2i−1, m.sub.2(i+1)−1, m.sub.2i, and m.sub.2i+2, such that S.sub.i+1[x]=S.sub.i[x xor (m.sub.2i−1 xor m.sub.2(i+1)−1)] xor (m.sub.2i xor m.sub.2i+2) for any input value x of the ith randomized or transrandomized substitution box Si, with i an integer comprised in {1, . . . N−1}.

(31) Finally, the processing system of the cryptographic device may perform the block cipher encryption using the Nth transrandomized Substitution box S.sub.N instead of the initial Substitution box S.sub.0.

(32) Let us note R.sub.i the set (m.sub.2i−1, m.sub.2i) of the input mask m.sub.2i−1 and the output mask m.sub.2i used as masks for the masked SBOX S.sub.1. Assuming that an attacker is able to perform side-channel analysis attacks when the block cipher encryption is performed and when a masked SBOX computation is performed, either from the initial unmasked SBOX S.sub.0 or by transrandomization, such an attacker would get: from an analysis of the block cipher encryption a leakage on x or S(x) masked with R.sub.N, from any transrandomization computing a masked SBOX S.sub.i, a leakage on R.sub.i−1 xor R.sub.i, and from an analysis of the masking of the initial SBOX, ie of the computation of S.sub.1, a leakage on R.sub.1.

(33) Such transrandomization computations of masked SBOXs S.sub.i shall be performed in a way leaking only information on R.sub.i−1 xor R.sub.i. It shall not leak information on R.sub.i−1 only or R.sub.i only for example by performing an intermediate calculation using only the masks of R.sub.i−1 or R.sub.i. For example the processing system of the cryptographic device in order to perform the “xor (m.sub.2i xor m.sub.2i+2)” operation on the values of the transrandomized SBOX shall not perform first a “xor m.sub.2i” in order to prevent a leakage on m.sub.2i.

(34) Therefore in order to get information on x or S(x), the attacker must combine the N+1 leakages from: the block cipher encryption, all (N−1) transrandomization operations, and the masking of the initial SBOX.

(35) In an embodiment, the level of protection may be adapted to a particular context of operation by selecting on-the-fly the number of transrandomization operations to be performed, ie the value of N, before performing the block cipher encryption operation.

(36) In an alternative embodiment, all needed m.sub.j xor m.sub.j+2 values (j being an integer) may be precomputed, stored in the computer readable memory circuit of the cryptographic device 101, and used later by the processing system of the cryptographic device when performing a transrandomization operation.

(37) Cryptographic processes such as AES or DES block cipher perform several encryption rounds. In order to secure such processes, transrandomizations may be performed before performing the first encryption round of the process.

(38) Let us note S(1, i) the ith transrandomized substitution box SBOX for the first round, with i an integer comprised in {1, . . . N−1}, and, R.sub.1,0 the set of input/output masks (m.sub.1, m.sub.2) used as masks for the first randomized SBOX of the first round S.sub.1, and R.sub.1,i the set (m.sub.1,i, m′.sub.1,i) of the input mask m.sub.1,i and the output mask m′.sub.1,i used as masks for the ith transrandomized substitution box SBOX for the first round S(1, i).

(39) According to a first aspect, the invention relates to a method for securing against N-order side-channel attacks, with N a predetermined integer, a cryptographic process using in a plurality of encryption rounds an initial Substitution box S.sub.0 stored in the computer readable memory circuit of the cryptographic device, comprising the following steps described on FIG. 5 and performed by the processing system: during a first initialization step E11, accessing in the computer readable memory circuit said initial Substitution box S.sub.0, during a second initialization step E12 generating a first randomized substitution box S.sub.1 by masking said initial substitution box S.sub.0 such that S.sub.1(x XOR m.sub.1)=S.sub.0(x) XOR m.sub.2, with m.sub.1, m.sub.2 uniformly-distributed random values, for any input value x of the initial substitution box S.sub.0, during a third initialization step E13 generating a first transrandomized Substitution box S(1,1) from the first randomized substitution box S.sub.1 and from masks m.sub.1,i, m′.sub.1,1 such that S(1, 1)[x]=S.sub.1[x xor (m.sub.1 xor m.sub.1,1)] xor (m.sub.2 xor m′.sub.1,1) for any input value x of the first transrandomized Substitution box S(1,1) during a fourth initialization step E14 generating from the first transrandomized Substitution box S(1,1) a N−1th transrandomized Substitution box S(1, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box S(1, i) from a i−1th transrandomized substitution box S(1, i−1) and from a plurality of masks m.sub.1,i, m′.sub.1,i, m.sub.1,i−1, m′.sub.1,i−1 such that S(1, i)[x]=S(1, i−1)[x xor (m.sub.1,i−1 xor m.sub.1,i)] xor (m′.sub.1,i−1 xor m′.sub.1,i) for any input value x of the ith transrandomized substitution box S(1, i), with i an integer comprised in {2, . . . N−1}, performing the cryptographic process using the N−1th transrandomized Substitution box S(1, N−1) instead of the initial Substitution box S.sub.0 in at least said first round of the cryptographic process during a fifth initialization step E15.

(40) The N−1th transrandomized Substitution box S(1, N−1) may be used instead of the initial Substitution box S.sub.0 in all rounds of the cryptographic process.

(41) Unfortunately, an attacker may combine leakages from block cipher encryptions of several rounds. If two block cipher encryption rounds were computed with the same masked SBOX, an attacker combining leakages from these two rounds may retrieve information on the secret value used as input to the whole encryption process.

(42) Therefore, in order to keep this cryptographic process protected against N-order attacks even when an attacker combines leakages from several rounds, SBOX masking may be modified before each new round of the process. In order to do so, as depicted on FIG. 5, transrandomizations according to the invention may be performed before each new round of the process.

(43) Let us note S(r, i) the ith transrandomized substitution box SBOX for the r.sub.th round, with i an integer comprised in {1, . . . N−1}, and, R.sub.1,0 the set of input/output masks (m.sub.1, m.sub.2) used as masks for the first randomized SBOX of the first round S.sub.1, and R.sub.r,i the set (m.sub.r,i, m′.sub.r,i) of the input mask m.sub.r,i and the output mask m′.sub.r,i used as masks for the ith transrandomized substitution box SBOX for the r.sub.th round S(r, i).

(44) Consequently, the method according to the first aspect may also comprise, when performing each round r, r>1, among said plurality of encryption rounds, called current round: during a first post-encryption step E21, generating a first transrandomized Substitution box for the current round r S(r, 1), from a N−1th transrandomized substitution box S(r−1, N−1) used instead of the initial Substitution box S.sub.0 in the last round (r−1) performed before the current round r, and from masks m.sub.r,1, m′.sub.r,i such that S(r, 1)[x]=S(r−1, N−1)[x xor (m.sub.r−1,N−1 xor m.sub.r,1)] xor (m′.sub.r−1,N−1 xor m′.sub.r,1) for any input value x of the first randomized substitution box for the current round S(r, 1), during a second post-encryption step E22, generating from the first transrandomized Substitution box for the current round r S(r, 1) a N−1 th transrandomized Substitution box for the current round r S(r, N−1) by performing iteratively N−2 times a step of generation of a ith transrandomized Substitution box for the current round r S(r, i) from a i−1th transrandomized substitution box for the current round r S(r, i−1) and from a plurality of masks m.sub.r,i, m′.sub.r,i, m.sub.r,i−1, m′.sub.r,i−1 such that S(r, i)[x]=S(r, i−1)[x xor (m.sub.r,i−1 xor m.sub.r,i)] xor (m′.sub.r,i−1 xor m′.sub.r,i) for any input value x of the ith transrandomized substitution box for the current round S(r, 1), with i an integer comprised in {2, . . . N−1}, during a third post-encryption step E23, using the N−1th transrandomized Substitution box S(r, N−1) instead of the initial Substitution box S.sub.0 in said current round r of the cryptographic process.

(45) Assuming that an attacker is able to perform side-channel analysis attacks when a block cipher encryption is performed and when a masked SBOX computation is performed by transrandomization, such an attacker would get, as shown on FIG. 5: from an analysis of the block cipher encryption at round r a leakage on x or S(x) masked with R.sub.r, N−1, from the transrandomizations performed between block cipher encryptions at round r and r−1, leakages on (R.sub.r−1, N−1 xor R.sub.r, 1) and R.sub.r, i−1 xor R.sub.r, i with i in {2, . . . , N−1}, and from an analysis of the block cipher encryption at round r−1 a leakage on x or S(x) masked with R.sub.r−1, N−1.

(46) Therefore in order to get information on x or S(x), the attacker must combine the N+1 leakages from: the block cipher encryptions at rounds r and r−1, and from all transrandomization operations performed in-between.

(47) As a result the block cipher algorithm protected by such a cryptographic device is protected against any-order side-channel attacks provided that enough transrandomization operations are performed between each block cipher calculation, without requiring any splitting of the input data in multiple shares, and at a limited cost both in terms of memory and processing power.

(48) According to a second aspect, this invention therefore relates also to a computer program product directly loadable into the memory of at least one computer, comprising software code instructions for performing the steps of the method according to the first aspect when said product is run on the computer.

(49) According to a third aspect, this invention therefore relates also to a non-transitory computer readable medium storing executable computer code that when executed by a cryptographic device comprising a processing system having at least one hardware processor performs the method according to the first aspect.

(50) According to a fourth aspect, this invention therefore relates also to a cryptographic device 101 comprising: a processing system having at least one hardware processor 201 configured to execute the steps of the method according to the first aspect, a computer readable memory circuit 203, 204, 205 configured for storing said substitution boxes.