METHOD FOR PERFORMING CRIPTUAL OPERATIONS IN A PROCESSING DEVICE, CORRESPONDING PROCESSING DEVICE AND COMPUTER PROGRAM PRODUCT
Patent Information
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2026-04-01
Description
Technical field
[0001] The present description relates to techniques for performing Method for performing cryptographic operations in a processing device, comprising a Leakage resilient encryption procedure, which comprises a Leakage Resilient derivation function which derives a derived key from a master key,
[0002] Various embodiments may apply e.g., to smartcard, microcontrollers, Internet of Things chips, set-top-box using an encryption or digital signature scheme. In particular embodiments can be applied in unprotected crypto hardware accelerators.Description of the prior art
[0003] Cryptographic protocols are abstract or concrete protocols that perform a security-related function and apply cryptographic methods, often as sequences of cryptographic primitives.
[0004] In the field of protection from Side Channel Attacks in devices which uses cryptographic algorithms, e.g. microcontroller implementing encryption algorithms, such as ECC or RSA, vertical Side Channel Attacks (SCA) are known, where the attacker can encrypt arbitrary data (input) using the device, in order to get the cryptographic key used by the encryption algorithm. The attackers record side channel information during encryption of known input data, the side channel being represented by power consumption, electromagnetic radiation, or other similar quantities.
[0005] The side channel is linked with the data processed by the device, which are the cryptographic key and the attacker's data fed as input, which represent therefore known data.
[0006] The attacker records many "traces" with different known input data and a constant unknown key, making hypotheses on the value of a portion of the cryptographic key, and uses statistical methods to verify such hypotheses using the traces. To apply such statistical methods the attacker needs to use many traces, each with different and known input data and constant key.
[0007] A known solution to defend from such attacks is to use an implementation with SCA protection, which however cannot make use existing non protected hardware, while is often too late or too costly to embed protected hardware. Also it is not always possible to switch to protected software implementation, because of anti-reverse engineering constraints, as protected software must not be visible from attackers. Also protected software requires secret random (secret even for legitimate user). Finally, there may be a significant downgrade of the performance.
[0008] On the other hand, it is possible to define an operation that is leakage resilient (DPA resistant) on top of existing hardware.
[0009] The basic requirement of Leakage Resilient encryption, in particular for public key encryption, is that an encryption key can be used for a very limited number of times. However, users may desire to have a master key which lasts a long time, also years.
[0010] Therefore, in Leakage Resilient encryption schemes it is provided to derive a different key for each message from the same master key. This requires a Key Derivation Function, or KDF, which uses multiple times the master key. Thus, the KDF itself must be leakage resilient, i.e. a Leakage Resilient Key Derivation Function (LR-KDF).
[0011] Thus LR-KDF implemented on commonly available unprotected crypto hardware accelerators may represent an attractive solution if one cannot afford DPA protected solutions and / or wants to leverage existing hardware.
[0012] Solutions are known which makes use of a Leakage Resilient crypto such as the so called GGM scheme, described in Oded Goldreich, Shafi Goldwasser, and Silvio Micali. "How to construct random functions" Journal of the ACMAugust 1986 https: / / doi.org / 10.1145 / 6490.6503.
[0013] To this regard, in figure 1 it is shown a chain to obtain a derived key from a master key. A master key MK is supplied to an invocation of a cipher 11, e.g. a cipher performing AES (Advanced Encryption Standard) encryption, block 11 which receives the first bit NC 0 of an initialization vector NC. The initialization vector, which is sometimes also referred as nonce, has the property of s uniqueness, which means that no initialization vector may be reused under the same key. The initialization vector NC is preferably random generated, although in variant embodiments an incremental generation using for instance a counter increasing monotonically may be used. The initialization vector NC can be seen as a plaintext to be encrypted by the AES 11. The intermediate encrypted key IK 0 of the encryption by the encryption block 11 is fed again to another invocation of the AES cipher 11 together with the following bit NC 1 of the initialization vector NC. The procedure is repeated till to the last n-th bit NC n of the initialization vector NC, which gives an encrypted output IK n . Then a final encryption is performed on the n-th encrypted output IK n supplying a string of zeroes as plaintext instead of the initialization vector NC bits, to the invocation of AES cipher 11, obtaining finally as output the derived key DK.
[0014] This procedure has the limitation of performing one encryption per initialization vector bit plus one, resulting for instance in 129 encryptions for an initialization vector of 128 bits.
[0015] From the publication of Medwed, Standaert, Joux, "Towards Super-Exponential Side-Channel Security with Efficient Leakage-Resilient PRFs", In: Prouff, E., Schaumont, P. (eds.) Cryptographic Hardware and Embedded Systems -CHES 2012 - 14th International Workshop, Leuven, Belgium, September9-12, 2012. Proceedings. Lecture Notes in Computer Science, vol. 7428,pp. 193-212. Springer (2012), it is known a method which is faster than GGM, called LR-PRF (Leakage Resilient Pseudo Random Function) . Such method puts up to 8 initialization vector bits in each input byte of the status. Such method provides that the number of initialization vector bits in each input byte can be configured between 1 and 8. If the number n of initialization vector bits in each input byte is 1, this corresponds to the GGM method, where two inputs are used with the master key. If the number n of initialization vector bits in each input byte is 8 there are 256 inputs used with the same key.
[0016] Since an encryption such AES is typically attacked through the first round SBOX, in this LR-PRF solution the SBOX works independently on bytes. Also, such LR-PRF solution computes all bytes in parallel, so that it maximizes the noise. In this way even if an attacker would be able to recover all key bytes, the attacker would not know their origin and would have to test 16! = 2 44< keys.
[0017] The LR-PRF algorithm requires a number of encryption operations equal to the initialization vector size divided by the number n of initialization vector bits in each input byte plus one of initialization vector_size / n + 1 encryption. Thus, for n=1 there are 129 encryption operation to be performed, for n=8 only 17.
[0018] Such a solution presents however drawbacks since: it considers only attacks on the first round SBOX; it requires parallel computation of all SBOX it ignores extremely localized electromagnetic side channels.
[0019] A further relevant item of prior art is the United States patent application publication document US 2021 / 021405 A1, which discloses the generation, from a main key, of a sequence of sub-keys for use as a key schedule for a block cipher.Object and summary
[0020] An object of one or more embodiments is to provide a method for cryptographic operation of data in a processing device including performing an operation that solves the drawbacks of the prior art and in particular is more resistant to SCA.
[0021] According to one or more embodiments, that object is achieved thanks to a method having the characteristics specified in Claim 1. One or more embodiments may refer to a corresponding processing device performing the method and to a computer program product that can be loaded into the memory of at least one computer and comprises parts of software code that are able to execute the steps of the method when the product is run on at least one computer. As used herein, reference to such a computer program product is understood as being equivalent to reference to a computer-readable means containing instructions for controlling the processing system in order to co-ordinate implementation of the method according to the embodiments. Reference to "at least one computer" is evidently intended to highlight the possibility of the present embodiments being implemented in modular and / or distributed form.
[0022] The claims form an integral part of the technical teaching provided herein in relation to the various embodiments.
[0023] According to the solution described herein, the method for cryptographic operation of data in a processing device includes a Leakage resilient encryption procedure, which comprises a Leakage Resilient derivation function which derives at least a key from a master key, said method comprising performing said operation of deriving at least a key from a master key by providing a plurality of instances of an encryption cipher, providing a unique initialization vector, in particular a random number, comprising a plurality of initialization vector bits, in particular 128, invoking a first instance of said cipher providing to said first instance of said cipher a master key as encryption key and a first set of bits in said plurality of initialization vector bits as plaintext input which is encoded by said cipher with said master key obtaining an intermediate key, performing an iterative procedure comprising at each iteration, invoking a further instance of said cipher, providing an intermediate key at the encrypted output of an instance of the cipher, previous with respect to said further instance, and a set of said plurality of initialization vector bits as plaintext input, which is subsequent the set used by the previous instance of the cipher, said subsequent set being encoded by said further instance of the cipher with said previous intermediate key to obtain a subsequent intermediate key, said iteration being performed on all the sets of the plaintext, wherein said providing set of said plurality of initialization vector bits as plaintext input includes providing introducing said initialization vector bits in bytes of an input state of the cipher, introducing at most one initialization vector bit per byte, a number of bits introduced in said input state varying from 2 to the number of bytes in the input state of the cipher.
[0024] In various embodiments, said input state has 16 bytes and said number of bits introduced in said input state varies from 2 to the 16, in which case an initialization vector bit in each byte of the input state is provided.
[0025] In various embodiments, a final encryption is performed on the last encrypted output supplying a string of zeroes as plaintext to the instance of cipher, obtaining as output the derived key.
[0026] In various embodiments, said cipher is an AES cipher.
[0027] The solution here described refers also to embodiments of a processing device configured to perform the steps of the method of any of the previous embodiments.
[0028] The solution here described refers also to a computer program product that can be loaded into the memory of at least one computer and comprises parts of software code that are able to execute the steps of the method of any of of any of the previous embodiments when the product is run on at least one computer.Brief description of the drawings
[0029] The invention will now be described purely by way of a non-limiting example with reference to the annexed drawings, in which: Figure 1 was discussed in the foregoing; Figure 2 represents an input of the cipher according to the method here described; Figure 3 represents a flow diagram of an embodiment of the method here described. Detailed description of embodiments
[0030] The ensuing description illustrates various specific details aimed at an in-depth understanding of the embodiments. The embodiments may be implemented without one or more of the specific details, or with other methods, components, materials, etc. In other cases, known structures, materials, or operations are not illustrated or described in detail so that various aspects of the embodiments will not be obscured.
[0031] Reference to "an embodiment" or "one embodiment" in the framework of the present description is meant to indicate that a particular configuration, structure, or characteristic described in relation to the embodiment is comprised in at least one embodiment. Likewise, phrases such as "in an embodiment" or "in one embodiment", that may be present in various points of the present description, do not necessarily refer to the one and the same embodiment. Furthermore, particular conformations, structures, or characteristics can be combined appropriately in one or more embodiments.
[0032] The references used herein are intended merely for convenience and hence do not define the sphere of protection or the scope of the embodiments.
[0033] In figure 2 it is shown a State S which represents the input data structure of a round of the AES cipher 11. As known, a plaintext of 128 bits is copied in the State S, dividing it in sixteen 8-bit bytes, in a 4x4 array, on which the operations of the AES rounds, starting with SubstituteBytes, are performed.
[0034] As shown in figure 2, according to the method here described, in the 16 bytes, B 0 ...B 15 of the State S input of the cipher 11 is introduced a number nn of initialization vector bits NC. The number nn of initialization vector bits NC may be different according to the different embodiments, in particular may vary between 2 and 16. Thus, up to one initialization vector bit for input byte is provided, i.e. a maximum of one initialization vector bit in each input byte of the State S, the latter happening when nn=16.
[0035] Thus, by way of example, given an initialization vector NC of 128 bit of length, which can be seen as by a plurality of consecutive sets of bits NCS 0 ...NCS 7 , in the example shown starting from the MSB to the LSB, as shown in figure 3, where the number nn of initialization vector bits is set to 16, bits with logical values 0 or 1 are introduced in respective 16 bytes B 0 ...B 15 of a 16 bytes input state S for the SBOX of the first round of an AES.
[0036] In general, the number nn of initialization vector bits is greater than one.
[0037] Thus the method, as shown in figure 3, includes a a key derivation procedure which includes invoking a plurality of instances of an encryption cipher 11, i.e. at each iteration an instance or invocation of AES cipher is invoked, providing a unique initialization vector NC, in particular a random number, comprising a plurality of initialization vector bits, in the example 128 bits, invoking a first instance of the cipher 11, providing to said first instance of said cipher 11, the master key MK as encryption key and a first set of bits NCS 0 in such plurality of initialization vector bits, of which the initialization vector NC is composed, as plaintext input which is encoded by the cipher 11 with such master key MK obtaining an intermediate key, IK 0 , then performing an iterative procedure comprising at each iteration invoking a further instance of said cipher 11, e.g. the (i-1) th< invocation or instance of the cipher 11, I being the index of the iterations, providing an intermediate key IK i-1 at the encrypted output of the previous instance of the cipher 11, i.e., previous with respect to said further instance, and a set NCS i of the plurality of initialization vector bits as plaintext input, which is subsequent the set NCS i-1 used by the previous instance of the cipher 11, such subsequent set NCS i being encoded by such further, i th< , instance of the cipher 11 with the previous intermediate key, IK i-1 , to obtain a subsequent intermediate key IK i , the iteration being performed on all the sets NCSi of the plaintext, i.e. from NCS 0 to NCS 7 in the example with nn=16, wherein providing a set NCS i of the plurality of initialization vector bits as plaintext input, in the first operation and following iterations, includes providing introducing the initialization vector bits in bytes of an input state (S) of the cipher 11, i.e. introducing at most one initialization vector bit per byte, a number nn of bits introduced in said input state S varying from 2, i.e. 1 initialization vector bit every 8 bytes of input state S, to the number of bytes in the input state of the cipher 11.
[0038] In particular the input state S has 16 bytes, i.e. in the AES case, and said number nn of bits introduced in said input state S thus varies from 2 to 16, in which case, nn=16, an initialization vector bit in each byte of the input state (S) is provided.
[0039] Then, also in this case a final encryption is performed on the last encrypted output, i.e. the last output encrypting a set of bits NCS, specifically NCS 7 , which in the example is the eighth intermediate key IK 7 , supplying a string of zeroes as plaintext instead of the initialization vector NC bits, to the invocation of AES cipher 11, obtaining finally as output the derived key DK.
[0040] It is pointed out that for a number nn of initialization vector bits per input state S greater than 8, the number of AES encryption is lower than any prior art method, as shown in Table 1 below, where number of AES encryption as a function of number nn of initialization vector bits per each input byte is shown. Table 1 nn=9 nn=10 nn=11 nn=12 nn=13 nn=14 nn=15 nn=16 AES encryptions161413121111109
[0041] If the number nn of initialization vector bits in the input status S is 16, i.e. one per input byte, there are 65k inputs used with the same key.
[0042] But, as AES is typically attacked through the first round SBOX, which works independently on bytes and are provide to each SBOX only 2 possible inputs (0 or 1), this attack path becomes infeasible, furthermore this method does not require parallel computation of all SBOXes, although it may still help to have it for increased noise.
[0043] The method described also could be effective against extremely localized EM side channels
[0044] Of course, without prejudice to the principle of the embodiments, the details of construction and the embodiments may vary widely with respect to what has been described and illustrated herein purely by way of example, without thereby departing from the scope of the present embodiments, as defined the ensuing claims.
[0045] It is noted that the cipher here described is an AES cipher, nevertheless other types of cipher, can be used.
[0046] The method for performing cryptographic operations in a processing device here described can be used in operations including a Leakage Resilient derivation function which derives a different key for each message from the same master key in order to perform a Leakage resilient encryption procedure. However the method for performing cryptographic operations in a processing device here described can be used in other cryptographic operations which require Leakage Resilient derivation function which derives a key from a master key, for instance in an authentication procedure.
Claims
1. Method for performing cryptographic operations in a processing device, said cryptographic operations comprising a Leakage Resilient derivation function which derives at least a key (DK) from a master key (MK), said method comprising performing said operation of performing a Leakage Resilient derivation of said at least a key (DK) from a master key (MK) by invoking a plurality of instances of an encryption cipher (11), providing a unique initialization vector (NC), in particular a random number, comprising a plurality of initialization vector bits, in particular 128, invoking a first instance of said cipher (11) providing to said first instance of said cipher (11) a master key (MK) as encryption key and a first set of bits (NCS0) in said plurality of initialization vector bits as plaintext input which is encoded by said cipher with said master key (MK) obtaining an intermediate key, performing an iterative procedure comprising at each iteration invoking a further instance of said cipher (11), providing an intermediate key (IKi-1) at the encrypted output of a instance of the cipher (11), previous with respect to said further instance, and a set (NCSi) of said plurality of initialization vector bits as plaintext input, which is subsequent the set (NCSi-1) used by the previous instance of the cipher, said subsequent set (NCSi) being encoded by said further instance of the cipher (11) with said previous intermediate key (IKi-1) to obtain a subsequent intermediate key (IKi), said iteration being performed on all the sets (NCSi) of the plaintext, wherein said providing set (NCSi) of said plurality of initialization vector bits as plaintext input includes providing introducing said initialization vector bits in bytes of an input state (S) of the cipher (11), introducing at most one initialization vector bit per byte, a number (nn) of bits introduced in said input state (S) varying from 2 to the number of bytes in the input state of the cipher (11).
2. Method according to claim 1, wherein said input state has 16 bytes and said number (nn) of bits introduced in said input state (S) varies from 2 to the 16, in which case an initialization vector bit in each byte of the input state (S) is provided.
3. Method according to claim 1, wherein a final encryption is performed on the last encrypted output (IKn) supplying a string of zeroes as plaintext to the instance of cipher (11), obtaining as output the derived key (DK).
4. Method according to claim 1, wherein said cipher is an AES cipher.
5. Method according to claim 1, wherein said Leakage Resilient derivation function is comprised in a Leakage resilient encryption procedure and derives a different key for each message from the same master key (MK).
6. Processing device (10) configured to perform the steps of the method of any of claims 1 to 5.
7. A computer program product that can be loaded into the memory of at least one computer and comprises parts of software code that are able to execute the steps of the method of any of Claims 1 to 5 when the product is run on said at least one computer.