White-box encoding

FR3140960B1Active Publication Date: 2025-03-14BANKS & ACQUIRERS INT HLDG SAS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
FR2022010698
Authority / Receiving Office
FR · FR
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-10-17
Publication Date
2025-03-14
Estimated Expiration
2042-10-17

Smart Images

  • Figure 00000024_0000
    Figure 00000024_0000
  • Figure 00000024_0001
    Figure 00000024_0001
Patent Text Reader

Abstract

The invention relates to a computer-implemented method for generating encodings for cryptographic algorithms. It involves the following steps: - obtaining at least one characteristic specific to a computer device (1) configured to execute a cryptographic algorithm (43); - from this characteristic, generating a device-dependent encoding operation (433, 434); - associating the generated dependent encoding operation (433, 434) with the cryptographic algorithm (43). Figure 2 for the abstract
Need to check novelty before this filing date? Find Prior Art

Description

Title of the invention: White box encoding

[0001] The invention relates to white box cryptography, and more particularly to the encoding operations associated with an encryption algorithm within the framework of a white box attack model.

[0002] White box cryptography is a subject of study based on the postulate that an attacker, who seeks to identify secret, encrypted data that can be decrypted using an encryption algorithm, has complete access to the algorithm's execution platform and to the software implementation of this algorithm in the platform: the binary code is thus entirely visible, it is modifiable, and the attacker can also act at will on the software execution through the various systems of the platform such as memory, calls to processors, etc. The most classic example is that of an attacker having access to a third-party smartphone, in which a software application on the smartphone encrypts or decrypts secret data using an encryption key and a cryptographic algorithm, for example of the "AES" type (for "Advanced Encryption Standard").The attacker has full power over the smartphone and the algorithm, and can thus seek to read the corresponding binary code, modify it, execute it in a specific manner, with the ultimate objective, knowing the type of algorithm used, of identifying the encryption key, decrypting the secret data, and / or modifying this data.

[0003] To prevent this attacker from accessing the secret data and to protect the integrity of the encryption in this white box context, a method is known in the state of the art consisting of encoding elementary operations of the encryption (or decryption) algorithm. Indeed, an elementary operation, resulting from the combination between a known type of algorithm and a specific encryption key, is generally implemented in the form of a truth table indicating the possible results of the operation depending on the input data. An encoding operation therefore consists of applying a random transformation to an elementary operation so as to make this operation unreadable. To encode an operation, a substitution of the elements of the truth table can be carried out, by combining the initial table with a random substitution table, so as to obtain an “obfuscated” or “merged” table.Alternatively, a linear transformation can be applied to the operation by combining a vector representing the output data, or a matrix corresponding to the operation, with another matrix, called an encoding matrix, which is also random. An encoding can also be a combination of one or more substitutions and one or more encoding matrices. Other types of encoding are . possible. In addition, each elementary operation following an encoded elementary operation is itself combined with a so-called "inverse" encoding, or decoding, corresponding inversely to the previous encoding. This is, for example, the inverse substitution table or the inverse matrix corresponding to the previous encoding, so that the initially planned algorithm is not modified by successive encodings. In all cases, only the truth tables resulting from these encoding operations merged with the elementary operations, i.e. the so-called "obfuscated" or "merged" tables, are stored in the software memory implementing the algorithm. In this way, the attacker, having access only to the obfuscated tables, cannot identify which elementary operation is associated with each table and therefore cannot determine the encryption key used and decrypt the secret data.

[0004] These encodings, making it possible to encode an encryption (and / or decryption) algorithm within an unsecured execution platform, for example within a smartphone, are called “internal”, since they make it possible to make the encryption key used within the white box formed by the implemented algorithm unreadable.

[0005] However, this white box generally communicates on the one hand with a server located remotely, and on the other hand with a third-party application located on the same platform. For example, it is common for a server to encrypt data and communicate the encrypted data to the smartphone, then for the white box, i.e. the decryption algorithm executed by the smartphone, to be used to decrypt the data before this decrypted data is communicated within the same smartphone to a third-party application, called "final", which is intended to use the decrypted data. However, the final applications are developed by third-party companies, independently of the white boxes.These companies therefore acquire white boxes marketed in the form of software libraries containing the encryption and decryption algorithm, and an API (for "Application Programming Interface") allowing the algorithm to be controlled and the data coming out of this algorithm to be used in the final application developed. In this context, the "internal" encodings within the white box do not prevent the decrypted data from circulating, in clear, between the white box and the final application. Similarly, even if the encryption key used is now very difficult to identify within the white box thanks to the internal encodings installed in this white box, the attacker can attempt to port the code, that is to say, export the entire code from the white box to another device to exploit it there without having to identify the key.

[0006] This is why it is known in the state of the art to implement, in addition to these internal encodings, so-called “external” encodings, placed at the ends of the channel of complete communication between the sending of data and its use. For example, first within the remote server, a first "external" encoding is applied to the last truth table of the server's encryption algorithm, whether in the form of a substitution table, an encoding matrix or another form of random encoding, so that the data to be communicated to the smartphone is not only encrypted as intended, but also encoded before being communicated to the smartphone. Then, at the entrance to the white box, the inverse encoding of the external encoding is applied to the first truth table of the decryption algorithm, before the data is processed through the white box decryption algorithm and its internal encodings. The inverse encoding corresponding to the first external encoding is therefore part of the white box.Then, a new random encoding is done at the output of the white box, by applying this new encoding to the last truth table of the white box. Here too, this second encoding is therefore part of the white box. At the output, the data is therefore decrypted, but again encoded this time using this new random encoding, before being communicated to the final third-party application intended to use it. Finally, within this third-party application, the external encoding corresponding to the inverse of the encoding applied at the end of the white box makes it possible to decode the data within the application before it is used by the application.

