20
Keep your enemies close: Distance bounding against smartcard relay attacks DRAFT Saar Drimer Steven J. Murdoch http://www.cl.cam.ac.uk/users/{sd410, sjm217} University of Cambridge, Computer Laboratory 15 JJ Thomson Avenue, Cambridge CB3 0FD, United Kingdom February 17, 2007 Abstract Modern smartcards, capable of sophisticated cryptography, provide a high assurance of tamper re- sistance and are thus commonly used in payment applications. Although extracting secrets out of the smartcards requires resources beyond the means of many would-be thieves, the manner in which they are used can be exploited for fraud. Cardholders authorize financial transactions by presenting the card and disclosing a PIN to a terminal without any assurance as to the amount being charged or by whom, and have no means of telling whether the terminal is authentic or not. Even the most sophisticated smart- cards cannot protect customers from being defrauded by the simple relaying of data from one location to another. In this paper, we describe the development of such an attack, and show results from real-world experiments on the UK’s EMV implementation, Chip & PIN. We discuss previously proposed defences, and show that these cannot provide the required security assurances. Then, a new defence based on a distance bounding protocol is detailed and implemented. This defence requires only modest alterations to current hardware and software. As far as we are aware, this is the first complete design and implemen- tation of a distance bounding protocol. Future smartcard generations could use this design to provide cost-effective resistance to relay attacks, which is a practical threat to deployed applications. We also discuss the security-economics impact of enhanced authentication mechanisms. 1 Introduction Authentication provides the identity verification for, and of, communicating parties. Relay attacks, also known as wormhole attacks, allow an adversary to impersonate a participant during an authentication proto- col by extending the intended transmission range for which the system was designed for. Relay attacks have been known for since 1976 [9, p75] and are simple to execute as the adversary does not need to know the details of the protocol or break the underlying cryptography. A good example is a relay attack on proximity door-access cards demonstrated by Hancke in [12]. To gain access to a locked door, the adversary simply relays the challenges from the door to an authorized card, possibly some distance away, and sends the re- sponses back. The only restriction on the attacker is that the signals arrive at the door and remote card within the allotted time, which Hancke showed to be sufficiently liberal. Another, albeit apocryphal, example is the the “MiG-in-the-middle attack” against an Identify Friend or Foe (IFF) system described by Anderson in [3, p19]. Despite the existence of such attacks, systems susceptible to them are regularly being deployed. One 1

Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

Embed Size (px)

Citation preview

Page 1: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

Keep your enemies close:Distance bounding against smartcard relay attacks

DRAFT

Saar Drimer Steven J. Murdochhttp://www.cl.cam.ac.uk/users/sd410, sjm217

University of Cambridge, Computer Laboratory15 JJ Thomson Avenue, Cambridge CB3 0FD, United Kingdom

February 17, 2007

Abstract

Modern smartcards, capable of sophisticated cryptography, provide a high assurance of tamper re-sistance and are thus commonly used in payment applications. Although extracting secrets out of thesmartcards requires resources beyond the means of many would-be thieves, the manner in which theyare used can be exploited for fraud. Cardholders authorize financial transactions by presenting the cardand disclosing a PIN to a terminal without any assurance as to the amount being charged or by whom,and have no means of telling whether the terminal is authentic or not. Even the most sophisticated smart-cards cannot protect customers from being defrauded by the simple relaying of data from one location toanother. In this paper, we describe the development of such an attack, and show results from real-worldexperiments on the UK’s EMV implementation, Chip & PIN. We discuss previously proposed defences,and show that these cannot provide the required security assurances. Then, a new defence based on adistance bounding protocol is detailed and implemented. This defence requires only modest alterationsto current hardware and software. As far as we are aware, this is the first complete design and implemen-tation of a distance bounding protocol. Future smartcard generations could use this design to providecost-effective resistance to relay attacks, which is a practical threat to deployed applications. We alsodiscuss the security-economics impact of enhanced authentication mechanisms.

1 Introduction

Authentication provides the identity verification for, and of, communicating parties. Relay attacks, alsoknown as wormhole attacks, allow an adversary to impersonate a participant during an authentication proto-col by extending the intended transmission range for which the system was designed for. Relay attacks havebeen known for since 1976 [9, p75] and are simple to execute as the adversary does not need to know thedetails of the protocol or break the underlying cryptography. A good example is a relay attack on proximitydoor-access cards demonstrated by Hancke in [12]. To gain access to a locked door, the adversary simplyrelays the challenges from the door to an authorized card, possibly some distance away, and sends the re-sponses back. The only restriction on the attacker is that the signals arrive at the door and remote card withinthe allotted time, which Hancke showed to be sufficiently liberal. Another, albeit apocryphal, example is thethe “MiG-in-the-middle attack” against an Identify Friend or Foe (IFF) system described by Anderson in [3,p19]. Despite the existence of such attacks, systems susceptible to them are regularly being deployed. One

1

Page 2: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

significant reason is that designers consider relay attacks to be too difficult and costly for attackers to deploy.Section 3 aims to show that relay attacks are indeed practical, using the UK’s EMV payment system, Chip& PIN, as an example. These flaws are demonstrated by an implementation of the relay attack that has beentested on real systems.

Once designers appreciate the risk, the next step in building a secure system is to develop defences.Section 4 describes potential countermeasures to the relay attacks and compares their cost and effectiveness.While some, which depend on procedural changes, could be deployed quickly and act as an interim measure,none of the conventional technologies meet our requirements of high security at low cost. So we proposean extension to the smartcard standard, based on a distance bounding protocol, which provides adequateresistance to the relay attack, requiring minimal changes to smartcards.

Section 5 describes this countermeasure and its relationship with prior work, details a circuit designand evaluates its performance and security properties. We have implemented the protocol on an FPGA andshown it to be an effective defence against very capable adversaries. In addition, the experience of bothusers and merchants is unchanged, a significant advantage over the other proposals we discuss. The impactof this protocol on the fraud liability landscape is discussed in Section 6.

Our contributions include the description of the practicalities of relay attacks and showing that deployedsystems are vulnerable to them. By designing and testing a prototype system for demonstrating this vulner-ability, we show that the attack is feasible and an economically viable threat. Also, we detail the design ofa smartcard-based distance bounding protocol, discuss implementation issues and present results from bothnormal operation and under simulated attacks. While papers have previously discussed distance boundingprotocols, to the best of our knowledge, this is the first case it has been implemented in practice.

2 Background

Contact smartcards, also known as integrated circuit cards (ICC), that are discussed in this paper are de-fined by ISO 7816 [14]. The smartcard consists of a sheet of plastic with an integrated circuit, normally aspecialised microcontroller, mounted on the reverse of a group of eight contact pads. Current smartcardsuse only five of these: ground, power, reset, clock are inputs supplied by the reader, and an additional bi-directional asynchronous serial I/O signal over which the card receives commands and returns its response.Smartcards are designed to operate at clock frequencies between 1 and 5 MHz, with the data rate, unlessspecified otherwise, of 1/372 of that frequency.

