AUTHENTICATION OF A CARD BY CONTACTLESS READING
20170353312 · 2017-12-07
Inventors
Cpc classification
H04L9/3234
ELECTRICITY
G06K7/10297
PHYSICS
H04L9/0631
ELECTRICITY
H04L2209/046
ELECTRICITY
International classification
H04L9/32
ELECTRICITY
G06Q20/40
PHYSICS
G06K7/10
PHYSICS
H04L9/06
ELECTRICITY
G06Q20/10
PHYSICS
Abstract
The invention relates to a method of authentication of a contactless communication circuit, PICC, by a contactless communication terminal, PCD. Within the PCC, a first number is generated and without encryption, transmitted to the PCD. Within the PCD a second number is determined by decryption of the first number with a first key. The determination of a third number is based on the second number, and the determination of a fourth number is by encryption of the third number with the first key. Decryption of the fourth number with the first key to obtain the third number and an interruption of the authentication if a sixth number obtained from the third number is different from a seventh number, is performed by the PICC.
Claims
1. A method, comprising: authenticating a contactless communication circuit using a contactless communication terminal by successively performing a first phase, a second phase, and a third phase, wherein the first phase includes: determining by the contactless communication circuit a first number; and transmitting the first number from the contactless communication circuit to the contactless communication terminal, said transmitting the first number ending the first phase; wherein the second phase includes: performing a decryption operation with the contactless communication terminal to determine a second number the decryption operation decrypting with a first key, the first number; determining, with the contactless communication terminal, a third number based on the second number; and performing an encryption operation with the contactless communication terminal to determine a fourth number, the encryption operation encrypting with the first key, the third number; and transmitting the fourth number from the contactless communication terminal to the contactless communication circuit, said transmitting the fourth number ending the second phase; and wherein the third phase includes: performing a decryption operation with the contactless communication circuit, the decryption operation decrypting the fourth number with the first key to obtain the third number; and interrupting the authenticating by the contactless communication circuit if a sixth number obtained from the third number is different from a seventh number.
2. The method of claim 1, wherein at the first phase, no encryption operations using the first key are performed.
3. The method of claim 2, comprising: performing a decryption operation with the contactless communication circuit to determine an eighth number the decryption operation decrypting with the first key, the first number; and determining, with the contactless communication circuit, the seventh number based on the eighth number.
4. The method of claim 2, comprising, at the first phase, determining a ninth number, the ninth number being random and unencrypted.
5. The method of claim 4, wherein, in the first phase, the first number is equal to the ninth number.
6. The method of claim 2, comprising: at the first phase, determining a ninth number, the ninth number being random; at the first phase, performing an encryption operation by the contactless communication circuit, the encryption operation encrypting with a second key, the ninth number, wherein the second key is different from the first key, wherein the second key has a same size as the first key, wherein the encryption algorithm using the second key is a same encryption algorithm as the encryption algorithm using the first key.
7. The method of claim 2, comprising: at the first phase, performing an encryption operation by the contactless communication circuit to obtain the first number, the encryption operation encrypting with a third key, a tenth non-random number, wherein the third key is random, wherein the third key has a same size as the first key, wherein the encryption algorithm using the third key is a same encryption algorithm as the encryption algorithm using the first key.
8. The method of claim 1, comprising: at the first phase, randomly performing with the contactless communication circuit: a) an encryption operation to obtain the first number, the encryption operation encrypting with the first key, a ninth number, the ninth number being a random number; and b) determining whether or not the first number is equal to the eighth number.
9. The method of claim 8, comprising: performing a decryption operation with the contactless communication circuit to determine an eighth number, the decryption operation decrypting with the first key, the first number; determining, with the contactless communication circuit, the seventh number based on the eighth number; at a), determining the eighth number as being equal to the ninth number; and at b), performing an encryption operation using a fourth key, wherein the fourth key is different from the first key, wherein the fourth key has a same size as the first key, wherein the encryption algorithm using the fourth key is a same encryption algorithm as the encryption algorithm using the first key.
10. The method of claim 9, comprising: at the third phase, performing with the contactless communication circuit: c) after a) is carried out, performing a decryption operation using a fifth key, wherein the fifth key is different from the first key, wherein the fifth key has a same size as the first key, wherein a decryption algorithm using the fifth key is a same encryption algorithm as the encryption algorithm using the first key; and d) after b) is carried out, performing a decryption operation to determine the eighth number, the decryption operation decrypting with the first key, the first number.
11. The method of claim 1, comprising: at the first phase, determining a ninth number, the ninth number being a random number; at the first phase, successively testing whether or not a Boolean variable is true or false; if the Boolean variable is true, performing with the contactless communication circuit an encryption operation to obtain the first number, the encryption operation encrypting with the first key, the ninth number; and if the Boolean variable is false, reusing by the contactless communication circuit a last determined value of the first number and setting the Boolean variable to false.
12. The method of claim 11, comprising: at the third phase, if the sixth number obtained from the fourth number is equal to the seventh number, setting, by the contactless communication circuit, the Boolean variable to true.
13. The method of claim 1, comprising: at the second phase, determining, with the contactless communication terminal, an eleventh number, the eleventh number being random; and at the second phase, determining, with the contactless communication terminal, a twelfth number, the twelfth number based on the second number, wherein the third number corresponds to a juxtaposition of the eleventh number and of the twelfth number.
14. The method of claim 1, comprising: at the third phase, performing with the contactless communication circuit: a determination of a thirteenth number, the thirteenth number based on the third number; an encryption operation to determine a fourteenth number, the encryption operation encrypting the thirteenth number with the first key; and transmitting the fourteenth number from the contactless communication circuit to the contactless communication terminal, wherein the third phase ends with the transmission of the fourteenth number.
15. A contactless communication circuit, comprising: a wireless communication circuit arranged to detect and electromagnetically exchange information with a contactless communication terminal when the contactless communication circuit is in proximity of the contactless communication terminal; and a microprocessor programmed to generate the information sent to the contactless communication terminal and analyze the information received from the contactless communication terminal in at least three phases, wherein generating and analyzing in a first phase includes: determining by the contactless communication circuit a first number; and transmitting the first number from the contactless communication circuit to the contactless communication terminal, said transmitting the first number ending the first phase; wherein the second phase includes: receiving, from the contactless communication terminal, a fourth number, the fourth number being a result of an encryption operation that encrypted a third number with the first key, wherein the third number is a result of a decryption operation of a second number, said receiving the fourth number ending the second phase; and wherein the third phase includes: performing a decryption operation with the contactless communication circuit, the decryption operation decrypting the fourth number with the first key to obtain the third number; and interrupting the third generating and analyzing by the contactless communication circuit if a sixth number obtained from the third number is different from a seventh number.
16. The contactless communication circuit of claim 15, wherein the first phase, the second phase, and the third phase are successively performed a plurality of times.
17. The contactless communication circuit of claim 15, wherein the wireless communication circuit conforms to a near field communications (NFC) protocol.
18. A multiphase authentication method between a wireless terminal and a wireless device, comprising: transmitting a first number from the wireless device to the wireless terminal; performing a decryption operation with the contactless communication terminal to determine a second number, the decryption operation decrypting with a first key, the first number; determining, with the contactless communication terminal, a third number based on the second number; performing an encryption operation with the contactless communication terminal to determine a fourth number, the encryption operation encrypting with the first key, the third number; transmitting the fourth number from the contactless communication terminal to the contactless communication circuit; performing a decryption operation with the contactless communication circuit, the decryption operation decrypting the fourth number with the first key to obtain the third number; and asserting an error condition by the contactless communication circuit if a sixth number obtained from the third number is different from a seventh number.
19. The multiphase authentication method between the wireless terminal and the wireless device of claim 18, wherein the first number transmitted from the wireless device to the wireless terminal is not encrypted using the first key.
20. The multiphase authentication method between the wireless terminal and the wireless device of claim 18, wherein the data communicated between the wireless terminal and the wireless device conforms to a near field communications (NFC) protocol.
Description
BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS
[0035] Non-limiting and non-exhaustive embodiments are described with reference to the following drawings, wherein like labels refer to like parts throughout the various views unless otherwise specified. One or more embodiments are described hereinafter with reference to the accompanying drawings. The foregoing and other features and advantages will be discussed in detail in the following non-limiting description of specific embodiments in connection with the accompanying drawings, among which:
[0036]
[0037]
[0038]
[0039]
[0040]
DETAILED DESCRIPTION
[0041] The same elements have been designated with the same reference numerals in the different drawings. For clarity, only those elements which are useful to the understanding of the described embodiments have been shown and are detailed. In particular, the exchanges between the proximity coupling device and a proximity integrated circuit once the authentication operation has been performed have not been detailed, the described embodiments being compatible with usual exchanges. Unless otherwise specified, expressions “approximately”, “substantially”, and “in the order of” mean to within 10%, preferably to within 5%.
[0042] Embodiments have been described by taking as an example a contactless card forming a proximity integrated circuit card (PICC) and a contactless reader forming a proximity coupling device (PCD). They however more generally apply to any device used as a proximity coupling device and to any contactless communication integrated circuit where similar problems are posed.
[0043]
[0044] A contactless communication terminal 10 or proximity reader (READER) generates an electromagnetic field. A contactless card 12 (CARD) located within the range of the reader detects the field and is then capable of exchanging information with reader 10.
[0045] Card 12 may host one or a plurality of applications. As an example, these applications may use a technology known as MIFARE. The application to be executed by the card may depend on the reader with which it communicates. Indeed, a reader is generally dedicated to an application (for example, bank, transport, access control, etc.) and the activation of a card in the field of the reader depends on the protocol accepted by the card.
[0046] The MIFARE® technology has different variations, particularly the MIFARE® DESFIRE® or MIFARE PLUS® variations. MIFARE®, MIFARE® DESFIRE® and MIFARE PLUS® are registered trademarks of NXP B.V. in the USA. Such variations differ, in particular, by the implemented encryption methods. According to an example, the encryption method corresponds to a symmetrical encryption algorithm, for example, the AES algorithm (Advanced Encryption Standard) or the DES algorithm (Data Encryption Standard) using one key, two keys, or three keys for the encryption.
[0047]
[0048] The method of authenticating the PICC card starts when the reader has detected the presence of the card and wants to authenticate the card. Other commands can be sent before the beginning of the authentication. The authentication method comprises successive phases S1, S2, S3, and S4, each comprising successive steps.
[0049] The PCD and PD share the knowledge of a number of key values. At phase S1, the reader (PCD) selects a key (step 20) and transmits its identifier Id.sub.k to the card (PICC) with an authentication control signal. The length of key k especially depends on the implemented encryption algorithm. As an example, the length of the key may be 8, 16, or 24 bits.
[0050] The card generates a random number R.sub.b of length RL (step 22). Length RL of random number R.sub.b depends on the implemented encryption algorithm. As an example, length RL may be 8 or 16 bits. The card then determines an encrypted message A.sub.1 by encryption of random number R.sub.b by using key k with identifier Id.sub.k (step 24) and transmits encrypted message A.sub.1 to the reader.
[0051] At phase S2, the reader decrypts encrypted message A.sub.1 by using the same key k and obtains a random number R.sub.b.sub._.sub.pcd. (step 26). The reader then determines a random number R′.sub.b.sub._.sub.pcd (step 28) based on random number R.sub.b.sub._.sub.pcd by left rotating, in binary representation, the bits of random number R.sub.b.sub._.sub.pcd by a plurality of bits, for example, 8 bits. The reader generates a new random number R.sub.a.sub._.sub.pcd of length RL (step 30). The reader determines a message R.sub.a.sub._.sub.pcd∥R′.sub.b.sub._.sub.pcd by concatenation of random number R.sub.a.sub._.sub.pcd and of random number R′.sub.b.sub._.sub.pcd and determines an encrypted message B.sub.1 by encryption of message R.sub.a.sub._.sub.pcd∥R′.sub.b.sub._.sub.pcd by using key k (step 32) and transmits encrypted message B.sub.1 to the card.
[0052] At phase S3, the card decrypts encrypted message B.sub.1 by using key k to obtain message R.sub.a.sub._.sub.pcd∥R′.sub.b.sub._.sub.pcd (step 36). The card then determines a random number R′.sub.b (step 38) based on random number R.sub.b by left rotating, in binary representation, the bits of random number R.sub.b by a plurality of bits, for example, 8 bits. The card compares random numbers R′.sub.b.sub._.sub.pcd and R′.sub.b (step 40). If the two random numbers R′.sub.b.sub._.sub.pcd and R′.sub.b are not identical, the card interrupts the authentication operation, which fails (step 42). This corresponds to the authentication of the PCD by the PICC. If the two random numbers R′.sub.b.sub._.sub.pcd and R′.sub.b are identical, the card then determines a random number R′.sub.a (step 44) based on random number R.sub.a.sub._.sub.pcd by left rotating the bits of random number R.sub.a.sub._.sub.pcd by a plurality of bits, for example, by 8 bits. The card determines an encrypted message A.sub.2 by encryption of random number R′.sub.a by using key k (step 46) and transmits encrypted message A.sub.2 to the reader.
[0053] At phase S4, the method may comprise additional steps (step 48), particularly the authentication of the PICC by the PCD by verification of the A.sub.2 message, determination of a session key used for subsequent operations of encryption and decryption by the reader and the card. The session key may be obtained from random number R.sub.a and R.sub.b.
[0054] For methods of card authentication by contact reading, it is known to provide the counting by the card of the number of unsuccessful authentication attempts and to stop the authentication operation when the number of unsuccessful attempts exceeds a threshold. However, the counting by the card of the number of unsuccessful attempts, which is a time-consuming operation, is generally not provided during a contactless card authentication method. Indeed, a person holding a fraudulent PCD close to the PICC could send invalid authentications until the card is blocked. For technologies that do not provide an unblocking mechanism, that leads to a permanent destruction of the card. Moreover, since data exchanges between the card and the reader only occur during the short time for which the card is close to the reader, the authentication operation should be as fast as possible. An attacker may thus carry out as many authentication attempts as he/she wants.
[0055] A weakness of the previously-described authentication method is that an attacker can repeat the previously-described steps carried out by the card at phase S1 of the same key k. Each time, a new random number R.sub.b and a new encrypted message A.sub.1 are determined. The analysis of a limited number of side channel attack traces and the obtained encrypted messages A.sub.1 enables to considerably reduce the key space of possible keys k without then requiring to execute for each repetition the other phases of the authentication method. The fact that the PD generates new random numbers provides the attacker with an interesting distribution of traces. The attacker may then carry out a brute force attack on the reduced key space. The attacker knows that the attack has succeeded when the comparison performed by the card at step 40 of phase S3 does not result in a failure.
[0056] Another weakness of the previously-described authentication method is that the encrypted message B.sub.1 used by the card at phase S3 may be imposed by the attacker. An attacker can thus repeat decryption step 36 as many times as desired imposing an encrypted message B.sub.1 of its choice, taking side channel attack traces. However, an attack using this weakness takes more time since the steps of phases S1 and S2 have to be carried out before each attempt.
[0057] Embodiments of an authentication method will be described where the steps executed at phase S1 by the card are modified to prevent an attacker from using these steps to obtain sufficient information relative to key k. The previously-described weakness relative to the steps carried out by the card at phase S1 can then no longer be used by an attacker.
[0058]
[0059] According to a variation, the present embodiment previously-described step 50 is replaced with a step of determining encrypted message A.sub.1 by encryption of the random number by using a dummy key different from key k.
[0060] According to another variation, at step 50, encrypted message A.sub.1 is obtained by encryption of a given number, for example, 0, with a key equal to a random number of length RL.
[0061] The previously-described weakness relative to the steps carried out by the card at phase S1 can no longer be used by an attacker since these steps no longer comprise an encryption step using key k.
[0062]
[0063] More specifically, the embodiment of the authentication method comprises the steps of the authentication method previously described in relation with
[0064] The present embodiment of the authentication method further comprises, at phase S3, before step 36, the additional steps 70, 72, and 74 described hereafter. The card compares random bit c with “0” (step 70). If bit c is equal to “0”, that is, when step 66 has been executed at phase S1, the card executes a decryption operation by assigning to A.sub.1 the result of a decryption of random number R.sub.1 by using a dummy key different from key k (step 72). The result of this decryption is not used, but assures that using a side channel attack, the case in which c is equal to “1” provides the same trace as the case in which c is equal to “0”.
[0065] If bit c is equal to “0”, that is, when step 68 has been executed at phase S1, the card determines random number R.sub.b by decryption of number A.sub.1 by using key k (step 74).
[0066] The above-described weakness relative to the steps carried out by the card at phase S1 can no longer be used by an attacker since these steps no longer comprise an encryption step using key k. Further, an encryption step is always performed at phase S1 and a decryption step is always performed at phase S2, even if these steps are not necessarily useful according to the value of bit c. This enables to prevent a side channel attack since an attacker cannot tell useful encryption/decryption steps from non-useful ones.
[0067]
[0068] More specifically, the present embodiment of the authentication method comprises the steps of the authentication method previously described in relation with
[0069] With the present embodiment, an encryption step at phase S1 can only be performed by the card if the previous authentication procedure has occurred correctly. An attack where phase S1 would be repeated without however resulting in a successful authentication, particularly to determine information relative to key k, would not cause, each time phase S1 is repeated, the carrying out of a new encryption step, which limits the useful information that the attacker may expect to recover.
[0070] An encryption/decryption operation is made by using at least one encryption/decryption module. An encryption/decryption module has a cipher block length, BL, and is able to encrypt/decrypt messages of the same length as the cipher block length. For example, for the DES algorithm, BL can be 8 bits and for the AES algorithm, BL can be 16 bits. For messages that are longer than BL and corresponds to a multiple of BL, the encryption/decryption operation can be made by cipher block chaining (CBC). Another embodiment will now be described, which is adapted to the case where the encryption or decryption method used to determine encrypted messages A.sub.1 and B.sub.1 implements an operating mode by cipher block chaining (CBC).
[0071]
[0072] The operating mode is called block chaining mode since each number which is encrypted by a module corresponds to the result of the XOR function applied between the input number of the module and the encrypted message block provided by the previous module. As shown in
[0073]
[0074]
[0075]
[0076]
[0077]
[0078] In the present embodiment, at phase S3, additional steps are provided so that an attacker can no longer control the number used for an encryption or decryption operation.
[0079] More specifically, the embodiment of the authentication method comprises the steps of the authentication method previously described in relation with
[0080] As a variation, it is possible for steps 40 and 42 not to be present.
[0081] An attacker who desired to perform an attack at phase S3 may impose the encrypted message B.sub.1 used by the card at phase S3. However, the attacker does not have access to random number R′.sub.b. Since a XOR function is applied between random number R′.sub.b and a block of encrypted message B1, the attacker does not control the number used by the encryption modules during the encryption operation.
[0082] The previously-described embodiments are implemented on the card side and are transparent for the reader. They require no modification on the reader side. The cards thus formed (programmed) are thus compatible with existing readers.
[0083] Various embodiments have been described. Various alterations and modifications will occur to those skilled in the art. In particular, although the embodiments have been described in relation with a microcircuit card, they are compatible with a forming in any proximity communication device where similar problems are posed, for example, a cell phone equipped with a NFC router operating in card mode. Further, although the embodiments have been more specifically described in relation with an example of application to MIFARE transactions, they transpose to other applications where similar problems are posed. Further, the practical implementation of the described embodiments is within the abilities of those skilled in the art based on the functional indications given hereabove and by using or by programming circuits usual per se. In particular, a contactless integrated communication circuit to which these embodiments apply generally comprises at least one microprocessor, one or a plurality of volatile and non-volatile memory units, a proximity communication interface and, often, other circuits according to the hosted applications.
[0084] Various embodiments with different variations have been described hereabove. It should be noted that those skilled in the art may combine various elements of these various embodiments and variations without showing any inventive step. In particular, the embodiment previously described in relation with
[0085] The various embodiments described above can be combined to provide further embodiments. These and other changes can be made to the embodiments in light of the above-detailed description. In general, in the following claims, the terms used should not be construed to limit the claims to the specific embodiments disclosed in the specification and the claims, but should be construed to include all possible embodiments along with the full scope of equivalents to which such claims are entitled. Accordingly, the claims are not limited by the disclosure.