[0007] Thanks to these external encodings placed outside the white box, even once decrypted, the data do not circulate "in clear" outside the white box, they remain encoded, therefore protected from manipulation by an attacker who would like to intercept them. In addition, the attack consisting of carrying the entire code of the white box on another device does not work, since in this context the code of the white box includes within it an encoding at its input and an encoding at its output. Without the corresponding inverse encodings, which are located remotely (within the server and within the final application), it is not possible to find the data in clear. In addition, added to the internal encodings, these external encodings associated with encodings at the output and input of the white box make it even more difficult to identify the encryption key of the white box.

[0008] It should be noted that all of these encodings, both internal and external, are random, that is to say that they use transformations, substitutions or other manipulations unknown to all, so that no attacker can find them.

[0009] However, this method comprising internal encodings and external encodings still includes at least two drawbacks.

[0010] First, as noted above, the final applications are developed by third-party companies that acquire white boxes and use an API to control them. These companies must therefore integrate into their application themselves the external encoding corresponding, inversely, to the output encoding of the white box. They must then themselves ensure the protection of this external encoding (which can be called external decoding) within the final application. They therefore have an uncomfortable responsibility regarding security and often forces them to use an external solution, potentially expensive, unreliable and adding complexity to the entire data communication channel. In addition, this constraint contravenes the principle of simplified security sold to these companies when the white box was acquired.

[0011] Second, in the event of a white box leak, it remains difficult to identify the source of the leak. In particular, it is not very relevant to embed signatures or identification tokens in the white box, since the attacker will have the possibility of modifying or deleting them.

[0012] The invention aims in particular to improve the security of an already encoded white box cryptographic algorithm. Another aim is to make it possible to identify the source of a possible leak in the algorithm.

[0013] To this end, the invention relates to a method for generating encoding for a cryptographic algorithm, implemented by computer, characterized in that the following steps are implemented:

[0014] - obtaining at least one characteristic specific to a computer peripheral configured to execute a cryptographic algorithm;

[0015] - from the own characteristic, generation of an operation device-dependent encoding;

[0016] - association of the generated dependent encoding operation to the crypto algorithm chart.

[0017] Thus, the transformation associated with the dependent encoding operation depends on at least one characteristic of the device on which the algorithm is intended to be executed. This dependent encoding operation, which can be called dependent encoding, therefore makes it possible to anchor the algorithm on a particular device. The security of the data and of the encryption is therefore improved. In particular, if this dependent encoding is a decoding of a previous encoding, it is necessary to generate this dependent encoding using the device to decode the data, since only this device provides the specific characteristic making it possible to generate the correct decoding. Alternatively, if this dependent encoding aims to encode data, the latter can also only be decoded using the device.

[0018] Furthermore, since dependent encoding is device dependent, it is easier to identify the source of the algorithm leak, since only the intended device can correctly decode the data encoded using this encoding. dependent and therefore to execute the algorithm. Furthermore, if the attacker modifies the dependent encoding to make the source of the leak untraceable, the algorithm no longer works, rendering any attack useless.

[0019] Advantageously, to associate the dependent encoding operation with the algorithm, the encoding operation is combined with an elementary cryptographic operation of the algorithm so as to form a single merged operation, so that a data item processed by the merged operation is operated in accordance with the elementary cryptographic operation and simultaneously encoded in accordance with the dependent encoding operation.

[0020] Thus, the dependent encoding cannot be distinguished from an elementary operation, in particular encryption or decryption, of the algorithm. The operation as well as the dependent encoding are therefore impossible to identify for an attacker having access to the executable code. The operation and the encoding are thus “masked”.

[0021] Preferably, the dependent encoding operation is associated with the algorithm before any cryptographic execution of the algorithm on the peripheral, in particular during an installation of the algorithm on the peripheral, the cryptographic execution corresponding in particular to a data encryption or decryption operation.

[0022] Thus, the algorithm includes this dependent encoding even before it is used on the peripheral. The dependent encoding therefore remains identical here even if the algorithm is implemented on a peripheral other than the one whose encoding is dependent. It is in particular possible for the algorithm to be associated with this encoding before being implemented on the peripheral, if the peripheral and its own characteristic are known in advance.

[0023] Alternatively, the algorithm having been installed on the peripheral, the steps of obtaining the specific characteristic, of generating the dependent encoding operation and of associating the dependent encoding operation with the algorithm are carried out, during a cryptographic execution of the algorithm on the peripheral, the cryptographic execution corresponding in particular to a data encryption or decryption operation.

[0024] Thus, here the dependent encoding is on the contrary generated at the time of execution of the algorithm. In particular, it must be generated again at each execution. The generated dependent encoding can therefore in this case vary depending on the device on which it is generated.

[0025] Advantageously, the dependent encoding operation associated before any cryptographic execution being a first dependent encoding operation, the dependent encoding operation generated and associated during the cryptographic execution on the peripheral being a second dependent encoding operation, this is generated second encoding operation such that data encoded via the first dependent encoding operation is decoded via the second dependent encoding operation.