Upon insertion of a smartcard, the terminal first supplies the power and clock followed by de-assertionof reset. The card then responds with an Answer-to-Reset (ATR) response, selecting which protocol optionsit supports, including endianness and polarity, flow control, error correction and data rate. All subsequentcommunications are initiated by the terminal and consist of a four byte header command with an optionalvariable-length payload.

2.1 Payment environment

There are four parties in the basic payment model:

Cardholder who wishes to purchase the goods or service.

Merchant who supplies the goods or service and controls the payment terminal.

Issuer bank, in a contractual relationship with the cardholder and who issues their card.

Acquirer bank, in a contractual relationship with the merchant.

2

Page 3: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

To initiate a transaction, the cardholder presents the merchant with his or her card, and agrees to makethe payment in exchange for goods or services. The merchant validates that the card is authentic and that thecardholder is authorized to use it, and then sends the transaction details to the acquirer. The acquirer requeststransaction authorization from the issuer, over a payment system network (e.g. Mastercard or Visa). If theissuer accepts the transaction, this response is sent back to the merchant via the acquirer and the cardholderis given the good or service. Later, the payment is transferred from the cardholder’s account at the issuer tothe merchant’s account at the acquirer.

In reality, payment systems slightly differ from this simplified description. For this paper’s purpose, onenotable difference is that the merchant may skip the step of contacting the acquirer to verify the transaction.This communication is ordinarily done via dial-up connection, so each authorization request incurs a cost.Thus, for low-risk transactions it may not be necessary to go online. Also, if the merchant’s terminal cannotmake contact with the acquirer, due to the phone line being busy or other technical failure, the merchantmay still decide to avoid losing the sale, and nevertheless accept the transaction.

2.2 Smartcard applications

State-of-the-art smartcards are capable of both symmetric and asymmetric cryptography, have several hun-dreds of KB of non-volatile tamper resistant memory, and through secure operating systems may supportmultiple, mutually un-trusting, applications. Although the potential applications are many, they are mostcommonly used for authentication of the holder, and more specifically for debit and credit card paymentsystems, where less sophisticated smartcards are used.

Smartcards carry advantages in all three authorization processes discussed above, namely:

Card authentication: the card was issued by an acceptable bank, is still valid and the account details havenot been modified

Cardholder verification: the customer presenting the card is authorized to use it

Transaction authorization: the customer’s account has adequate funds for the transaction.

EMV [11], named after its creators, Europay, Mastercard and Visa, is the primary protocol for debitand credit card payments in Europe, and is known by a variety of different names in the countries where itis deployed (e.g. “Chip & PIN” in the UK). While the following section will introduce the EMV protocol,other payment systems are similar.

In its non-volatile memory, the smartcard may hold account details, cryptographic keys, the cardholder’spersonal identification number (PIN) and a count of how many consecutive times the PIN has been incor-rectly entered.

Cards capable of asymmetric cryptography can cryptographically sign account details under the card’sprivate key to perform card authentication. The merchant’s terminal can verify the signature with a publickey which is stored on the card along with a certificate signed by the issuer whose key is, in turn, signed bythe operator of the payment system network. This method is known as dynamic data authentication (DDA)or the variant, combined data authentication (CDA).

As the merchants are not trusted to be given the symmetric keys held by the card, which would enablethem to produce forgeries, cards that are only capable of symmetric cryptography cannot be reliably authen-ticated offline. However, the card can still hold a static signature of account details and certificate chain. Theterminal can authenticate the card by checking this signature, known as static data authentication (SDA),but the lack of freshness allows replay attacks to occur.

Cardholder verification is commonly performed by requiring that the cardholder enter their PIN into themerchant’s terminal. The PIN is sent to the card which then checks if there have been too many consecutive

3

Page 4: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

incorrect guessing attempts; if not, it checks if the PIN was entered correctly. If the terminal or card does notsupport PIN verification, or the cardholder declines to enter it, the merchant may allow signature verification,or in unattended terminal scenarios, no authentication at all.

The card may hold a history of transactions since it was last verified online and evaluate, based onpre-set criteria, the risk of a authorizing further transactions offline; otherwise, the card can request onlineauthorization. In both cases, the card’s symmetric keys are used to produce a transaction certificate which isverified by the issuer. Merchants may also force a transaction to be online.

2.3 Security goals and threat model

The full threat model of EMV incorporates risk management protocols where the card and terminal negotiatedifferent methods of authenticating cardholders and the conditions for online or offline verification. Thisdecision is reached by considering the transaction value and type (cash-back or goods), the card’s recordof recent offline transactions and both the card’s issuer and merchant’s risk perception. This complexityand other features of EMV manage the reality of all parties mistrusting all others (to varying extents) but,although interesting, this is outside the scope of the paper (further details can be found in [11, book 2]).

Instead, we assume that the merchant, the banks and customers are honest. We also exclude physicalattacks, exploits of software vulnerabilities on both the smartcard and terminal as well as attacks on theunderlying cryptography. Other weaknesses of the EMV system are known, such as replay attacks on SDAcards as discussed above, and fallback attacks which force use of the magnetic stripe which is still presenton smartcards for backwards compatibility. These weaknesses have already been covered elsewhere [2] andare anticipated to be resolved by eventually disabling these legacy features.

The goal of the attacker is to gain access to goods or services by charging an unwitting victim whothinks she is paying for something different, at an attacker controlled terminal.

3 Relay attack

Relay attacks were first described by Conway [9, p75], explaining how someone who does not know therules of chess could beat a Grandmaster. This is possible by challenging two Grandmasters at postal chessand relaying moves between them. While appearing to play a good game, the attacker will either win againstone, or draw against both. Desmedt et al. [10] showed how such relay attacks could be applied against achallenge-response authentication protocol for payment, in the so called “mafia fraud”.

In the mafia-fraud, which we will use in this paper, as shown in Figure 1, an unsuspecting restaurantpatron, Alice, inserts her smartcard into a terminal in order to pay the £20 charge. The terminal looks justlike any one of the numerous types of terminals she has used in the past. This particular terminal, however,has had its original circuitry replaced by the waiter, Bob, and instead of being connected to the bank, it isconnected to a laptop placed behind the counter. As Alice inserts her card into the counterfeit terminal, Bobsends a message to his accomplice, Carol, who is about to pay £2 000 for a diamond ring at a jewellery shopacross town. Into Dave’s terminal, Carol inserts a counterfeit card that looks legitimate to Dave the jeweller,but cleverly conceals a wire connected to a laptop in her backpack.

Bob and Carol’s laptops are communicating wirelessly using mobile-phones or other network. Thedata to and from Dave’s terminal is relayed to the restaurant’s counterfeit terminal such that the diamondpurchasing transaction is placed on Alice’s card. The PIN entered by Alice is recorded by the counterfeitterminal and is sent, via a laptop and wireless headset, to Carol who enters it into the genuine terminal.When the transaction is over, the crooks have stolen a diamond ring from Alice who got her meal for free,but will be surprised when her bank statement arrives.

