Contactless Pay

Contactless Payment Security

How Contactless Payments Work

When you tap your card or phone at a payment terminal, a surprisingly complex cryptographic protocol executes in under half a second. The interaction looks simple - tap, beep, done - but underneath, the card and terminal are exchanging multiple messages, performing real-time cryptographic computations, and generating unique transaction authorization codes.

Contactless payments use NFC (Near-Field Communication) operating at 13.56MHz, following the ISO 14443 standard. The communication range is intentionally limited to about 4cm, though the card will respond at slightly greater distances depending on the reader's antenna and power output.

The payment protocol used is EMV (Europay, Mastercard, Visa) - the same standard used for chip cards, adapted for the contactless interface. EMV contactless adds the ISO 14443 radio layer but uses substantially the same application-level protocol as contact (chip-and-PIN) transactions.

Every major card network has its own contactless specification built on EMV: Visa payWave, Mastercard PayPass, American Express ExpressPay, and Discover D-PAS. While the details differ, the fundamental security model is shared across all of them.

The EMV Contactless Protocol

sequenceDiagram
    participant Terminal as Payment Terminal
    participant Card as Contactless Card
    participant Network as Card Network
    participant Issuer as Issuing Bank
    
    Terminal->>Card: SELECT PPSE (2PAY.SYS.DDF01)
    Card->>Terminal: List of supported applications
    Terminal->>Card: SELECT Application (AID)
    Card->>Terminal: Application data + PDOL
    Terminal->>Card: GET PROCESSING OPTIONS (PDOL data)
    Card->>Terminal: AIP + AFL (card capabilities)
    Terminal->>Card: READ RECORD(s)
    Card->>Terminal: Card data (PAN, expiry, certificates)
    
    Note over Terminal,Card: Offline Data Authentication (SDA/DDA/CDA)
    Note over Terminal: Terminal decides: online or offline?
    
    Terminal->>Card: GENERATE AC (transaction data)
    Note over Card: Card computes cryptogram using secret key
    Card->>Terminal: Application Cryptogram (ARQC/TC)
    
    Terminal->>Network: Authorization request + cryptogram
    Network->>Issuer: Validate cryptogram + authorize
    Issuer->>Network: Approval/Decline
    Network->>Terminal: Authorization response
    Terminal->>Card: EXTERNAL AUTHENTICATE (optional)

EMV contactless payment flow - from tap to authorization in under 500ms

A contactless EMV transaction follows these steps:

Step 1 - Application Selection: The terminal sends a SELECT command for PPSE (Proximity Payment System Environment), which is the NFC equivalent of asking "what payment apps do you have?" The card responds with a list of supported payment applications (Visa, Mastercard, etc.). The terminal selects one.

Step 2 - Application Initialization: The terminal sends GET PROCESSING OPTIONS with terminal-specific data (merchant type, transaction amount, currency, date, terminal capabilities). The card responds with its capabilities and a list of data files to read.

Step 3 - Data Reading: The terminal reads the card's data records, which include the Primary Account Number (PAN), expiration date, cardholder name, and public key certificates for offline authentication.

Step 4 - Offline Data Authentication: The terminal verifies the card's authenticity using one of three methods: Static Data Authentication (SDA), Dynamic Data Authentication (DDA), or Combined DDA with Application Cryptogram Generation (CDA). Modern contactless cards use CDA, which provides the strongest assurance that the card is genuine.

Step 5 - Cryptogram Generation: The terminal asks the card to generate an Application Cryptogram - a cryptographic MAC (Message Authentication Code) computed over the transaction data using a secret key stored in the card's secure chip. This is the core security mechanism.

Step 6 - Online Authorization: The terminal sends the cryptogram and transaction data to the card network, which routes it to the issuing bank. The bank independently computes what the cryptogram should be (using its copy of the key) and compares. If they match, the transaction is genuine and the bank approves or declines based on the account status.

Cryptographic Security

The security of contactless payments rests on several cryptographic mechanisms working together:

Dynamic Cryptograms

The Application Cryptogram (AC) is the most important security feature. It is a MAC computed using a symmetric key derived from a master key unique to each card. The inputs to the MAC include transaction-specific data: the amount, currency, date, terminal-generated random number, and a transaction counter.

Because the cryptogram is unique to each transaction, capturing one transaction's data does not help an attacker authorize a different transaction. Even if you eavesdrop on a contactless payment and capture every byte exchanged, you cannot use that data to make another purchase. The cryptogram from transaction #1 is invalid for transaction #2.

Card Authentication

Offline Data Authentication (ODA) proves that the card is genuine and its data has not been tampered with. CDA (the strongest form) uses RSA public-key cryptography: the card signs a dynamic challenge with a private key embedded in the chip, and the terminal verifies the signature using a certificate chain rooted in the card network's CA. Cloning a card would require extracting the private key from the tamper-resistant chip, which is designed to resist exactly that.