[0026] In other words, the two previous operations are performed in parallel to generate two distinct but corresponding dependent encodings: one - generated in advance and remaining identical regardless of the device on which the algorithm is implemented - encodes data, while the other, in this case the dependent decoding - generated at each execution from the device on which the algorithm is implemented - decodes this same data. Thus, the data can only be decoded if the algorithm is implemented on the device on which the encoding and decoding are dependent. If the algorithm is implemented on another device, the dependent encoding will encode the data according to the device on which it is dependent, then the dependent decoding will decode it according to the other device, so that the data will not be correctly decoded.The association between a dependent encoding generated in advance and a dependent decoding generated at each cryptographic execution therefore allows anchoring of the white box on a particular device.

[0027] The operations can be reversed so that the operation generated in advance is decoding, the operation generated at each execution being encoding.

[0028] Preferably, the cryptographic elementary operation being a first cryptographic elementary operation and the merged operation being a first merged operation, the algorithm also comprising a second cryptographic elementary operation directly following the first cryptographic elementary operation, the following steps are implemented:

[0029] - combination, before any cryptographic execution of the algorithm on the peri spherical, of the first dependent encoding operation with the first elementary cryptographic operation so as to form the first merged operation;

[0030] - combination, during cryptographic execution of the algorithm on the peri spherical, of the second dependent encoding operation with the second elementary operation, so as to form a second merged operation, so that, when the data encoded and operated by the first merged operation is processed by the second merged operation, it is decoded in accordance with the second dependent encoding operation and simultaneously operated in accordance with the second cryptographic elementary operation.

[0031] Thus, the dependent encoding and decoding operations cannot be distinguished, by an attacker having access to the executable code, from the elementary operations with which they are respectively combined. These elementary and encoding operations are “hidden” in the white box.

[0032] Advantageously, the following steps are also implemented:

[0033] - prior to the first steps stated, generation of a third operation encoding operation, not dependent on the device, and a fourth encoding operation, not dependent on the device and generated so that data encoded via the third encoding operation is decoded via the fourth encoding operation,

[0034] - before any cryptographic execution of the algorithm, combination of the third encoding operation with the first merged operation, so as to form a new first merged operation allowing simultaneously to encode the data in accordance with the first encoding operation and the third encoding operation and to operate the data in accordance with the first elementary operation;

[0035] - during cryptographic execution, combination of the fourth operation encoding with the second merged operation, so as to form a new second merged operation allowing simultaneously to decode the data in accordance with the second encoding operation and the fourth encoding operation and to operate the data in accordance with the second elementary operation.

[0036] Thus, non-dependent, i.e. random, conventional encoding (and decoding) operations are added to the device-dependent encoding (and decoding) operations, and they are also merged respectively with the first and second elementary operations of the algorithm. Two merged operations are therefore obtained, one corresponding to a first elementary operation, to the dependent encoding and to a non-dependent encoding (which is called the third encoding operation), the other corresponding to the second elementary operation, to the dependent decoding and to the non-dependent decoding (which is called the fourth encoding operation), these operations not being able to be distinguished from each other within the merged operations. The addition of the non-dependent encodings and decodings makes it possible to mask the second elementary operation.Indeed, since the dependent decoding (the second dependent encoding operation) is only generated at the execution of the algorithm, in the absence of the non-dependent encoding, the second elementary operation would be accessible and understandable to an attacker with the executable code. The fusion between the non-dependent decoding and the second elementary operation therefore makes it possible to hide the latter before the generation of the dependent decoding.

[0037] Again, as throughout the description, unless otherwise evident, the terms encoding and decoding could be reversed.

[0038] Preferably, the first and second elementary cryptographic operations forming a pair of encoded operations, the steps of generating and combining encodings are repeated for at least one other pair of encoded operations of the algorithm, preferably for multiple pairs.

[0039] Thus, the method concerns more than two elementary cryptographic operations of the algorithm. Potentially, each elementary operation of the algorithm may be concerned by an association with a dependent encoding, but the generation of a dependent encoding or decoding at the time of execution of the algorithm requires resources and time which may make the execution too long. It is therefore advantageous to adapt the number of elementary operations combined with the dependent encodings according to the desired degree of security and the resources available within the device.

[0040] Advantageously, the cryptographic algorithm is of the “AES” type, for “Advanced Encryption Standard” or “DES” for “Data Encryption Standard”.

[0041] These algorithms, associated with private keys, in fact include operations that are easily separable from one another and which will form the elementary cryptographic operations. Now, the more easily an algorithm is separable into simple elementary operations, the easier it is to encode it by associating encodings with these operations, in particular here dependent encodings.

[0042] Preferably, the obtained device-specific characteristic is one of the following characteristics or a combination of at least some of the following characteristics:

[0043] - the MAC number (for “Media Access Control”) of the device;

[0044] - the IMEI number (for “International Mobile Equipment Identity”) of the device spherical;

[0045] - the serial number of the phone;

[0046] - a counter of a number of installations of a cryptographic algorithm within of the device.

[0047] Thus, generating the dependent encoding using another device results in a different encoding, or a non-corresponding decoding, since the inherent characteristic is different.

[0048] Advantageously, the generation of the device-dependent encoding operation comprises a step of hashing the characteristic(s) specific to the device, so as to generate a device-dependent encoding table or a device-dependent encoding matrix, at least one of the elements of the table or respectively of the matrix being derived from the hashing.

[0049] Thus, SHA-type hash functions, for example from the SHA-2 family, can be used to generate the dependent encoding from the specific characteristic(s).

[0050] Preferably, to combine the dependent encoding operation with the elementary cryptographic operation, the terms of a corresponding truth table are substituted corresponding to the elementary operation by means of the generated substitution table, so as to form a merged table corresponding to the merged operation, or a mathematical operation is carried out between a matrix corresponding to the elementary operation and the generated dependent encoding matrix, so as to form a merged matrix corresponding to the merged operation.

