You tap a card on a reader. It beeps. The coffee is paid for.
The card has no battery, no screen and no button. Nobody ever charged it. Yet something inside it woke up, did some maths and helped a bank say yes, all while you held it still for a moment.
Two things are odd about that. Where did the power come from? And if a card just answers a reader, what stops someone from recording the answer and using it again?
Short version:
- The terminal’s coil makes a magnetic field that swings 13.56 million times a second. The card’s coil turns that into a small voltage. That is the card’s whole power supply, and it is why a tap only works within a few centimetres.
- The card answers by loading its own coil, which the terminal can feel. It sends a code made from the amount, a random number from the terminal and a counter. The code is good for one payment.
- A copy of a tap fails at the bank: the counter was already used, or the code does not match. Phone wallets also swap the card number for a stand-in number (a token). The open problem is a relay, not a replay.
The card is a coil and a chip
A contactless card holds a chip and a loop of wire, the antenna, inside the plastic. The standards call the terminal a proximity coupling device (PCD) and the card a proximity integrated circuit card (PICC). The standard for both is ISO/IEC 14443, and it is the radio layer under contactless payments. NFC phones talk to the same kind of card: the NFC Forum says its devices work with ISO/IEC 14443 Type A and Type B readers and cards.
The trick is called induction. A magnetic field that changes through a loop of wire pushes a voltage into that loop. A steady field does nothing. It has to change, and at 13.56 MHz it changes 13.56 million times a second. The Rohde & Schwarz test note for ISO/IEC 14443 puts it in one line: the carrier supplies power to the card “via a transformer coupling and the resulting induced voltage”.
How much voltage? The size of the voltage in a coil is V = 2 * pi * f * mu0 * H * N * A,
where f is the frequency, mu0 is a physical constant, H is the field
strength, N is the number of turns and A is the area of one turn. I ran
the numbers in a container. I had to guess the coil, so take this as a size
estimate and not a spec: 4 turns, 7 cm by 4 cm, and the lowest field the
standard allows, 1.5 amps per metre (A/m).
H = 1.5 A/m -> 1.80 V rms, open circuit
H = 7.5 A/m -> 8.99 V rms, open circuit
So a card sitting in the field gets volts, which is plenty to run a small chip. Real cards differ in turns, size and tuning.
Why it only works within a few centimetres
The standard says the terminal’s field in its working zone is between 1.5 and 7.5 A/m. A card has to run at the low end. Now ask how far you can be before the field drops to 1.5.
For a round loop of radius a, the field on its axis at distance z is
H(z) = H0 / (1 + (z/a)^2)^1.5. Far from the loop, that falls with the cube of
the distance. Researchers at the University of Surrey write the same thing in
their 2013 paper: the field strength “is inversely proportional to the cube of
the distance”.
I drew two readers on the same 3 cm loop. The strong one makes the standard’s maximum of 7.5 A/m at the coil. The weak one makes 3. The card runs out of power at about 4.2 cm for the strong one and 2.3 cm for the weak one. Between 6 cm and 12 cm the field drops from 0.67 to 0.11 A/m, about six times.
The curve shows the shape, not a spec. Real terminal antennas are not round 3 cm loops. The NFC Forum gives “a typical range of up to 2cm” for its own devices. The point is the same: a few centimetres, then nothing.
Powering a card and listening to a card are different jobs. In a shielded lab, the Surrey team used a loop antenna and cheap electronics to listen to an emulated tap. They recovered the messages from 20 to 90 cm away near the 7.5 A/m maximum, and reliably up to 40 cm near the 1.5 A/m minimum. A listener does not need to power anything. It only needs to hear. What it hears is one payment’s worth of data, which the section on copying shows is not much use.
How the two sides talk
A card has no transmitter. Both sides use the one field.
Terminal to card. The terminal switches its field off for a very short moment. The pattern of gaps is the data. The Rohde & Schwarz note lists this for Type A as 100% amplitude-shift keying with modified Miller coding. (There is also a Type B, with 10% modulation. The numbers here are Type A.)
Card to terminal. The card cannot make its own signal, so it changes how much it loads its own coil. It does this at 847.5 kHz, which is the carrier divided by 16. A coil that draws more current is felt by the coil that feeds it, the same way a transformer’s input feels its output. The terminal sees its own carrier swell and dip, 16 carrier cycles per swell, and decodes the pattern. The same note lists this as on-off keying with Manchester coding at 106 kbit/s for Type A. That bit rate is also the carrier divided by 128, and communication always starts there.
What they say to each other
Once the card has power, the terminal and card swap a handful of short messages. This is from a trace of a Visa card in a 2019 Black Hat Europe paper by Leigh-Anne Galloway and Tim Yunusov. Other card schemes use other “kernels” (the terminal software that runs the exchange) and differ in the details.
Four terms from the picture:
- PPSE is the proximity payment system environment. It is a directory on the card that lists which payment apps it carries.
- AID is the application ID of one of those apps, such as a Visa one.
- Cryptogram is the one-time code. The spec calls it the application cryptogram (AC).
- ATC is the application transaction counter. The card adds 1 to it on every transaction.
Not every tap asks for a PIN. Terminals have limits. The UK limit for a card tap went up to £100 in 2021, according to UK Finance. Above a limit, the terminal asks for something extra, such as a PIN or a face or fingerprint check on the phone.
The tap itself only asks the bank to approve. The money moves later, when the shop’s card payments are settled. Payment reconciliation in SQL is about matching those later records to the bank’s.
Why a copied tap does not pay
Suppose a thief records everything in the conversation above. What can they do with it?
The code is a MAC, a message authentication code. It is a short tag made from some data and a secret key. Anyone who has the key can compute it again. Nobody else can make a valid one. The card holds the key inside the chip, and the bank holds the same key. The key never goes over the air.
In the Cambridge paper “Chip and Skim” (arXiv 2012; IEEE S&P 2014), the code the card sends is a MAC over data that includes the amount, a random number from the terminal and the card’s counter (ATC). The bank recomputes it. The paper adds the rule that stops replays: “a competent issuer prevents replay by rejecting any transaction whose application transaction counter it has already seen”.
I wrote a toy version to watch it happen. It uses HMAC-SHA256 from Python’s standard library, not the MAC a real EMV card uses, and it has far fewer fields. I ran it on Python 3.12 in a container.
import hmac, hashlib, os
def mac(key, *fields):
return hmac.new(key, b"|".join(fields), hashlib.sha256).digest()[:8]
class Card:
def __init__(self, key):
self._key = key # never leaves the chip
self.atc = 0 # counter, +1 on every tap
def tap(self, amount, unpredictable):
self.atc += 1
atc = str(self.atc).encode()
return atc, mac(self._key, amount, unpredictable, atc)
class Issuer:
def __init__(self, key):
self.key = key
self.last_atc = 0
def approve(self, amount, unpredictable, atc, code):
if int(atc) <= self.last_atc:
return "declined: counter already seen"
if not hmac.compare_digest(mac(self.key, amount, unpredictable, atc), code):
return "declined: code does not match"
self.last_atc = int(atc)
return "approved"
key = os.urandom(16)
card, bank = Card(key), Issuer(key)
un = os.urandom(4).hex().encode() # the terminal's random number
atc, code = card.tap(b"4.50", un)
print("real tap ", bank.approve(b"4.50", un, atc, code))
print("recording, replayed ", bank.approve(b"4.50", un, atc, code))
print("recording, new amount ", bank.approve(b"450.00", un, b"2", code))
clone = Card(os.urandom(16)) # has the card number, not the key
clone.atc = 1
atc2, code2 = clone.tap(b"4.50", un)
print("clone without the key ", bank.approve(b"4.50", un, atc2, code2))
This is what it printed:
real tap approved
recording, replayed declined: counter already seen
recording, new amount declined: code does not match
clone without the key declined: code does not match
In the “new amount” line I raised the counter by hand to 2, so the counter check passes and only the code check is left to fail. That is the point of the MAC: the thief can change the amount, but cannot change the code to match.
The bank’s counter check is the same idea as an idempotency key: a request that arrives twice must not pay twice. Here the counter is the key, and the card makes a new one each tap.
The part that is easy to get wrong
The counter alone does not prove the code is fresh. A thief could record a code today and play it tomorrow, if the counter has not moved on at the bank. The terminal’s random number is there to fix that. The Cambridge team found that some terminals made their “unpredictable number” from counters, timestamps or home-grown code. If a thief can guess the number the terminal will use tomorrow, they can ask your card for a code for each guess today, and spend them tomorrow. The paper calls this a pre-play attack.
The team probed 22 cash machines and 5 shop terminals, and told the banks and card schemes in early 2012 so the software could be patched. The paper notes that any terminal with a guessable number is exposed in the same way. The fix is a proper random number generator in the terminal.
Phones and tokens
A phone wallet adds two things to the card story.
A stand-in number. EMVCo, the body that runs the EMV standards, defines payment tokenisation. A token replaces the card number with another value that is “constrained in how it can be used”, for example to one device. Apple describes its version: when you add a card, the bank or its service provider makes a device-specific number, the Device Account Number. It is stored in a chip called the Secure Element, and it is never stored on Apple’s servers. At a shop, the Secure Element gives the terminal that number and a transaction code, and Apple says “neither Apple nor your device sends your actual payment card number”.
A check on you. Apple says a payment can be made only after the Secure Element gets the go-ahead from the Secure Enclave, which needs Face ID, Touch ID or the passcode. (Express Mode for transit cards is an exception that Apple lists.) The cryptogram is still made from a counter and a key that the payment network or the issuer knows.
These are different protections from a plastic card’s, not a ranking. A card has the chip key and the counter. A phone has the same, plus a token and a lock on the wallet.
What can still go wrong
Replay, cloning and eavesdropping are covered by the key and the counter. The open problems are elsewhere.
| Attack | What the attacker does | What stops it |
|---|---|---|
| Listen in | Records a tap from a distance | One-time code, so the recording is a replay |
| Replay | Sends the recording again | The bank rejects a counter it has seen |
| Clone from the number | Copies the card number | The code needs the key, which is not on the number |
| Guess the random number | Collects codes ahead of time | A terminal that uses a proper random number generator |
| Relay | Forwards a live tap to another terminal | Timing checks, spend limits, a lock on the phone |
Relay is the one that is hard. The attacker has two devices. One acts as a terminal next to your card. The other acts as a card at a real shop terminal. The two pass messages along a link. Your real card gets a real challenge and gives a real, fresh answer, so the counter and the code are both correct. A 2025 survey of attacks on EMV contactless by researchers at ETH Zurich says this can be built with two NFC Android phones.
In 2022, researchers at Birmingham and Surrey published a paper on this at the IEEE Symposium on Security and Privacy. They showed that relaying could get around the Apple Pay lock screen, and that Visa’s relay countermeasure could be bypassed on rooted phones. They proposed a new relay-resistance protocol and checked it with a formal tool (Tamarin). I have not checked what changed in phones or cards since. The 2025 ETH survey says the relay protection in the kernel it calls Kernel 2 “seems” not yet available in cards or terminals.
The relay needs the attacker’s device within a few centimetres of the target card, which is the same range limit as before.
How common is it?
UK Finance publishes the figures for the United Kingdom. Contactless went from 3% of all UK payments in 2015 to 19% in 2018 and 32% in 2021. In 2023 it was 38%, which was 18.3 billion payments.
The 2015, 2018 and 2021 bars come from the UK Finance summary of 2022. The 2023 bar comes from its press release of July 2024. UK Finance revises its series, so treat the step between 2021 and 2023 as rough.
Update, November 2026: later UK Finance reports put contactless at 18.9 billion payments in 2024 (press release of 1 October 2025) and 19.2 billion in 2025, which UK Finance says was 39% of all payments (press release of 19 August 2026).
Questions people ask
How does a contactless card work without a battery? The terminal makes a magnetic field at 13.56 MHz. The card’s coil sits in it, and a changing field makes a voltage in a coil. The chip runs on that voltage. The card answers by loading its own coil, which the terminal can feel.
How close does a contactless card have to be? A few centimetres. The standard says the terminal’s field is 1.5 to 7.5 A/m, a card has to run on the low end, and the field of a loop falls with the cube of the distance once you are away from it. The NFC Forum quotes a typical range of up to 2 cm for its devices. In a lab, a listener with a loop antenna can hear a tap from much farther, but hearing is not powering.
Is NFC the same as contactless payment? Not quite. NFC is the short-range radio technology at 13.56 MHz, and NFC Forum devices can talk to ISO/IEC 14443 cards and readers. Contactless payment is the EMV payment application that runs on top of that link, with the cryptogram and the counter.
Can someone copy my card by tapping it? A reader that powers the card can get an answer from it. In the trace above the card sends its card number and other fixed data. What the reader cannot copy is the key in the chip, so it cannot make a code the bank will accept for a new payment. The attack that does work is a relay, which forwards a live tap and needs a device next to the card.
Is a phone tap different from a card tap? The radio and the cryptogram are the same kind. The phone sends a token and not the card number, and it checks you first. Apple lists Express Mode as a case where that check is skipped.
Cheat sheet
Further reading
- Rohde & Schwarz application note 1MA113: measurements on RFID components according to ISO/IEC 14443 (carrier, field strength, modulation, bit rates)
- NFC Forum: NFC technology
- EMVCo: EMV Contactless and EMV Payment Tokenisation
- Apple Support: Apple Pay security and privacy overview and Payment authorisation with Apple Pay
- Bond, Choudary, Murdoch, Skorobogatov and Anderson: Chip and Skim, cloning EMV cards with the pre-play attack (Cambridge; arXiv 2012, IEEE S&P 2014)
- Galloway and Yunusov: First Contact, new vulnerabilities in contactless payments (Black Hat Europe, 2019)
- Diakos, Briffa, Brown and Wesemeyer: Eavesdropping near-field contactless payments, a quantitative analysis (University of Surrey, 2013)
- Radu, Chothia, Newton, Boureanu and Chen: Practical EMV relay protection (IEEE S&P 2022)
- Hofmeier, Basin, Sasse and Toro-Pozo: SoK, attacks on modern card payments (ETH Zurich, 2025)
- UK Finance press release on the Payment Markets Report, July 2024
- Idempotency keys explained on this site
- Payment reconciliation in SQL on this site