Security and privacyExhibit 20

How does tap to pay work?

The reader's magnetic field powers the card's chip through the air. For every tap, the chip makes a one-time code from a secret key that never leaves it, a counter and a random number from the reader. In our simplified model, a recorded payment replayed 1,000 times was refused every time.

Try it: tap, record, replay

This is a simplified card, reader and bank running in your browser, the same model as in our video. Nothing here is a real card or a real payment.

Field at the card
–
The chip
–
2. Pay, then try to cheat
Counter
–
Reader's random number
–
One-time code
–

Tap the card to make a payment.

    Simplified on purpose: this model uses HMAC-SHA256 and a 2 cm to 4 cm working range. Real cards use other algorithms and longer messages, and real attacks studied by researchers (relay and pre-play attacks) are more elaborate than a plain replay.

    The video for this exhibit comes out on YouTube on Friday 22 January. Subscribe so you don’t miss it

    Power through the air

    A contactless card is a small computer with a coil of wire around it and no battery. The reader has a coil too, and it sends out a magnetic field at 13.56 MHz, swinging back and forth more than thirteen million times a second. That field makes a current flow in the card's coil, and the current powers the chip. The card answers by changing how much of the field it draws (engineers call it load modulation), and the reader senses the change.

    Why so close

    The field fades quickly. We calculated it for an ideal reader coil 7 cm across, compared with the field at its centre: 65% at 2 cm, 29% at 4 cm, 3.6% at 10 cm and 0.0043% at one metre. This is a calculation with an assumed coil size, not a measurement of a real reader. The card standard, ISO/IEC 14443, is designed for less than 10 cm, and payment readers are built to work up to about 4 cm.

    A one-time code

    The card does send its number. What it never sends is a secret key locked inside the chip. For every tap the card mixes several things with that key. Three matter most: the amount, a counter that goes up by one each time, and a random number the reader has just made up. The result is a short code called a cryptogram. The bank can rebuild the same key, so it does the same calculation and compares.

    What we tested

    We built a simplified card, reader and bank in code. Five taps of $4.50 at the same shop gave five different cryptograms. We then replayed a recorded tap 1,000 times: all 1,000 were refused, because that counter value was already used. Against 1,000 new payments, all were refused, because the reader's random number was different. Changing $4.50 to $450.00 was refused, and 1,000,000 random guesses produced 0 approvals. Real cards use different algorithms and longer messages, but the same three ingredients. It is not a perfect shield: researchers have relayed a live tap between a card and a distant reader, and a recorded tap still contains the card number.

    Your phone goes further

    When you add a card to a phone, your bank, or a service working for it, gives the phone a different number made only for that device. Apple calls it a Device Account Number, and says full card numbers are not shared with merchants. For a normal payment nothing is sent until you unlock with your face, your fingerprint or your passcode. A stolen plastic card can still tap, which is why banks and card networks limit how much a tap can spend without a PIN: in the EU the limit is €50 per tap, and most UK banks have kept £100.

    Frequently asked questions

    How does a contactless card work without a battery?

    The reader sends out a magnetic field at 13.56 MHz. That field makes a current flow in the coil of wire inside the card, and the current powers the chip for the moment of the tap.

    Can someone record a card tap and use it again?

    In our model a plain replay does not work. Every tap produces a one-time code (a cryptogram) made from a secret key in the chip, a counter that goes up with each tap and a random number from the reader. In our simplified model, a recorded tap replayed 1,000 times was refused every time. More elaborate attacks, such as relaying a live tap, have been shown by researchers.

    Why do you have to hold the card so close?

    The reader's field fades quickly with distance. In our calculation for a coil 7 cm across, the field is at 29% four centimeters away and under 4% at ten. The standard is designed for less than 10 cm, and payment readers are built to work up to about 4 cm.

    Does a phone send my real card number when I pay?

    With Apple Pay, no. Apple says the full card number is not stored on the device; the card issuer creates a separate Device Account Number for that device, and the full card number is not shared with the merchant.

    Sources

    Last updated

    Keep exploring