[0051] The invention also provides a cryptography method, in which at least one piece of data is encrypted or decrypted on a computer peripheral by a cryptographic algorithm and the data is encoded by at least one encoding operation associated with the algorithm, in which the encoding operation is dependent on at least one characteristic specific to the peripheral.

[0052] Preferably, the encoding operation of this cryptographic method has been previously associated with the cryptographic algorithm in accordance with the encoding generation method described above.

[0053] The invention also provides a computer program comprising instructions which, when the program is executed by a computer, cause the latter to implement the steps of the encoding generation method or the cryptography method described above.

[0054] Also provided according to the invention is a computer-readable recording medium comprising instructions which, when executed by a computer, cause the latter to implement the steps of the encoding generation method or the cryptography method described above.

[0055] The invention also provides a computer peripheral comprising computer calculation means capable of executing a cryptographic algorithm associated with an encoding operation generated in accordance with the method described above. Brief description of the figures

[0056] The invention will be better understood on reading the following description, given solely by way of example and with reference to the appended drawings in which:

[0057] [Fig-1] [Fig.l] is a diagram of a system according to an embodiment of the invention;

[0058] [Fig.2] [Fig.2] is a detailed diagram of a white box according to the method of rea lization of [Fig.l];

[0059] [Fig.3] [Fig.3] is a flowchart according to a first embodiment of the invention;

[0060] [Fig.4] [Fig.4] is a flowchart according to a second mode of implementation of the invention;

[0061] [Fig.5] [Fig.5] is a flowchart according to a third embodiment of the invention including the first and second embodiments. Detailed Description Definitions

[0062] The term "elementary operation" refers to any transformation, for example mathematical, applied to one or more input data resulting in one or more output data of the operation. Within an executable code, an elementary operation can thus be represented by a truth table, accessible and understandable to an informed attacker, indicating, for each possible input of the operation, each corresponding output. In particular, this involves indicating for any series of input bits in an operation what the corresponding series of output bits is.

[0063] By "encoding", we will designate in the following any operation aimed at making incomprehensible, within an executable code, either one or more data, or the transformation associated with an elementary operation. Encoding is therefore itself an operation of transforming input data into output data. The encoding of an elementary operation therefore aims to prevent an attacker from understanding the truth table of the elementary operation. Such encoding can therefore consist of replacing the output data of the truth table with other data via a substitution table, unrecorded and random, indicating the substitutions to be carried out. It can also be a mathematical operation between a vector corresponding to the output data of the initial truth table and a random matrix, called an encoding matrix, again unrecorded.In all cases, the initial truth table is no longer accessible since it is replaced by the "encoded", "merged" or even "obfuscated" truth table, corresponding to the table resulting from both the elementary operation and the associated encoding operation. The encoded elementary operation and the encoding are therefore combined with each other in such a way that they can no longer be distinguished from each other when reading the executable code.

[0064] For simplicity, although the encoding operation itself is not distinguishable from the data or the operation with which it is associated, and although it may have been merged with other successive operations, the theoretical position of the encoding operation in a succession of steps may be referred to hereinafter as "encoding". The result of an encoding operation may also be referred to as "encoding".

[0065] It should be noted that any encoding necessarily corresponds to an inverse encoding, or decoding. This is the operation associated with the inverse transformation of the encoding, making it possible to recover the encoded data or operation when it is applied subsequently. In the following, a decoding may be referred to indifferently by the term encoding or inverse encoding.

[0066] During a succession of elementary operations, in particular in an algorithm encryption or decryption, an encoded operation is followed by another operation merged with the reverse encoding. In this way, the elementary operations follow one another as planned in the algorithm without the encodings disrupting them. In the executable code, an attacker can identify an obfuscated table corresponding to an elementary operation and a first encoding, the two operations being merged. Then, he can identify the next obfuscated table, corresponding to the reverse encoding, a new elementary operation and a second encoding, the three operations also being merged. However, and this is the interest of encodings, the attacker cannot identify the elementary operations performed since they are merged with the encodings. He therefore cannot recover the encryption key and the encrypted data.

[0067] A distinction will be made between encryption / decryption on the one hand, and encoding on the other. Encryption or decryption corresponds to a succession of operations carried out using a cryptographic algorithm and a key. Encoding consists of encoding one of these operations or the output data of these operations. Thus, by "cryptographic algorithm", we will designate an encryption or decryption algorithm based on a known type of algorithm, for example "DES" or "AES", using a specific key, and we will distinguish it from the encoding operations which are merged therein.

[0068] Finally, by “peripheral”, we mean any terminal comprising means for implementing the method described. In the following, this will in particular mean any communication terminal equipped with computer computing means, such as a smartphone. Method of implementation

[0069] In the illustrated embodiment, the invention is implemented within a smartphone 1. The latter includes, in software form, a final application whose executable code 2 is schematically illustrated. This application receives encrypted data as input, such as data sent by a banking server 9 located remotely, and allows a payment to be generated by smartphone as output. It could be a completely different type of application and a completely different type of data. In all cases, it is in the form of a code 2 executable via the smartphone 1, code 2 which can be schematically divided into two parts.

[0070] Thus, part 3 comes directly from the source code developed by the developer, or development company, in charge of application 2. It is not specific to the invention but it is the heart of application 2 in the sense that it receives the decrypted data as input and implements the role assigned to the application, here a payment in accordance with methods which are not specific to the invention and will not be described.