Despite the theoretical risk being well known in the literature, EMV is vulnerable to the relay attack,

4

Page 5: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

Bob

CarolAlice

Dave

£

£2,000

PIN

PIN

£20

Attacker controlled

Attacker controlled

Figure 1: The EMV relay attack. Innocent customer, Alice, pays for lunch by entering her smartcard andPIN into a modified terminal operated by Bob. At approximately the same time, Carol enters her fakecard into honest Dave’s terminal to purchase a diamond. The transaction from Dave’s terminal is relayedwirelessly to Alice’s card with the result of Alice unknowingly paying for Carol’s diamond.

as mentioned in [2]. Some believed that engineering difficulties in deploying the attack would prevent itfrom being cost effective. The following section will show that equipment to implement the attack is readilyavailable and costs are well within the expected returns of fraud.

3.1 Implementation

This section describes the equipment we used for implementing the relay attack. We chose off-the-shelfcomponents that allowed for fast development, rather than for miniaturisation or cost-effectiveness. Theperformance requirements were modest, with the only strict restriction being that our circuit hardware fitwithin the terminal.

3.1.1 Counterfeit terminal

Chip & PIN terminals are readily available for purchase online from £5 and their sale is not restricted.Our particular terminal was obtained for £30 from eBay and was ideal for our purposes due to the copiousinternal space that is available. It is only necessary that it appear legitimate to untrained customers and, evenif second hand terminals were not so readily available, a plausible counterfeit could be made from scratch.Instead of reverse engineering the existing circuit, we stripped all internal hardware, except for the keypadand LCD screen, and replaced it with a £100 Xilinx Spartan-3 small factor USB-controlled developmentboard. We also kept the original smartcard reader slot, but wired its output to a £20 USB GemPC Twinreader so we could connect it to the laptop. The result is a terminal with which we can record keypadstrokes, display content on the screen and interact with the inserted smartcard. The terminal appears andbehaves just like a genuine one to the customer even though it lacks the ability to communicate with thebank.

3.1.2 Counterfeit card

At the jeweller’s, Carol needs to insert a wired counterfeit card into Dave’s terminal. For that, we used agenuine Chip & PIN card and ground down the resin-covered wire bonds that connect the chip to the back

5

Page 6: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

Figure 2: Counterfeit terminal with replacement circuitry exposed (left); FPGA based smartcard emulator(right) connected to counterfeit card (front)

of the card’s pads. Then, wires to the edge of the card were pressed into the plastic using a soldering iron.This resulted in a card that looked authentic from on the top side, but was actually wired on the back side, asshown in Figure 2. The counterfeit card was then connected through a 1.5 m cable to a £75 Xilinx Spartan-3E FPGA Starter Kit to buffer the communications and translate them between the ISO 7186 and RS232protocols. Since the FPGA is not 5V tolerant, we use 390 Ω resistors on the channels that receive data fromthe card. For the bi-directional I/O channel, we use the Maxim 1740/1 level translator, which costs less than£1.

3.1.3 Controlling software

The counterfeit terminal and card are controlled by separate laptops via USB and RS232 interfaces, respec-tively, using custom software written in Python. The laptops communicate via TCP over 802.11b wireless,although in principle this could be GSM or other wireless protocol. This introduces significant latency, butfar less than would be a problem because timing critical operations on the counterfeit card are performed bythe FPGA with real-time guarantees.

One complication of selecting an off-the-shelf USB smartcard reader for the counterfeit terminal is thatit operates at the application protocol data unit (APDU) level and buffers an entire command or responsebefore sending it to the smartcard or PC, respectively. This increases the time between when the genuineterminal sends a command and when the response can be sent; but, as previously mentioned, this is wellwithin tolerances.

This paper only deals with the “T=0” ISO 7816 sub-protocol, as used by all EMV smartcards we haveexamined. Here, commands are uni-directional, i.e. either the command or response contains a payloadbut not both. Upon receiving a command code from the genuine terminal, any associated payload will not

6

Page 7: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

be sent by the terminal until the card acknowledges the command. The counterfeit card thus cannot tellwhether to request a payload (for terminal → card commands) or send the command code to the genuinecard immediately (for card → terminal commands). Were the counterfeit terminal to incorporate a characterlevel card reader, the partial command code could be sent to the genuine card and the result examinedto determine the direction, but this is not permissible for APDU level transactions. Hence, the controllingsoftware must be told the direction for each of the 14 command codes. Otherwise, the relay attack is protocolagnostic and could be deployed against any ISO 7816 based system.

3.2 Procedure and timing

EMV offers a large variety of options, but the generality of the relay attack allows our implementationto account for them all; for simplicity, we will describe the procedure for the common case in the UK.That is, SDA card authentication (only the static cryptographic signature of the card details is checked),online transaction authorization (the merchant will connect to the issuer to verify that adequate funds areavailable) and offline plaintext PIN cardholder verification (the PIN entered by the cardholder is sent to thecard, unencrypted, and the card will check its correctness).

Transaction authorization is accomplished by the card generating an application cryptogram (AC),which is authenticated by the card’s symmetric key and incorporates transaction details from the termi-nal, a card transaction counter, and whether the PIN was entered correctly. Thus, the issuing bank canconfirm that the genuine card was available and the correct PIN was used. Note that this does not requireasymmetric cryptography, and so will work even with SDA-only cards, as issued in the UK.

The protocol can be described in six steps:

Initialisation: The card is powered up and returns the ATR. Then the terminal selects one of the possiblepayment applications offered by the card.

Read application data The terminal requests card details (account number, name, expiration date etc.) andverifies the static signature.

Cardholder verification: The cardholder enters their PIN into the merchant’s terminal and this is sent tothe card for verification. If correct, the card returns a success code, otherwise the cardholder may tryagain until the maximum number of PIN attempts have been exceeded.

Generate AC 1: The terminal requests an authorization request cryptogram (ARQC) from the card, whichis sent to the issuing bank for verification, who responds with the issuer authentication data.

External authenticate: The terminal sends the issuer authentication data to the card.

Generate AC 2: The terminal asks the card for a transaction certificate (TC) which the card returns to theterminal if, based on the issuer authentication data and other internal state, the transaction is approved.Otherwise, it returns an application authentication cryptogram (AAC), signifying the transaction wasdenied. The TC is recorded by the merchant to demonstrate to the bank that they should receive thefunds.

This flow imposes some constraints on the relay attack. Firstly, Alice must insert her card before Carolinserts her counterfeit card in order for initialisation and read application data to be performed. Secondly,Alice must enter her PIN before Carol is required to enter it into the genuine terminal. Thirdly, Alice mustnot remove her card until the Generate AC 2 stage has occurred. Thus, the two sides of the radio link mustbe synchronised, but there is significant leeway as Carol can stall until she receives the signal to insert hercard.

7

Page 8: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

After that point, the counterfeit card can request extra time from the terminal, before sending the firstresponse, by sending a null procedure byte (0x60). The counterfeit terminal can also delay Alice by pre-tending to dial-up the bank and waiting for authorization until Carol’s transaction is complete.