What Cannot Be Done Without the Key

The card's secret keys are stored in a secure IC that is designed to resist physical and logical attacks. The keys are written during manufacturing (personalization) and cannot be read through the NFC interface. The card will use its keys to compute cryptograms on demand, but it will never reveal the keys themselves.

This means an attacker who intercepts a contactless transaction captures data that is mathematically useless for creating future transactions. They get the PAN (card number) and expiration date - which are also printed on the physical card - but not the keys needed to generate valid cryptograms.

Tokenization: Mobile Payment Security

graph TD
    subgraph Physical_Card["Physical Contactless Card"]
        PC_PAN["Real PAN: 4532-XXXX-XXXX-1234"]
        PC_Key["Card Master Key"]
        PC_Crypto["Cryptogram computed\nwith real PAN"]
    end
    subgraph Mobile_Payment["Mobile Payment (Apple Pay/Google Pay)"]
        MP_Token["Token PAN: 4532-XXXX-XXXX-9876"]
        MP_SE["Secure Element / HCE"]
        MP_Key["Token-specific Key"]
        MP_Crypto["Cryptogram computed\nwith token PAN"]
        MP_Auth["Biometric/PIN required\nbefore NFC active"]
    end
    subgraph Token_Service["Token Service Provider (TSP)"]
        TSP_Map["Maps Token to Real PAN"]
        TSP_Validate["Validates token cryptogram"]
        TSP_Domain["Domain restrictions\n(merchant, device, channel)"]
    end
    subgraph Processing["Transaction Processing"]
        Merchant["Merchant / Terminal"] --> Acquirer["Acquiring Bank"]
        Acquirer --> Network["Card Network"]
        Network --> TSP_Map
        TSP_Map --> Issuer["Issuing Bank"]
        Issuer --> Approve["Approve / Decline"]
    end
    Mobile_Payment -->|"Presents token + cryptogram"| Merchant

Tokenization in mobile payments - the real card number never reaches the merchant

Mobile payment platforms add an additional security layer called tokenization. When you add a card to Apple Pay or Google Pay, the token service provider (operated by the card network) generates a substitute card number - a token PAN - that is linked to your real card but is distinct from it.

When you pay with your phone, the token PAN is used in the transaction instead of your real card number. The merchant never sees your actual card number. The card network's token service maps the token back to your real PAN during processing.

Tokenization provides several security benefits:

Limited scope: A token can be restricted to a specific device, merchant, or channel. If a token is compromised, it cannot be used on a different device or at a different merchant.

No card number exposure: The merchant and their payment infrastructure never handle your real card number, eliminating the risk of card number theft from merchant data breaches.

Remote deactivation: Tokens can be suspended or deleted remotely without affecting the underlying card. If your phone is stolen, you can deactivate the token without canceling and replacing your physical card.

User authentication: Mobile payment platforms require biometric authentication (Face ID, fingerprint) or a device PIN before activating the NFC payment interface. This is a significant security improvement over physical contactless cards, which respond to any reader without cardholder verification.

The Attack Surface

Despite the strong cryptographic protections, contactless payments have an attack surface that security researchers have explored extensively:

Eavesdropping

The NFC communication between card and terminal can be intercepted with sensitive receiving equipment. Research has shown that the reader's signal can be detected at distances up to 10 meters, and the card's weaker response at about 1 meter. An eavesdropper can capture the PAN, expiration date, and sometimes the cardholder name.

However, the captured data is of limited utility. The dynamic cryptogram cannot be reused, and without the card's secret keys, new cryptograms cannot be generated. The PAN and expiration date could potentially be used for online (card-not-present) fraud, but most issuers require the CVV2 (the three-digit code on the back of the card) for online transactions, and the CVV2 is not transmitted during contactless payments.

Pre-play Attacks

Researchers have explored "pre-play" attacks where an attacker induces the card to generate cryptograms for predicted future transaction parameters. If the attacker can predict what values the terminal will use (transaction counter, random number), they could pre-generate valid cryptograms.

In practice, the unpredictable terminal-generated random number makes pre-play attacks difficult. However, research has shown that some terminals generate weak random numbers, and some protocol variants do not include all the unpredictable fields in the cryptogram computation. These are implementation weaknesses rather than protocol weaknesses.

Downgrade Attacks

Some research has demonstrated the ability to manipulate the terminal-card negotiation to downgrade the security level - for example, forcing an offline transaction when the issuer intended online authorization, or downgrading the cryptogram type. Modern EMV specifications have mitigations against most downgrade attacks, but legacy terminals and cards may still be vulnerable.

Relay Attacks on Payments