[0071] Part 4 of code 2 includes a cryptographic algorithm of type "A ES" (for "Advanced Encryption Standard") operating with a private key and encodings internal to the algorithm which will be described in detail below. This set of operations forms a decryption method 43, which makes it possible to decrypt the data received from the server 9 before communicating them to part 3 which will use them. This portion 4 would also make it possible to encrypt data to be sent to the server, we would then speak of encryption. Part 4 forms a "white box". Indeed, an attacker with the smartphone 1 can read the entire code of the application 2, manipulate it, execute it in a fine-grained manner, to try to identify in this part 4 the encrypted data, and / or the elementary operations forming the encryption or decryption algorithm 42 to deduce in particular the key used.It can also try to export this white box 4 to another device.

[0072] This white box 4 also includes within it two encodings 41 and 42, distinct from the encodings internal to the algorithm 43 which will be described below. These encodings 41 and 42 correspond to so-called “external” encodings 92 and 31. Encoding 42 makes it possible to encode the data at the output of the decryption operations of algorithm 43. Thus, although the data are decrypted by algorithm 43, they do not circulate “in clear” between the white box 4 and the core 3. The core 3 of the application includes at its input an encoding 31 which is the inverse encoding of encoding 42, making it possible to decode the data received from the white box 4. This inverse encoding 31 is merged with the first operation programmed by the core 3 so that this encoding 31 is not comprehensible. Encoding 31 is considered to be “external” because it is outside the white box.However, it can only decode data encoded via encoding 42 of the white box, and vice versa. Similarly, encoding 41 at the input of white box 4 is the inverse encoding of encoding 92 placed at the output of algorithm 91 within server 9. Thus, the data output from server 9 are both encrypted and encoded, before being decoded by encoding 41 and then decrypted by algorithm 43. It should be noted that encoding 92 is the only encoding associated with algorithm 91. In particular, this algorithm 91 does not include internal encodings, associated with elementary operations.

[0073] Part 4, encompassing algorithm 43 and internal encodings 41 and 42, does not come directly from the developer of application 2. Indeed, it was developed by another company independently of part 3, and was acquired by the developer of application 2 to be implemented in the form of software libraries. Thus, to control this independent white box 4, calls to an API (for "Application Programming Interface") provided by the vendor of white box 4 are provided in the code of part 3, the API allowing for example to initialize the algorithm, to encrypt or decrypt data using this algorithm 43. The developer therefore used the API to program calls to white box 4 to obtain decrypted data or, on the contrary, to provide white box 4 with data to encrypt.

[0074] Finally, remotely from the smartphone, the banking server 9 also includes in software form an “AES” algorithm and an associated private key. The algorithm makes it possible to encrypt data using the key before communicating it to the smartphone 1. All of these encryption operations form the encryption algorithm 91. It can also make it possible to decrypt received data. On the other hand, and unlike algorithm 43, this algorithm 91 does not include internal encodings.

[0075] We will now detail the operations of the cryptographic algorithm 43 placed in the white box 4 and executed within the smartphone 1, with reference to [Fig.2]. We will not describe to what extent and at what times the private key is changed, nor how it is communicated to the server 9, these elements not being specific to the invention.

[0076] By combining an AES type algorithm and a private key, the cryptographic algorithm 43 is obtained, which is used in the illustrated embodiment to decrypt data encrypted by the algorithm 91. It is therefore formed from a succession of elementary operations resulting from the combination between the AES algorithm as it is known and the chosen or determined private key. These operations are encoded, that is to say that each operation is associated with an encoding.

[0077] The encodings 432 and 435 do not depend on the characteristics of the smartphone 1, they are generated upon installation of the application 2 on the smartphone independently of the latter, or even before its installation. The encodings 41 and 42 also do not depend on the smartphone 1. On the other hand, they are chosen so as to correspond to the inverses of the respective external encodings 92 and 31, or vice versa.

[0078] These encodings 432, 435, 41, 42, 92 and 31 are therefore generated in a conventional manner.

[0079] On the other hand, the encoding 433, generated upon installation of the application 2 on the smartphone 1, depends directly on the smartphone 1, while the encoding 434 is only generated upon each execution of the algorithm 43 and also depends on the smartphone 1, as described below.

[0080] In [Fig.2], the elementary operation 431 is encoded by the encoding 432. This encoding 342 is conventional: it involves the application of a randomly chosen substitution table. Thus, the substitutions made depend on nothing but chance. Then a new encoding is applied, the encoding 433. This encoding is of a different type: it was not chosen at random. On the contrary, the substitution table of this encoding 433 was decided at the time of installation of the application 2 on the smartphone 1 and was carried out using characteristics of the smartphone 1, according to a method which will be described below. In other words, this 433 encoding depends directly on the smartphone 1 on which the application 2 is intended to be used.

[0081] Operation 431, encoding 432 and encoding 433 are merged so that they can no longer be distinguished from each other, and the corresponding truth table is definitively implemented in algorithm 43 as soon as application 2 is installed on smartphone 1. From then on, the initial elementary operation 431 can no longer be identified as such by an attacker. The next elementary operation of algorithm 43 is operation 436. It is merged with encoding 435 which is the inverse encoding of encoding 432. These two operations must also be merged with encoding 434 which is the inverse encoding of encoding 433. By construction, this inverse encoding 434 is necessarily also dependent on smartphone 1. However, unlike all the previous encodings, encoding 434 is not implemented in application 2, neither before nor after its installation. Indeed, it is generated only when these operations are executed. Encoding generation methods