All timing critical sections are implemented on the FPGA to ensure a fast enough response. These aresending the ATR in response to the reset line being de-asserted and the encoding and decoding of bytes senton I/O. There are wide margins for the time between command and response, so this is managed in software.

3.3 Results

We tested our relay setup with a number of different smartcard readers in order to evaluate its applicabil-ity. Firstly, we used a VASCO Chip Authentication Program (CAP) reader. This is a handheld one-time-password generator for use in online banking, and implements a subset of the EMV protocol. In particular,it will perform cardholder verification through a PIN and request an application cryptogram, which can bevalidated online. Our relay device was able to reliably complete transactions, even when an extra 3 secondsof latency between command and response was introduced.

The CAP reader used a 1 MHz clock to decrease power consumption, but at the cost of slower trans-actions. So we also tested our relay device with a GemPC Twin reader, which has a 4 MHz clock. Thecard reader was controlled by our own software, which simulates a Chip & PIN transaction. As expected,the relay device worked without any problems and results were identical to when the card was connecteddirectly.

Finally, we developed a portable version of the equipment, and took this to a merchant with a live Chip& PIN terminal. With the consent of the merchant and cardholder, we placed a transaction with our coun-terfeit card in the genuine terminal, and the cardholder’s card in the counterfeit terminal. In addition to thecommands and responses being relayed, the counterfeit terminal was connected to a laptop which, throughvoice-synthesis software, read out the PIN to our “Carol”. The transaction was completed successfully.

3.4 Other applications of the relay attack

The relay attack is also applicable where “Alice” is not the legitimate card holder, but a thief who has stolenthe card and observed the PIN. To frustrate legal investigation and fraud detection measures, criminalscommonly use stolen cards in a different country from the one they were stolen from. Magnetic stripe cardsare convenient to use in this way, as the data can be read then sent overseas electronically, to be written ontocounterfeit cards. However, chip cards cannot be fully copied, so the physical card would need to be mailed,introducing a time window where the cardholder could cancel the card.

Using the relay attack, fraudsters can bypass this delay. The stolen card could be inserted into a cardreader, connected to the Internet. The fraudster’s accomplice in another country could connect to the cardand place transactions with a counterfeit card. The timing constraints in this scenario are more relaxedas there is no customer expecting to remove their genuine card. Finally, in certain types of transactions,primarily with unattended terminals, the PIN may not be required, making this attack easier still.

4 Defences

The previous section described how it is feasible to deploy relay attacks against Chip & PIN, in a practicalscenario, as well as other smartcard based authorization systems. Thus, system designers must developmitigation techniques while, for reasons of economics, staying within the deployed EMV framework asmuch as possible.

8

Page 9: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

4.1 Non-solutions

A number of solutions have been proposed which the attacker can surmount with varying degrees of ease.In this section we describe these solutions and their weaknesses.

Tamper-resistant terminals A pre-requisite of our relay attack is that Alice will insert her card and enterher PIN into a terminal that can relay these details to the remote attacker. The terminal, therefor, must eitherbe tampered with, or be completely counterfeit, but still acceptable to cardholders. This implies a potentialsolution to the relay attack – allow the cardholder to detect malicious terminals so they will not use them.Unfortunately, this cannot be reliably implemented in practice.

Although terminals do implement internal tamper-responsive measures, when triggered, they only deletekeys and other data, so leaving no visible evidence to the cardholder. Tamper-resistant seals could be in-spected by customers, but Johnston et al. [16] have shown that many types of seals can be trivially bypassed.It would also be infeasible to give all customers adequate training to detect tampering or counterfeiting ofseals. By inducing time-pressure and an awkward physical placement of the terminal, the attacker can makeit extremely difficult for even a diligent customer to check.

Even if it were possible to produce a seal, at time of writing, there are 292 approved terminal designsfrom 84 vendors [18], so cardholders cannot be expected to be able to identify them all. Were there onlyone terminal design, a mechanism would need to be in place to prevent counterfeit terminals, which raisesthe same problems as tamper-resistant seals. With the large sums of money netted by fraudsters, fabricatingplastic parts is well within their budget.

Imposing additional timing constraints on EMV While relay attacks will induce extra delays betweencommands being sent by the terminal and responses being received, existing smartcard systems are tolerantto very high latencies. We have successfully tested our relay device after introducing a 3 second delay intotransactions, in addition to inherent delay of our design. This extra round-trip time could be exploited by anattacker up to 450 000 km away at half the speed of light in a vacuum. So perhaps attacks could be preventedby requiring that cards reply to commands precisely after a fixed delay. Terminals could then confirm that acard responds to commands promptly, and will otherwise reject a transaction.

Other than the generate AC command, which includes a terminal nonce, a terminal’s behaviour is verypredictable. So an attacker could preemptively request these details from the genuine card then send themto the counterfeit card where they are buffered for quick response. Thus, the value of latency as a dis-tance measure can only be exploited at the generate AC stages. Furthermore, Clulow et al. [8] show howwireless distance bounding protocols, based on channels which were not designed for the purpose, can becircumvented. Their comments apply equally well to wired protocols such as ISO 7816.

To hide the latency introduced by mounting the relay attack, the attacker aims to sample signals earlyand send signals late, while still maintaining their accuracy. In ISO 7186, cards and terminals are requiredto sample the signal between the 20% and 80% portion of the bit and aim to sample in the middle. However,an attacker with sensitive equipment could sample near the beginning, and send their bit late. The attackerthen gains 50% of a bit-width in both directions, which at a 5 MHz clock is 37 µs, i.e. 11 km.

The attacker could also over-clock the genuine card so the responses are returned more quickly. A DEScalculation could take around 100 ms so only a 1% increase would give a 300 km distance advantage. Evenif the calculation time was fixed, and only receiving the response from the card could be accelerated, thecounterfeit card could preemptively reply with the predictable 11 bytes (2 byte response code, 5 byte readmore command, 2 byte header and 2 byte counter) each taking 12 bit-widths (start, 8 data bits, stop and 2bits guard time). At 5 MHz + 1% this gives the attacker 98µs, i.e. 29 km.

One EMV-specific problem is that the contents of the payload in the generate AC command are specifiedby the card in the card risk management data object list (CDOL). Although the terminal nonce should be

9

Page 10: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

at the end of the message in order to achieve maximum resistance to relay attacks, if the CDOL is notsigned, the attacker could substitute the CDOL for one requesting the challenge near the beginning. Thenthe attacker, on receiving the challenge from the terminal, can send this to the genuine card. Other thanthe nonce, the rest of the generate AC payload is predictable, so the counterfeit terminal can restore thechallenge to the correct place, fill in the other fields and send it to the genuine card. Thus, the genuinecard will send the correct response, even before the terminal thinks it has finished sending the command. Achallenge will be around 30 bytes, which at 5 MHz would give 27 ms and a 8 035 km distance advantage.