The most practical attack on contactless payment security is the relay attack, which we cover in depth in our NFC relay attacks article. Briefly: a relay attack extends the NFC communication range by forwarding messages between two proxy devices, defeating the proximity assumption without breaking any cryptography.

The cryptogram is valid because the real card computed it. The authentication checks pass because the card genuinely participated. The only thing that was violated is the assumption that the cardholder was physically present at the terminal.

Relay attacks are the most discussed threat because they work against the protocol as designed. Every other attack targets implementation weaknesses - relay attacks target a fundamental limitation of any short-range protocol that lacks distance bounding.

Transaction Limits and PIN Requirements

Contactless transaction limits are a pragmatic risk management measure. Different countries and card networks impose different limits:

  • United Kingdom: 100 GBP per transaction
  • European Union: 50 EUR per transaction (varies by country)
  • United States: Varies by issuer, typically $100-$250
  • Canada: 250 CAD per transaction
  • Australia: 200 AUD per transaction

Above the contactless limit, the terminal requires chip-and-PIN or another cardholder verification method. Many networks also impose cumulative limits - after a certain number of consecutive contactless transactions or a total spend amount, PIN verification is required regardless of the individual transaction amount.

Mobile payments often have higher or no contactless limits because the user has already authenticated (via biometric or device PIN). Apple Pay transactions, for example, are typically not subject to the same contactless limits as physical card taps.

Real-World Fraud Cases

Contactless payment fraud is surprisingly rare relative to the volume of transactions. Card networks report that contactless fraud rates are comparable to or lower than chip-and-PIN fraud rates. Several factors contribute to this:

Dynamic cryptograms work: The inability to replay or forge transactions eliminates the most scalable fraud vectors. Unlike magnetic stripe data (which can be cloned and reused), contactless transaction data is genuinely single-use.

Transaction limits cap losses: Even a successful attack on a contactless card is limited to relatively small amounts before PIN verification is triggered.

Physical proximity required: Contactless fraud requires the attacker (or their relay equipment) to be physically near the victim and a payment terminal. This is higher-risk and lower-reward than remote fraud methods.

The most documented real-world contactless fraud scenarios involve:

Lost/stolen cards: A thief who steals a contactless card can make purchases below the contactless limit without knowing the PIN. This is the most common contactless fraud vector and is mitigated by cumulative limits and rapid card cancellation.

Skimming for PAN: Attackers using concealed readers to harvest card numbers for online fraud. This captures the PAN but not the CVV2 or cryptographic keys, limiting its utility.

Relay fraud: While demonstrated repeatedly by researchers, documented cases of criminal relay fraud against contactless payments are rare. The logistics, coordination, and risk-to-reward ratio make it less attractive than other fraud methods.

Myths vs Reality

Contactless payment security generates a lot of misinformation. Here are some common claims, evaluated:

"Someone can steal money from my card by walking past me with a reader." This is technically possible (relay attack) but extremely rare in practice. The attacker needs a payment terminal linked to a merchant account (creating a traceable financial trail), and the transaction is limited by contactless limits. The risk is real but often overstated.

"Contactless is less secure than chip-and-PIN." For transactions below the contactless limit, contactless does skip PIN verification, which is a trade-off of convenience for security. However, the cryptographic protocol is equally strong. For mobile payments with biometric authentication, the security is arguably stronger than chip-and-PIN.

"I need an RFID-blocking wallet." RFID-blocking wallets prevent unwanted card interrogation and are a valid precaution for physical contactless cards. They are unnecessary for phone-based payments since the phone requires active user authentication. Whether the precaution is worth the cost depends on your personal risk tolerance.

"Contactless payments can be intercepted from meters away." The communication can be eavesdropped at a distance with specialized equipment, but the intercepted data cannot be used to create new transactions. The PAN exposure is a minor risk, but the cryptogram-protected transaction data is useless to an eavesdropper.

Conclusion

Contactless payment security is robust. The combination of dynamic cryptograms, offline data authentication, tokenization (for mobile payments), and transaction limits creates a multi-layered defense that is difficult to defeat in practice.

The most significant remaining vulnerability is the relay attack, which defeats the proximity assumption without breaking cryptography. Distance bounding protocols and mobile payment authentication (requiring biometrics before NFC activation) are the strongest countermeasures against this threat.

For consumers, the practical advice is straightforward: mobile payments (Apple Pay, Google Pay) are more secure than physical contactless cards because they require active authentication. An RFID-blocking wallet adds protection for physical cards. And the overall fraud risk from contactless payments is lower than most people assume.

If you are interested in exploring wireless security protocols hands-on, the BLEShark Nano supports BLE 5.0 and WiFi for security research and learning.

Get the BLEShark Nano - $49.99

This article is for educational purposes. Security testing of payment systems requires explicit authorization from the card issuer and payment network. Unauthorized testing may violate multiple laws and regulations.

Back to blog

Leave a comment