[0082] We will now describe with reference to [Fig.3] an encoding generation method 10 for generating the dependent encoding 433. It is implemented within the framework of the installation of the application 2 within the smartphone 1.

[0083] It should be noted that the elementary operations with which the encodings are combined relate to data forming eight-bit vectors, i.e. 256 possible entries. Of course, this number can vary and be adjusted in order to balance the available resources with the desired security level.

[0084] In step 100, the program 2 requests to obtain characteristics specific to the smartphone 1, which are the MAC number (for “Media Access Control”), the IMEI number (for “International Mobile Equipment Identity”) and the telephone serial number. It also generates a fourth number which is a counter incremented each time the white box 4 is installed on the smartphone 1. These characteristics specific to the smartphone 1 are referred to as “fingerprints”. These calls are made by the code 2 using conventional “APIs” associated with the smartphone. These calls may have been previously authorized by the user when confirming the installation of the application 2. The specific characteristics may have been chosen differently.

[0085] In step 200, the fingerprints obtained are passed to a SHA256 type hash function, the hash function having been chosen so that the output corresponds to a substitution table of the same type as the truth table of conventional encodings. The hash function is also chosen so that a variation of one of the numbers provided generates at output a substitution table different. It is finally chosen so that this table can only be obtained by hashing the entered numbers and not by other numbers. Thus, this table, which therefore corresponds to an encoding dependent on smartphone 1, can only have been generated via smartphone 1. This internal encoding therefore makes it possible to anchor the white box on smartphone 1. In the case where the hash function is used to establish a dependent encoding matrix, it is necessary that this matrix be invertible, so as to be able to determine the inverse encoding.

[0086] In step 300, the dependent substitution table, or dependent encoding table, is applied to the truth table resulting from the encoding 432 (itself applied to the initial table 431).

[0087] In step 400, only the final truth table, resulting from the combination between the table associated with the initial operation 431, the encoding 432 and the dependent encoding 433, is stored in the executable code 2.

[0088] It should be noted that, instead of obtaining the characteristics directly from the peripheral 1 in step 100, these characteristics can be known in advance. In this case, steps 200 to 400 could be carried out outside the peripheral 1. It is thus possible to envisage implementing the 433 encoding in the algorithm before installing this algorithm in the peripheral 1.

[0089] We will now describe with reference to [Fig.4] an encoding generation method 20 for generating the dependent encoding 434. This is implemented only at each execution of the algorithm 43 on the peripheral 1, that is to say during the decryption of data.

[0090] In step 500, which is the first step in generating this encoding 434, the program 2 requests to obtain the characteristics specific to the smartphone 1, which are the MAC number (for “Media Access Control”), the IMEI number (for “International Mobile Equipment Identity”), and the serial number of the telephone. It also generates the counter starting at 0. Given that these calls are made on the same smartphone 1 as the one on which the calls of step 100 were made, and that the counter is chosen to start at the same stage, the same fingerprints are obtained.

[0091] In step 600, the same hash function as that of step 200 is applied to these numbers. This results in the same substitution table as that determined in step 200 of method 10.

[0092] In step 700, this table is reversed, with input and output replacing each other. This table is therefore the inverse of the table resulting from step 200. Data encoded using one of the tables could therefore be directly decoded using the other.

[0093] In step 800, this reverse table is merged with the encoding 435 and the table associated with the new elementary operation 436, so that only one table corresponding to these three operations is stored in the software implementation.

[0094] Now, the data resulting from operation 431 and encoded by internal encodings 432 and 433 can be decoded by internal decodings 434 and 435 at the same time as elementary operation 436 takes place.

[0095] Of course, it is possible to reverse the roles of the 433 and 434 encodings by generating the reverse 434 encoding at installation and the 433 encoding only at each decryption operation.

[0096] It should be noted that, in this mode of implementation, only operations 431 and 436 are associated with dependent encodings 433 and 434. The other elementary operations of algorithm 43 are only associated with conventional encodings, such as encodings 432 and 435, which do not depend on the smartphone 1 and are not generated when the decryption is executed, but are implemented upon installation (or even before). However, it may be advantageous to carry out dependent encodings for several of the operations of algorithm 43, in order to further improve the security of the method. On the other hand, it may not be necessary to carry out dependent encodings for all the elementary operations. Indeed, too many dependent encodings generated may cause excessive resource consumption during the decryption operation since each encoding to be generated in this context will have to be the subject of steps 500 to 800.The time spent executing algorithm 43 may also be increased.

[0097] Finally, in a variant with several dependent encodings, each operation of the algorithm 43 is associated with a conventional encoding, then some of these operations are, in addition, associated with dependent encodings such as encodings 433 and 434. It is the responsibility of the developer of the white box to identify the number and the position of the dependent encodings according to the desired degree of security and the resources of the planned peripheral.

[0098] Encryption, decryption, encoding and decoding of data

[0099] We will now describe a method 30 summarizing the data communication chain between the server 9 and the core 3 of the application 2 by means in particular of the methods 10 and 20.

[0100] Step 40 is the initialization of the communication channel. The white boxes 4 and 91, respectively within the smartphone 1 and the server 9, are installed when the application 2 is installed. The initial elementary operations of the algorithm 43, as well as the algorithm 91, are generated so that the algorithm 43 can decrypt data encrypted by the algorithm 91, and vice versa. In particular, in the context of the “AES” type algorithm, the private key is the same for the algorithms 43 and 91. The algorithms differ, however, in that the algorithm 91, placed on the server, does not include internal encryptions, as the server is considered a secure environment.