Nevertheless, eliminating needless tolerance to response latency would decrease options available tothe attacker. If it were possible to roll out this modification to terminals as a software upgrade, it mightbe expedient to plan for this alteration to be quickly deployed in reaction to actual use of the relay attack.While we have described how this countermeasure could be circumvented, attackers who build and test theirsystem with high-latency would be forced to re-architect their approach if the acceptable latency of deployedterminals were decreased without warning.

4.2 Procedural improvements

Today, merchants and till operators are accustomed to looking away while customers enter their PIN andto not handle the card at all. Due to other types of fraud such as card skimming, customers are oftenrecommended not to allow anyone but themselves to handle the card. In the case of relay attacks, thisassists the criminal, not the customer. If the merchant examined the card, even superficially, he would detectthe relay attack, as we implemented it, by spotting the wires. That said, it is not infeasible that an RFIDproximity card could be modified to relay data wirelessly to a local receiver and therefore appear to be agenuine card.

A stronger level of protection can be achieved if, after the transaction is complete, the merchant checksnot only that the card presented is legitimate, but also that the embossed card number matches the one onthe receipt. In the case of the relay attack, the receipt will show the victim’s card number, whereas thecounterfeit card will show the original number of the card from before it was tampered with. For these tomatch, the fraudster must possess appropriate blank cards and an embossing machine. Also, he must knowthe victim’s card number in adequate time to produce a counterfeit.

While raising the bar of entry, this prevention measure can be circumvented with a portable embossingmachine. Existing devices take only a few seconds to print a card, but making these portable could befeasible for fraudsters. The quality of counterfeit cards and embossing need not be high, just sufficient topass cursory analysis. More recent smartcards are being issued without embossing, as the carbon-paperpayment method is no longer used, making counterfeits even easier to produce. If none of these possibilitiesare open, repeat customers could be targeted and so creating a wide window of opportunity.

In some scenarios, such as unattended Chip & PIN terminals, ATMs, or where the terminal is on theopposite side of a glass barrier, this approach would be infeasible, but even where it is, the merchant mustbe diligent. Varian [17] has shown that if the party who is in the best position to prevent fraud does not haveadequate incentives to do so, security suffers.

If customers must depend on merchants, who they have no relationship with, for their protection, thenthere are mismatched incentives. Merchants selling low-marginal-cost products or services (e.g. software ormultimedia content), have little desire to carefully check for relay attacks. This is because, in the case offraud, the costs will likely be borne by the customer. Even if the transaction is subsequently reversed, whenfraud is detected, the merchant has lost only the low marginal cost, but has saved the effort of checkingcards.

10

Page 11: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

4.3 Hardware alterations

The PIN guard is a trusted device that is brought into the transaction by the customer so that the merchant’sterminal does not need to be trusted; this is called the “man-in-the-middle defence”, as suggested by Ander-son and Bond [1]. The guard is inserted into the terminal’s card slot while the customer inserts the card intothe guard. The guard can display the transaction value as it is parsed from the data sent from the terminal,allowing the customer to verify that she is charged the correct amount. If the customer approves the trans-action, she presses a button on the PIN guard itself, which allows the protocol to proceed. This trusted userinterface is necessary, since if a PIN was used as normal, a fraudster could place a legitimate transactionfirst, which is accepted by the customer, but with knowledge of the PIN a subsequent fraudulent one can beplaced. Alternatively, one-time-PINs could be used, but at a cost in usability.

As the cardholder controls the PIN guard, and it protects the cardholder’s interests, the incentives areproperly aligned. Market forces in the business of producing and selling these devices should encouragesecurity improvements. However, this extra device will increase costs, increase complexity and may notbe approved of by the banking organisations. Additionally, fraudsters may attempt to discourage their use,either directly or by arranging the card slot so the use of a PIN guard is difficult. A variant of this approachis to integrate a display into the card itself, as permitted by recent technological developments [4].

Another realization of the trusted user interface for payment applications is to integrate the functionalityof a smartcard into the customer’s mobile phone. This can allow communication with the merchant’s termi-nal using near field communications (NFC) [15]. This approach is already under development and has theadvantage of being a customer-controlled device with a large screen and convenient keypad, allowing mer-chant’s name and transaction value to be shown and once authorized by the user, entry of the PIN. Wirelesscommunications also ease the risk of a malicious merchant arranging the terminal so that the trusted displaydevice is not visible. Although mobile phones are becoming affordable and ubiquitous, they may still not besecure enough for payment applications as they can be, for example, targeted by malware.

5 Distance bounding

None of the techniques detailed in Section 4.1 are adequate to completely defend against relay attacks. Theyare either impractical (tamper resistant terminals), expensive (adding extra hardware) or circumventable(introducing tighter timing constraints and requiring merchants to check card numbers). Due to the lack ofa customer-trusted user interface on the card, there is no way to detect when there is a mismatch betweenthe data displayed on the terminal and that authorized by the card. However, relay attacks can be foiled ifeither party can securely establish the position of the card which is authorizing the transaction, relative tothe terminal processing it.

Absolute positioning is infeasible due to the cost and form factor requirements of smartcards beingincompatible with GPS. However, it is possible for the terminal to securely establish a maximum distancebound, by measuring the round-trip-time between it and the smartcard; if this time is too long, an alarmwould be triggered and the transaction refused. Despite the checking being performed at the merchantend, the incentive-compatibility problem is lessened because the distance verification is performed by theterminal and does not depend on the sales assistant being diligent.

The approach of preventing relay attacks by measuring round-trip-time was first proposed by Beth andDesmedt [5] but Brands and Chaum [7] described the first concrete protocol. We use the Hancke-Kuhnprotocol [13], adapted for half-duplex wired, rather than wireless, transmission, because it is more efficientif there are transmission bit errors compared to Brands-Chaum.

11

Page 12: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

5.1 Protocol

In EMV, authentication is only card to terminal so we follow this practise. Following the Hanke-Kuhnterminology, the smartcard is the prover, P , and terminal is the verifier, V . This is also appropriate becausethe Hanke-Kuhn protocol puts more complexity in the verifier than the prover, and terminals are severalorders of magnitude more expensive and capable than the cards. The protocol is described as follows:

Initialization : V → P : NV ∈ 0, 1a

P → V : NP ∈ 0, 1a

P : (RP0i ||RP1

i ) ∈ 0, 1b = HK(NV , NP )Bit-exchange : V → P : Ci ∈ 0, 1

P → V : RVi = RPCi

i ∈ 0, 1

At the start of the initialization phase, nonces and parameters are exchanged over a reliable data channel,with timing not being critical. NV and NP provide freshness to the transaction in order to prevent replayattacks, with the latter preventing a middle-man from running the complete protocol twice between the twophases using the same NV and thus, obtain both RP0

i and RP1i . The prover produces a MAC under the

key K using a keyed pseudo-random function, the result of which is split into two shift registers, RP0i and

RP1i . If a symmetric key is used, this will require an on-line transaction to verify the result because the

terminal does not have the key. If the card has a private/public key pair, a session key can be establishedand the verification of the final challenge-response can be also made offline. a and b, the nonce and shiftregister lengths respectively, are security parameters that are set according to the application and are furtherdiscussed in Section 5.5. In the timing-critical rapid bit-exchange phase, the distance between the twoparticipants is determined. V sends a single-bit challenge Ci to P , which in turn immediately responds withRPCi

