The present invention relates to a cryptography circuit, protected notably against information-leak observation attacks by their encryption.
More and more communication and information processing systems are resorting to cryptographic methods to guard against any malicious exaction on the data which are required to travel over public media. In particular, encryption ensures the confidentiality of the data, cryptographic digest ensures their integrity and electronic signing ensures their authenticity. In each of these cases, a common secret is put into play between the party in charge of sending the data and the party in charge of receiving these data, these two parties possibly being one and the same. For an attacker hostile to these security mechanisms, that is to say wishing to illegitimately ascertain the content of a message, to modify the content of a transaction, to render impersonal or to deny the provenance of an exchange, a priority objective is to retrieve the common secret so as to benefit with impunity from powers similar to the authorized receiving party.
Direct attacks against cryptography algorithms have been and are still sometimes possible. Nonetheless, a continuous decrease in logical flaws is being observed. In particular, more and more cryptography algorithms are standardized after being passed through an international scrutiny test. This was notably the case for AES (Advanced Encrypton Standard) symmetric encryption at the end of the 1990's. The same scenario is currently unfurling for the future version 3 of the SHA secure hash algorithm.
However, with the increasing roamability of means for communication and information processing, new attacks are becoming conceivable. By observing the temporal behavior of a system, in terms of execution speed, its comprising electronics, in terms of energy consumption by a DPA attack for example, or its radiative behavior, in terms of magnetic radiation by an EMA attack for example, a great deal of information may leak. Protections against these attacks on the side channels have been proposed, on the basis notably:
These two techniques make it possible to increase the difficulty of attacks aimed at retrieving information, but they nonetheless remain vulnerable to attacks which would profit from implementational defects. Examples of DPA attacks are described in the document by P. Kocher et al: Differential Power Analysis, In proceedings of CRYPT'99, volume 1666 of LNCS, pages 338-397, Springer-Verlag, 1999. Examples of EMA attacks are described in the document by K. Gandolfi et al: Electromagnetic Analysis—Concrete Results, In CHES, volume 2162 of LNCS, pages 251-261, Springer-Verlag, 2001.
There exist numerous potential or substantiated examples of vulnerability. The following may notably be cited:
An aim of the invention is notably to counter these attacks, notably of the DPA or EMA type. For this purpose, the subject of the invention is a cryptography circuit comprising a functional key kc for executing a cryptography algorithm, characterized in that said circuit comprises a second key kl independent of kc and specific to each instance of said circuit, making it possible to protect the latter against attacks exploiting the side channels of the circuit.
This second key can either be stored in a dedicated storage unit or be specific to the component.
The functional key kc is for example masked by the second key ki by combining the two keys via the XOR operation, an input variable x being encrypted by the masked key kc⊕ki.
The second key ki serves for example to protect the key kc by virtue of a confidential implementation.
The second key ki serves for example to protect a confidential algorithm, notably that comprising a standard cryptographic algorithm customized by the bracketing of two secret functions protected by masking with the key ki.
The second key ki is for example created by a function of the PUF (Physically Unclonable Function) or POK (Physically Obfuscated Key) type.
The second key ki can also be programmed after fabrication of the circuit, by customization, with a unique random value in a secure enclosure.
The masking introduced by the second key ki may be protected against HO-DPA high-order attacks.
The knowledge of the second key ki, serving as implementation key unique to a circuit, allows for example the use of a protection control procedure to privileged users responsible for said control.
The may be realized on a programmable circuit of the FPGA type.
The second key ki may be customized by way of an FPGA's programming file.
Advantageously, the circuit may be realized by a software implementation.
It comprises for example a third key kb for encrypting the programming file (25) of said FPGA circuit, this conferring the confidentiality of the external storage and of the transfer of the key ki to the FPGA.
The cardinal of the second key ki is for example equal to the cardinal of the functional key kc, this so as to render hidden-channel attack on ki more difficult than cryptanalytic attack on kc.
The cardinal of the cardinal of the third key kb is greater than or equal to the cardinal of the functional key kc.
The encryption algorithm is the DES algorithm.
Other characteristics and advantages of the invention will become apparent with the aid of the description which follows, given in relation to appended drawings which represent:
By way of comparison
An input message 1 is therefore apportioned between a left data register 3 and a right data register 4. A mask 2 is apportioned between a left mask register 5 and a right mask register 6. Before being stored in the left and right data registers, the data of the message are masked by combining with the mask data by means of an XOR gate 7 on the left and of an XOR gate 8 on the right. The encryption key 9, k, is also masked by the mask m by a Feistel function 10. The masked datum of the right register 6 and the half-mask of the right register 2 form the inputs of the Feistel function wherein the right masked datum is encrypted by a first substitution box 9 and where the right half-mask is encrypted by a second substitution box 16. The data of the left data register 5 and left mask register 1 are combined respectively with the right datum and with the new mask, at the output of the Feistel function, by means of XOR gates 11, 12 and are thereafter looped back to the right registers, the right and left data being subsequently recombined by XOR gates 13, 14 so as to output 15 the encrypted message. In a circuit of the type of
A circuit according to the invention preserves the leak but renders it encrypted, therefore incomprehensible. Thus an attacker carrying out for example an attack of DPA or EMA type finds only the variable:
K⊕M (1)
that is to say the secret key K itself encrypted by a mask M. This mode of protection of the key K is known by the name of Vernam encryption, with the “exclusive or” operation, also called XOR, and denoted by ⊕, a Vernam code being a code that can be encrypted with the XOR operation. A cryptography circuit according to the invention is therefore protected against attacks on the hidden channels by Vernam encryption of information leaks.
There exist application fields where the encryption algorithm is completely customized. Such is the case for example in the public or private sphere for GSM or pay-per-view television which rely on confidential cryptography. An argument customarily put forward to justify this choice is that attacks on the side channels, so-called SCA (Side-Channel Attacks), are impossible since the leakage function to be correlated with the circuit is unknown. In the document K. Tiri et al: Side-Channel Leakage Tolerant Architectures, In ITNG'06—Proceedings of the Third International Conference on Information Technology, New Generation, pages 204-209, Washington D.C., USA, 2006 IEEE Computer Society, it is proposed to modify at one and the same time the implementation and the functionality of an algorithm, with or without overhead in terms of quantity of hardware. A drawback of the previous two procedures is that the encryption becomes functionally secret. This may be admissible in certain typical cases when security professionals implement the system and its deployment. But in the great majority of cases, when the design and the distribution of the encrypting systems is difficult to monitor, this scenario is very uncertain. Once the functionality of the secret has been recovered, an attack of the DPA type becomes possible again in a trivial manner. Moreover certain certification policies, such as for example FIPS-140, demand the non-customized use of cryptography standards, this rendering all the SCA-tolerant procedures advocated, notably in the document by K. Tiri et al, prohibitive.
According to the invention, to carry out an encryption, while complying fully notably with the known functional specification of this encryption, a protection by masking is performed using a mask specific to the cryptography circuit to be protected. A circuit according to the invention comprises a masking architecture where the mask M, specific to the circuit, is simply constant and unknown to the user or to the designer of the circuit.
It may be demonstrated that a masking path according to
Thus, first-order correlation attacks are rendered impossible since the leakage model is unknown. Moreover, attacks which rely on the construction of a set, or catalog, of measurements, such as so-called “template” attacks, are also rendered infeasible since each implementation being unique, it is impossible to construct a universal catalog.
Advantageously, with the invention, the diversity of the implementations is comparable, or indeed equal, to the number of cryptographic keys. In particular, an attack of “second preimage” type is then impossible. The probability of finding by chance a circuit whose key is programmable having the same mask as a circuit in active service is comparable, or indeed equal, to the probability of guessing the right key by chance, that is to say of succeeding with an exhaustive search on the key by brute force attack.
In the example of
Within the framework of an ASIC or FPGA based realization, the masking of other types of cryptographic primitives may be automated with the assistance of suitable CAD tools operating directly on the source code.
It is interesting to note that the protection procedure can be applied generally to any implementation which contains a secret that might leak via a side channel. An immediate example is the protection of encryption keys, but signature keys are equally well protected in the same way. Moreover, instead of protecting a parameter of a cryptographic algorithm, it is also possible to protect the algorithm itself, if it is confidential. This happens in sectors such as pay-per-view television, where a non-interoperable cryptography may be implemented since the communications are encrypted point-to-point (satellite toward decoder). It is then usual to use a standardized algorithm while modifying one or more elements therein (such as the substitution tables or the diffusion functions). In this way, customization of the algorithm is achieved without running the risk of weakening its security.
A solution of the FPGA type advantageously allows each circuit to have its own configuration, even during large-scale deployment. In particular with an FPGA solution, it is needless to recompile a whole system in order to modify a value, such as the mask specific to a component notably, in order to customize it. This implies that Kerckhoffs' principle is not violated, each implementation being actually secret, but unique. The compromising of an implementation does not allow the compromising of all the setups.
The retro-design of the functionality of certain FPGA circuits may be made possible on account of the fact that it is programmed software-wise, in a file situated in a permanently readable memory. To avoid such a retro-design, it is possible to use a type of FPGA making it possible to encrypt this file, termed “bitstream”. Thus, the protection is itself kept confidential by cryptographic means. Code obfuscation is an additional parry to complicate the operation aimed at backtracking from machine language to a high-level specification.
A functional key kc serves to implement the encryption in the circuit 21. This encryption is for example the DES algorithm 23 which transforms an input variable x into an enciphered variable y=DES (x, kc) inside a register 22.
A non-functional key ki serves to mask the functional key kc. It is this key ki which forms the mask M of the functional key, an XOR operator combines these two keys into kc⊕ki. The key ki therefore serves to protect the functional key kc of the DES implementation against information leaks 24, by observation of magnetic radiation or of instantaneous consumption notably.
Another non-functional key kb serves to protect the secret elements of the “bitstream” file 25, that is to say at least ki, or indeed kc.
Preferably, in this scheme, the keys are dimensioned in such a way that:
|ki|=|kc| (2)
and |kb|≧|kc| (3)
|ki|, |kb|, |kc| expressing respectively the cardinal of ki, of kb and of kc.
According to the invention the implementation of the cryptography algorithm 23 is such that the enciphered variable y is functionally independent of the key ki protecting the encryption key kc of the variable, the information leaks of the setup being as diverse as 2|k
In the case of a DES algorithm, y=DES (x, kc, ki) with y functionally independent of ki.
It should be noted that a first-order attack is not simply rendered more difficult but impossible. Since it is necessary to guess kc knowing kc⊕ki, ki being totally unknown, including to a user or to a designer. In this, the invention affords a high degree of confidence, security being proven against any adversary having a calculation force of less than 2|k
It is possible to use a function of PUF (Physically Unclonable Functions) or POK (Physically Obfuscated Key) type, (i.e. implementation-specific physical key), or any other system making it possible to generate a secret specific to the circuit 21 instead of a key supplied from outside, via a public-key infrastructure, termed PKI, or any other mechanism for customizing confidence.
The second key ki can still be programmed after fabrication of the circuit with a single random value in a secure enclosure.
It is also possible to use a masking mechanism with constant mask, which moreover uses counter-measures to attacks on the combinatorial logic, also known by the name “Shallow Attack”, or against HO-DPA attacks.
It should be noted that an attack on the algorithmic masking exploiting the presence of non-functional transitions, also called “glitches”, hardly dependent in the secret mask, such as presented notably in the document by S. Mangard et al: Successfully Attacking Masked AES Hardware Implementations, In LNCS, editor, Proceedings of CHES'05, volume 3659 of LNCS, pages 157-171, Springer, September 2005, Edinburgh, Scotland, does not apply to a secret implementation, since it is impossible to carry out a simulation of the circuit, not knowing it. In fact, this attack relies on a correlation with a pre-characterized model. This step is infeasible with a circuit according to the invention, except for a possible clued-up attacker who would know the design of the masks of the ASIC produced, or the “bitstream” file of the FPGA, or who would have a sample where the mask can be chosen. To prevent this possibility, the PUF function described previously can notably be used.
Certain proprietary algorithms, in particular the standard algorithms encapsulated between two secret encodings, are not resistant to perturbation attacks as shown notably in the document by C. Clavier: Secret External Encodings Do Not Prevent Transient Fault Analysis, In CHES, volume 4727 of Lecture Notes in Computer Science, pages 181-194, Springer, 2007. This class of attack requires that the attacker be able to fix the value of a register at a known value, such as 0x00 for example. In a circuit protected by an implementation key ki according to the invention, this is very difficult in practice if the data register and mask register are disjoint, since the attacker would then have to achieve multiple faults that are much more difficult to generate than simple faults.
A type of protection according to the invention, with implementation key ki, can advantageously be combined with other protections such as for example the usual protections for detecting faults, at the RTL level in respect of coding, or the physical level in respect of encapsulation. This makes it possible to attain a high level of protection both against passive attacks and against active attacks.
Number | Date | Country | Kind |
---|---|---|---|
0950342 | Jan 2009 | FR | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/EP2010/050547 | 1/18/2010 | WO | 00 | 8/3/2011 |