[0101] Steps 100 to 400 of the method 10 are then implemented. In particular, the dependent encoding 433 is generated at this time in the application 2 by means of the characteristics of the smartphone 1. This is also the case for the non-dependent encodings 432 and 435.

[0102] In step 50, the core 3 of the application 2 requires the sending of secret data from the server 9 located remotely. This concerns in particular validations of banking data to validate a payment.

[0103] In step 60, the server 9 encrypts the requested data using the algorithm 91.

[0104] In step 70, the encrypted data is encoded by the external encoding 92 located on the server 9.

[0105] In step 80, they are sent to the smartphone 1, in particular to the application 2, and in particular to the white box 4.

[0106] In step 90, encoding 41 at the input of the white box, which corresponds to the inverse of encoding 92, decodes the data. As a reminder, since it is merged with the following operation and encoding, this decoding is not understandable for an attacker.

[0107] Steps 500 to 800 described above, of method 20, are then carried out at the heart of the data decryption algorithm 43. In particular, the dependent encoding 434, inverse of the encoding 433, is generated only at the time of this decryption.

[0108] In step 810, once the 433 encoding has been generated, the data is decrypted and decoded.

[0109] In step 820, the still decrypted data is encoded again, this time using encoding 42.

[0110] In step 830, the decrypted and encoded data are communicated to the core 3 of the application.

[0111] At step 840, the external encoding 31, inverse of the encoding 42, decodes the data. Here again, its fusion with the subsequent operations of the core 3 does not allow it to be identified.

[0112] It should be noted that although the illustrated method is a decryption method, the encodings work in the same way for an encryption method. The encodings are then associated with elementary encryption rather than decryption operations.

[0113] The dependent internal encodings 433 and 434 therefore make it possible to anchor the white box on the smartphone 1. Thus, even if an external encoding, typically encoding 31, were to leak, that is to say to be identified by an attacker, the dependent encodings internal to the white box would provide additional security. Indeed, thanks to these dependent encodings 433 and 434, it is necessary to have smartphone 1 to execute the algorithm. Indeed, by executing it on a different device, the encoding 434 generated at the time of execution on this new device would not correspond to the encoding 433 dependent on smartphone 1, and the algorithm 43 as a whole would fail.

[0114] An attacker cannot therefore make the white box work on another device. Furthermore, unlike a signature or an identification token, these dependent encodings cannot be deleted by the attacker, because, given that they are merged into the elementary steps of the algorithm, they are fully part of the algorithm and any modification would cause the execution of the algorithm to fail.

[0115] An attack therefore only becomes feasible by means of a virtual machine aimed at falsifying the device's fingerprints. However, to do this, it is necessary to know the device very well, to the point that it is preferable to own it, making the creation of an appropriate virtual machine obsolete.

[0116] This method of dependent encodings internal to the white box depends on the developer of the white box and not on the developer of the final application. This is in line with the spirit of simplified security associated with the sale of "turnkey" white boxes to companies developing final applications. In particular, the latter's responsibility regarding the protection of external encodings is mitigated since the dependent encodings internal to the white box offer additional security.

[0117] Furthermore, the generation of a dependent encoding makes it easier to identify a leak. Indeed, since only the execution platform appropriate for the dependent encoding can make it possible to operate the algorithm, it is easier to identify the platform from which the leak originates. Thus, in the case of the illustrated embodiment, if the white box 4 were to leak, it would not operate on any device except on the smartphone 1, which would make it possible to determine that it originated from the smartphone 1.

[0118] The invention is not limited to the embodiments presented and other embodiments will become clear to those skilled in the art.

[0119] For example, other hash functions are possible. Furthermore, the specific characteristic is not limited to the examples provided but concerns any characteristic that can be extracted from a device and that is specific to this device. It also concerns any relevant combination of specific characteristics allowing to further isolate a device from others.

[0120] Furthermore, the invention makes it particularly relevant to dispense with external encodings, which in the illustrated embodiment are encodings 92 and 31. In this case, encodings 41 and 42 are also removed. This is particularly relevant with regard to external encoding 31, the implementation and protection of which must be ensured by the developer of the final application 2, which contravenes the simplified security principle sold with the white box 4. However, given that the dependent encodings make it possible to anchor the white box on the peripheral as the external encodings aim to do, the latter become superabundant and can be removed. In this case, any attack of the white box code porting type remains delicate given the dependent encodings, and the developer of the final application no longer has to ensure the security of an encoding.On the other hand, in this case, the data circulates in clear, that is to say in a decrypted manner, between the decryption algorithm and the final application.

[0121] It is possible to integrate internal encodings into the algorithm 91 so as to improve its security. In addition, it is possible to integrate, as in the white box 43, encodings dependent on the algorithm 91 of the server, to further improve its security and facilitate the identification of a possible leak of this white box 91. This is, however, generally less essential than for an algorithm operating on a mobile device, where security is more questionable.

[0122] It is possible to integrate dependent encodings into cryptographic algorithms other than the “AES” type algorithm. This is for example the case for the “DES” algorithm (for “Data Encryption Standard”). More generally, each algorithm that can be encoded can be the subject of the dependent encodings of the invention. This is particularly the case for encryption or decryption methods divided into elementary operations that can be encoded.

Claims

Claims