i , the next single-bit response, from the corresponding shift register. A transaction of 40 bits is shownbelow with x being a “don’t care” value.

A 3 8 F 6 D 7 5 A ECi : 1010 0011 1000 1111 0110 1101 0111 0101 1010 1110

RP0i : x0x0 11xx x011 xxxx 0xx1 xx1x 1xxx 1x0x x0x1 xxx0

RP1i : 1x0x xx10 1xxx 0001 x10x 01x0 x111 x1x0 1x0x 101x

RVi : 1000 1110 1011 0001 0101 0110 1111 1100 1001 1010

8 E B 1 5 6 F C 9 A

This exchange succeeds to measure distance because it necessitates that a response bit arrive at a certaintime after the challenge has been sent. When the protocol execution is done, the response register is verifiedby the terminal or bank (depending on type of key) to determine if the prover is within allowed distance forthe transaction.

5.2 Implementation

ISO 7816, our target application, dictates that the smartcard (prover) is a low resource device, and therefore,should have minimal additions in order to keep its cost down. The terminal (verifier), on the other hand,is a capable, expensive device that can accommodate moderate changes and additions without adverselyaffecting costs. Of course, the scheme must be secure to all attacks devised by an highly capable adversarythat can relay signals at the speed of light, is able to ensure perfect signal integrity, and can clock the

12

Page 13: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

RP0

SMPLC

DRVR

dly

RP1

response SR

challenge SR

SMPLR

DRVC

divCLKV

d

verifier prover

response SR’s

C

Figure 3: Diagram of the distance bounding circuit. DRVC drives the challenge onto the I/O line. CLKV

is divided and appears as SMPLC at the prover where it is used to sample the challenge. A delay ele-ment produces DRVR for driving the response onto the I/O. The verifier samples the response by assertingSMPLR.

smartcard at higher frequencies than it was designed for. We assume, however, that this attacker does nothave access to internal operation of the terminal and that extracting secret material out of the smartcard, orinterfering with its security critical functionality, is not economical considering the returns from the fraud.

Signal Timingparameter

Description

fV Verifier’s clock frequency; determines the distance resolutionfP Prover’s clock frequency; received from verifierDRVC n Verifier drives the challenge onto the I/O line for nSMPLC m Prover samples challenge; This is the shared clock, sent by the

verifier m after DRVC was assertedDRVR p Prover drives response onto I/O line; this is SMPLC delayed by

pSMPLR q Verifier samples response on rising edge; q determines the maxi-

mum distance to be measuredd Propagation delay

Table 1: Signals and their associated timing parameters

5.3 Circuit elements and signals

Clocks and frequencies As opposed to the prover, the verifier can operate at high frequencies. We haveimplemented the protocol such that one clock cycle of the verifier’s operating frequency, fV , determines thedistance resolution it can achieve. Since signals cannot travel faster than the speed of light, c, the lower-bound resolution is therefore, c/f meters. fV , then, should be chosen to be as high as possible. We chose itto be 200 MHz which allows us a 1.5 m resolution, under ideal conditions for the attacker. We have madethe prover’s frequency, fP , compatible with all frequencies not exceeding 1/2(q + 1/fV ) (assuming a 50%duty cycle). As we shall see, this is because during the high time of this clock the response is driven onto theI/O line and must be valid until it is sampled. ISO 7816 specifies that the smartcard/prover needs to operateat 1–5 MHz and in order to be compatible, we chose for our implementation fP = fV /128 ≈ 1.56 MHz.

Shift registers The design has four 64 bit shift registers (SR). Two are for the challenges and receivedresponses at the verifier and two more for the response SRs at the prover. The challenge SR is connected

13

Page 14: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

SMPLC

n

m

p

propagation delay

Ci

Ci Ri

RiI/OV

I/OP

d

fV

CLKV P

DRVR

q

d

DRVC

SMPLR

Figure 4: Waveforms of a single bit-exchange of the distance bounding protocol. fV is the verifier’s clock;DRVC drives the challenge onto I/O; SMPLR samples the response; CLKV→P is the prover’s clock; I/OV

and I/OP are versions of the I/O on each side accounting for the propagation delay; SMPLC is the receivedclock that is used to sample the challenge; and DRVR drives the response onto the I/O.

Figure 5: FPGA based implementation of the distance bounding protocol. Both sides of the transaction areon the same chip, and the 1 m coaxial cables simulate a relay attack.

14

Page 15: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

to CLKV and is shifted one clock cycle of fV before it is driven onto the I/O line by DRVC . The verifier’sresponse SR is also clocked by CLKV and is shifted on the rising edge of SMPLR. On the prover side, theSR’s are clocked and shifted by SMPLC .

Bi-directional I/O The verifier and prover communicate using a bi-directional I/O with tri-state buffers ateach end. These buffers are controlled by the signals DRVC and DRVR and are implemented such that onlyone side at a time drives the I/O line in order to prevent contention. A pull-up is also present, as with theISO 7816 specification, to maintain a high state when the line is not driven by either side. As a side note, ifISO 7816 is not to be adhered to, two uni-directional wires for the challenge and response would have madeimplementation easier.

5.4 Timing

A timing diagram of a single challenge-response exchange is shown in Figure 4. This circuit was imple-mented on a Virtex-II PRO FPGA using state machines written in Verilog; not all signals are shown forthe sake of clarity. Since we used a single chip, the I/O and clock lines were “looped-back” using wires tosimulate the distance between the verifier and prover as shown in Figure 5.

The first operation is clocking the challenge SR which is driven onto the I/O line by DRVC at thefollowing clock cycle. DRVC drives the challenge for time n which should be made long enough to ensurethat the prover can adequately sample the challenge, while being as short as possible to allow the responseto be rapidly sent without causing contention. m-time after the assertion of DRVC , the clock sent to P ,CLKV→P is asserted. Both CLKV→P and the I/O line have the same propagation delay, d, and whenthe clock edge arrives, it samples the challenge (the signal is now called SMPLC). The same clock edgealso shifts the two response registers that pass through a multiplexer that chooses one according to thechallenge. A p-time delayed version of SMPLC , DRVR, is created using a delay element in order to allowthe response SR signals to propagate and also prevent the intermediate state of the multiplexer from beingleaked, allowing the attacker to know both responses to the previous challenge. The delay element can bevery short and could be implemented using delay lines, or buffers on an ASIC. When DRVR is asserted, theresponse is being driven onto the I/O line until the falling edge. On the verifier side, the response is sampledq-time after the assertion of CLKV→P . q determines the distance measured and should be long enough toaccount for the propagation delay that the system was designed for, and short enough to not allow an attackerto be further away than desired, with the minimum value being m + p + 2d. q can be dynamically shiftedbetween invocations of the protocol allowing the verifier to make decisions based on the measured distance,for example, the maximum transaction amount allowed. With multiple iterations, the exact distance can befound with a margin of error equal to the signal propagation time during a single clock cycle.

We should mention that the timing parameters shown in Figure 4 are very liberal to aid clarity, and alsofor it to work for both short and long wires.

Implications of signal integrity In order to establish the distance resolution that can be achieved withthe protocol, we assumed that the attacker can transmit signals at the speed of light and overcome signalintegrity issues. This theoretical attacker does not exist, and a realistic one will need to overcome all thesereal-world problems. Thus, designing the system for tight specifications will raise the effort needed fromthe attacker and raise the cost of attack. Firstly, the timing parameters n, m and p and q should be made asshort as possible. Secondly, if the physical distance between the verifier and prover is designed to be 3 cm,then the I/O’s signal’s drive strength should be set to drive the wire only up to that approximate distance.Further, the rising edge of the signal governs whether a circuit is lumped or distributed, the former doesnot require termination since the signal appears to be the same to both sender and receiver, while the latterrequires measures to assure the correct waveform appearing on the receiving end. The rule-of-thumb is that

15

Page 16: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

for an element to be considered lumped, the signal trace should be about 6 times shorter than the distanceit takes for the rising edge of the signal to fully propagate. The rise time, then, is Tr = 6lD where l is thetrace distance and D is the delay. If our 3 cm trace allows the signal to propagate at 6.5 ns/m (an averagefor various transmission lines and coaxial cables), the rise time should be roughly 1 ns or faster with theappropriate PCB design to allow such fast rise times.

5.5 Possible attacks on distance bounding

Although, following from our previous assumptions, the attacker cannot get access to any more than half theresponse bits, there are ways he may extend the distance limit before a terminal will detect the relay attack.This section discusses which options are available and their efficacy.

Guessing attack Following the initialisation phase, the attacker can initiate the bit-exchange phase beforethe genuine terminal has done so. As the attacker does not know the challenge at this stage, he will onaverage, guess 50% of the challenge bits correctly and so receive the correct response. For the ones wherethe challenge was guessed incorrectly, the response is effectively random, so there is still a 50% chance thatthe response will be correct. So the expected success rate of this technique is 75%.

In our prototype, where the response registers are 64 bits each, the attacker is expected to guess 96 outof the 128 bits. Since our tests show an insignificant error rate, the terminal may reject any response with asingle bit that is incorrect. This results in the attacker having a 1 in 231 probability of success. The size ofthe registers is a security parameter that can be increased according to application.

Replay If the attacker can force the card to perform two protocol runs, with the same nonces used forboth, then all bits of the response can be extracted by sending all 1’s on the first iteration and all 0’s on thesecond. We resist this attack by selecting the protocol variant mentioned in [13] of where the card adds itsown nonce. This is cheap to do within EMV, since a transaction counter is already required by the rest of theprotocol but if this is not desired then provided the card cannot be clocked at twice its intended frequency,the attacker will not be able to extract all bits in time. This assumes that the time between starting thedistance bounding protocol, and the earliest time the high-speed stage can start, is greater than the latter’sduration.

Early bit detection and deferred bit signalling The card will not sample the terminal’s challenge untilm-time after the challenge is placed on the I/O line. This is to allow an inexpensive card to reliably detect thesignal but, as discussed in [8], an attacker who is willing to use expensive equipment could, in theory, detectthe signal immediately. By manipulating the clock provided to the genuine card, and using high-quality fastbus drivers, the challenge could be sent to the card without any extra delay.

Similarly, the terminal will wait time q between sending the challenge until sampling the response, toallow the round trip signal propagation time, and wait until the response signal has stabilised. Again, throughhigh-quality bus sampling and driving equipment, the response could be sent from the card just before theterminal samples. The attacker, however, cannot do so any earlier than time p after the card has sampled thechallenge.

Delay-line manipulation The card may include the value of p in its signed data, so the attacker cannotmake the terminal believe that the value is larger than the card’s specification. However the attacker mightbe able to reduce the delay, for example by cooling the card. If it can be reduced to the point that themultiplexer or latch has not settled, then both potential responses may be placed onto the I/O line, violatingour assumptions.

16

Page 17: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

However, if the circuit is arranged so that the delay will be reduced only if the reaction of the challengelatch and multiplexer is improved accordingly, the response will still be sent out prematurely. This gives theattacker extra time, so should be prevented. If delay lines resistant to temperature are not economic, thenthey should be as short as possible to reduce this effect.

In fact, p may be so small < 1 ns , that the terminal could just assume it would be zero. This will meanthat the terminal will believe all cards are slightly further away than otherwise, but will avoid the value of phaving to be included in the signed data. This is the approach we take in our prototype implementation.

Combined attacks For an attacker to gain a better than 1 in 231 probability of succeeding in the challengeresponse protocol, the relay attack must take less than m + q time. In practice an attacker will not be ableto sample or drive the I/O line instantaneously and the radio-link transceiver will introduce latency, so theattacker would need to be closer than this limit. Also, a production implementation on an ASIC would beable to give better guarantees, since at the high speeds involved the latency and reflections introduced by≈ 10 cm long PCB traces on our prototype necessitated larger values for m and q to reliably sample thesignals.

5.6 Results

We have developed a versatile implementation that requires only modest modification to currently deployeddesigns. Our distance bounding protocol was successfully implemented and tested on an FPGA for 2.0, 1.0,and and 0.1 meter transmission lengths, although it can be modified to work for any distance and tailored toany end application. Oscilloscope traces of a single bit challenge-response exchange over a 1 m cable areshown in Figure 6. In this case, the challenge is 0 and the response is 1 with indicators where the SMPLR

has samples the response. The first, after qfail = 45 ns has sampled too early while the second, qpass = 50 ns,which is a single period of fV later, has correctly sampled the response. The delay, d = 6.59 ns, is also cleardue to the length of the cable. We have also implemented the protocol for a much shorter (10 cm) distance,where the timing values were minimised to n = 15 ns, m = 10 ns, p = 5 ns and q = 25 ns. If the attackerexploited all possible attacks previously discussed and was able to transmit signals at c, he would need to bewithin approximately 10 m, although the actual distance would be much less for a realistic attacker.

6 Discussion

The distance bounding protocol we have proposed will detect attempted relay attacks but it requires that thebanks produce cards and terminals that support the protocol. However, the person being defrauded is thecardholder, Alice, who must use the cards and terminals she is given, so has no trusted user interface andhence no way to defend herself. As mentioned in Section 4.2, this incentive mismatch may be detrimental tothe cardholder’s financial security. For instance, until all terminals support the distance bounding protocolextensions, the issuer can select whether to fallback to the current protocol that is vulnerable to relay-attack.Under existing UK practice the customer is liable for PIN verified fraudulent transactions [6], so the issuermay elect to accept fallback transactions knowing that the cardholder is carrying the risk