1. Method (10, 20) for generating encoding for a cryptographic algorithm, implemented by computer, characterized in that the following steps are implemented: before any cryptographic execution of a cryptographic algorithm on a computer peripheral (1) configured to execute this cryptographic algorithm (43): - obtaining (100) at least one characteristic specific to the peripheral (1); - from the specific characteristic, generation (200) of a first encoding operation (433) dependent on the peripheral (1); - association (300, 400) of the first dependent encoding operation generated with the cryptographic algorithm; then, during a cryptographic execution of the algorithm on the peripheral: - obtaining (500) the characteristic specific to the peripheral;- from the specific characteristic, generation (600) of a second encoding operation (434) dependent on the peripheral (1), this second encoding operation being generated so that data encoded via the first dependent encoding operation (433) is decoded via the second dependent encoding operation (434); - association (700, 800) of the generated second dependent encoding operation with the cryptographic algorithm.;

2. Method (10, 20) according to the preceding claim, in which, to associate at least one of the dependent encoding operations (433, 434) with the algorithm, the encoding operation (433, 434) is combined with a cryptographic elementary operation (431, 436) of the algorithm so as to form a single merged operation, so that a data item processed by the merged operation is operated in accordance with the cryptographic elementary operation (431, 436) and simultaneously encoded in accordance with the dependent encoding operation (433, 434).

3. A method (10) according to any preceding claim, in which the first encoding operation is associated with an installation (40) of the algorithm on the peripheral, and in which the cryptographic execution corresponds in particular to a data encryption or decryption operation.

4. Method (10, 20) according to claim 2, in which the cryptographic elementary operation (431) is a first cryptographic elementary operation and the merged operation is a first merged operation, the algorithm (43) also comprising a second cryptographic elementary operation (436) directly following the first cryptographic elementary operation, the following steps are implemented: - Combination (10), before any cryptographic execution of the algorithm on the peripheral, of the first dependent encoding operation (433) with the first elementary cryptographic operation (431) so as to form the first merged operation; - Combining (20), during the cryptographic execution of the algorithm on the peripheral, the second dependent encoding operation (434) with the second elementary operation (436), so as to form a second merged operation, so that, when the data encoded and operated by the first merged operation is processed by the second merged operation, it is decoded in accordance with the second dependent encoding operation (434) and simultaneously operated in accordance with the second cryptographic elementary operation (436).

5. Method (10, 20) according to the preceding claim, in which the following steps are further implemented: - prior to the steps of claim 1, generation (40) of a third encoding operation (432), not dependent on the peripheral (1), and of a fourth encoding operation (435), not dependent on the peripheral and generated so that data encoded via the third encoding operation (432) is decoded via the fourth encoding operation (435), - before any cryptographic execution of the algorithm (43), combining the third encoding operation (432) with the first merged operation, so as to form a new first merged operation allowing simultaneously to encode the data in accordance with the first encoding operation (433) and the third encoding operation (432) and to operate the data in accordance with the first elementary operation (431); - during the cryptographic execution (810), combining the fourth encoding operation (435) with the second merged operation, so as to form a new second merged operation allowing simultaneously to decode the data in accordance with the second encoding operation (434) and the fourth encoding operation (435) and to operate the data in accordance with the second elementary operation (436).

6. Method (10, 20) for generating encoding according to one of claims 4 and 5, in which the first (431) and the second (436) elementary cryptographic operation forming a pair of encoded operations, the steps of generating and combining encodings are repeated for at least one other pair of encoded operations of the algorithm (43), preferably for several pairs.

7. Method (10, 20) according to any one of the preceding claims, in which the cryptographic algorithm is of type “A ES”, for “Advanced Encryption Standard” or “DES” for “Data Encryption Standard”.

8. Method (10, 20) according to any one of the preceding claims, wherein the characteristic specific to the device (1) obtained is one of the following characteristics or a combination of at least some of the following characteristics: - the MAC (for "Media Access Control") number of the device; - the IMEI (for "International Mobile Equipment Identity") number of the device; - the serial number of the device; - a counter of a number of installations of a cryptographic algorithm within the device.

9. Method (10, 20) according to any one of the preceding claims, wherein the generation of at least one of the dependent encoding operations (433, 434) of the device (1) comprises a step of hashing (200, 600) the characteristic(s) specific to the device (1), so as to generate a device-dependent encoding table or a device-dependent encoding matrix, at least one of the elements of the table or respectively of the matrix being derived from the hashing.

10. Method (10, 20) according to at least the preceding claim and claim 2, wherein, to combine at least one of the dependent encoding operations (433, 434) with the elementary cryptographic operation (431, 436), the terms of a truth table corresponding to the elementary operation are substituted by means of the generated substitution table, so as to form a merged table corresponding to the merged operation, or a mathematical operation is carried out between a matrix corresponding to the elementary operation and the generated dependent encoding matrix, so as to form a merged matrix corresponding to the merged operation.

11. Cryptography method (30), in which at least one data item is encrypted or decrypted on a computer peripheral (1) by a cryptographic algorithm (43) and the data item is encoded by at least one encoding operation (433, 434) associated with the algorithm, the encoding operation (433, 434) being dependent on at least one characteristic specific to the peripheral (1), characterized in that the encoding operation (433, 434) has been previously associated with the cryptographic algorithm (43) in accordance with any one of claims 1 to 10.

12. A computer program (2) comprising instructions which, when the program is executed by a computer, cause the computer to implement the steps of the method according to any one of claims 1 to 11.

13. A computer-readable recording medium comprising instructions which, when executed by a computer, cause the computer to carry out the steps of the method according to any one of claims 1 to 11.

14. Computer peripheral (1) comprising computer computing means capable of executing a cryptographic algorithm associated with an encoding operation generated in accordance with any one of claims 1 to 11.