A further problem of the distance bounding protocol is the lack of non-repudiation: for a third party toverify that a relay attack was not in progress, the merchant’s terminal must be trusted to correctly reportthe round-trip latency. Thus, if a customer claims that a transaction is fraudulent, then even if the distancebounding protocol is recorded to have succeeded, there remains the possibility that the terminal has beentampered with. It falls on the acquirer to mandate tamper-resistant terminals, but although the paymentnetwork may require that all members implement appropriate protections, the customer is only representedindirectly by the issuer.

17

Page 18: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

0 20 40 60 80

0.0

0.5

1.0

1.5

2.0

2.5

volta

ge (

V)

time since challenge received by prover (ns)

Challenge Response

CLKp

Prover samples Verifier samples

d

n

m

p

q fail

qpass

I Op

I Ov

0 5 10 15 20distance at speed of light in vacuum (m)

Figure 6: Oscilloscope trace of a single bit from the bit-exchange phase of the distance bounding protocol.Here the challenge is 0 and the response is 1. Latency was introduced by a 1 m cable between prover andverifier. Timing parameters are n = 35 ns, m = 20 ns, p = 20 ns. Two values of q are shown, one wherethe bit was correctly received qpass = 50 ns and one where there where was not, qfail = 45 ns. The actualresult shown on the graph differs slightly from these idealised timings due to latency in the bus drivers anddistance between the FPGA and oscilloscope sampling point. d was measured to be 6.59 ns which over a1 m cable corresponds to propagation velocity of 1.52× 108 m/s.

18

Page 19: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

So while inexpensive yet strong technical solutions, such as the distance bounding protocol, do exist theymust be deployed as part of an appropriate liability framework to fully realize their benefits. The currentsituation, where customers are liable for fraud, yet powerless to verify whether a terminal is genuine, isclearly unfair. If the power of banking institutions is too great to alter the entrenched notion of customerliability, then measures that put the cardholder in a position of control, such as the PIN guard [1], despitebeing more expensive, may be the most appropriate solution. However customers should exercise somecaution before accepting these options as the second-order effect of the customer being able to detect attackscould be to make them reasonably liable for any fraud which is nevertheless perpetrated.

7 Conclusion

This paper described relay attacks and how they can be applied to exploit smartcard-based payment systems.In particular, a prototype was built and shown to be successful against the Chip & PIN payment systemdeployed in the UK. This consisted of creating a fake terminal and custom hardware to allow the relayingof information between the participating parties. We suggested procedural improvements to the acceptanceof Chip & PIN transactions, which would provide an short-term defence, but these could be circumventedby a plausible attacker. We then developed the first implementation of a distance bounding defence againstthese relay attacks and showed it to be the most robust solution. Our implementation was designed to beappealing for adoption for the next generation of smartcards by tailoring the design to the EMV framework.

Acknowledgements

Saar Drimer is supported by a grant from Xilinx, Inc. Steven J. Murdoch is funded by the OpenNet Initiative.We thank Mike Bond, Richard Clayton, Markus G. Kuhn, Ford-Long Wong and Frank Stajano for theirvaluable suggestions and the merchants who allowed us to test and demonstrate our attack. We would liketo thank Xilinx for the donation of FPGA boards and development software.

References

[1] ANDERSON, R., AND BOND, M. The man in the middle defence. In Security Protocols WorkshopProceedings (2006), LNCS, Springer (to appear). http://www.cl.cam.ac.uk/∼rja14/Papers/Man-in-the-Middle-Defence.pdf.

[2] ANDERSON, R., BOND, M., AND MURDOCH, S. J. Chip and spin, March 2005. http://www.

chipandspin.co.uk/spin.pdf.

[3] ANDERSON, R. J. Security engineering: A guide to building dependable distributed systems. JohnWiley & Sons, Inc., New York, NY, USA, 2001.

[4] AVESO. Display enabled smart cards. http://www.avesodisplays.com/.

[5] BETH, T., AND DESMEDT, Y. Identification tokens – or: Solving the chess grandmaster problem. InCRYPTO (1990), A. Menezes and S. A. Vanstone, Eds., vol. 537 of LNCS, Springer, pp. 169–177.

[6] BOHM, N., BROWN, I., AND GLADMAN, B. Electronic commerce: Who carries the risk of fraud?The Journal of Information, Law and Technology, 3 (October 2000). http://www2.warwick.ac.uk/fac/soc/law/elj/jilt/2000 3/bohm/.

19

Page 20: Keep your enemies close: Distance bounding against ...akiayias/cse281sp08/CSE281... · Distance bounding against smartcard relay attacks ... experiments on the UK’s EMV ... notable

[7] BRANDS, S., AND CHAUM, D. Distance-bounding protocols. In EUROCRYPT ’93: Workshop on thetheory and application of cryptographic techniques on Advances in cryptology (May 1993), T. Helle-seth, Ed., no. 765 in LNCS, Springer, pp. 344–359.

[8] CLULOW, J., HANCKE, G. P., KUHN, M. G., AND MOORE, T. So near and yet so far: Distance-bounding attacks in wireless networks. In Security and Privacy in Ad-hoc and Sensor Networks (Ham-burg, Germany, September 2006), L. Buttyan, V. Gligor, and D. Westhoff, Eds., vol. 4357 of LNCS,Springer.

[9] CONWAY, J. H. On Numbers and Games. Academic Press, 1976.

[10] DESMEDT, Y., GOUTIER, C., AND BENGIO, S. Special uses and abuses of the Fiat-Shamir passportprotocol. In Advances in Cryptology – CRYPTO ’87: Proceedings (1987), vol. 293 of LNCS, Springer,p. 21.

[11] EMVCO, LLC. EMV 4.1, June 2004. http://www.emvco.com/.

[12] HANCKE, G. A practical relay attack on ISO 14443 proximity cards, 2005. http://www.cl.cam.ac.uk/∼gh275/relay.pdf.

[13] HANCKE, G. P., AND KUHN, M. G. An RFID distance bounding protocol. In SECURECOMM’05: Proceedings of the First International Conference on Security and Privacy for Emerging Areas inCommunications Networks (Washington, DC, USA, 2005), IEEE Computer Society, pp. 67–73.

[14] INTERNATIONAL ORGANIZATION FOR STANDARDIZATION. ISO/IEC 7816-3:2006 Identificationcards – Integrated circuit cards – Part 3: Cards with contacts – Electrical interface and transmissionprotocols, 3 ed., October 2006.

[15] INTERNATIONAL ORGANIZATION FOR STANDARDIZATION. ISO/IEC 18092:2004 Information tech-nology – Telecommunications and information exchange between systems – Near Field Communication– Interface and Protocol (NFCIP-1), 1 ed., January 2007.

[16] JOHNSTON, R. G., GARCIA, A. R., AND PACHECO, A. N. Efficacy of tamper-indicating devices.Journal of Homeland Security (April 2002).

[17] VARIAN, H. R. Managing online security risks. New York Times. 1 June, 2000. http://www.ischool.berkeley.edu/∼hal/people/hal/NYTimes/2000-06-01.html.

[18] VISA INTERNATIONAL SERVICE ASSOCIATION. Approved PIN entry devices, January 2007. http://partnernetwork.visa.com/dv/pin/pedapprovallist.jsp.

20