Explain EMV cryptogram detection

Student

Professional
Messages
1,387
Reaction score
1,048
Points
113
Here is a comprehensive, in-depth explanation of EMV cryptogram detection, covering every major aspect: cryptographic construction, session key derivation, data elements, differences between brands (Visa vs Mastercard vs Amex vs others), detection methods at every level of the payment chain, modern enhancements (AES, CDA, relay attack resistance), and real-world attack vectors that cryptogram checks are designed to stop.

1. What the Cryptogram Actually Protects Against​

The EMV cryptogram (ARQC/TC/AAC in tag 9F26) simultaneously proves four things in a single 8- or 16-byte value:
  1. Card authenticity – only a card possessing the correct symmetric keys can produce a valid cryptogram.
  2. Data integrity – the amount, currency, date, unpredictable number, etc., are exactly the same as what the card saw.
  3. Liveness/freshness – because the unpredictable number (UN) from the terminal and the ATC are included.
  4. Card decision – whether the card wants the transaction to go online (ARQC), be approved offline (TC), or declined (AAC).

2. Detailed Session Key Derivation (How the Card and Issuer Arrive at the Same Key)​

Modern cards use one of two methods:

A. Common Legacy Method (3DES, still dominant in 2025)​

  • Card has a unique 16-byte (double-length) master key (UDK = Unique DES Key) per card, derived from issuer master key + PAN + PAN sequence number.
  • During transaction, two session keys are derived from the ATC using 3DES-based diversification:
    • SK_AC (Session Key for Application Cryptogram) = 3DES(UDK, ATC || 0xF0… ) ⊕ 3DES(UDK, ATC || 0x0F… )
    • SK_MAC (sometimes used for other MACs)
  • Result: 16-byte (double-length) 3DES session key unique per transaction.

B. Modern AES Method (Visa AES, Mastercard M/Chip Advance with AES, UnionPay, etc.)​

  • Issuer master key is an AES-128 or AES-256 key.
  • Session key = AES-CMAC(IMK-AC, ATC || 0x00… || 0x80 0x00…)
  • Usually produces 16-byte AES session key even if master key is 128-bit.

Both methods guarantee that the issuer can re-derive exactly the same session key using only data that travels in the authorization message (PAN, ATC, etc.).

3. Exact Data That Goes Into the Cryptogram Calculation​

The card builds an array called the AC Session Data (different per brand, but very similar).

Visa (VISA Contact & Visa payWave – VSDC / qVSDC)​

Data concatenated before MAC (simplified): [Method] || [ATC] || [Cryptogram Version Number] || [Amount Authorized] || [Amount Other] || [Terminal Country Code] || [TVR] || [Transaction Currency Code] || [Transaction Date] || [Transaction Type] || [Unpredictable Number] || [IAD (optional padding)]

MAC algorithm: 3DES (legacy) or AES-CMAC (newer cards).

Mastercard (M/Chip Advance, Contact & Contactless)​

Uses Common Core Definitions (CCD) compliant data: [ATC] || [Cryptogram Version] || [Amount Auth] || [Amount Other] || [Country Code] || [Currency Code] || [Date] || [UN] || [TVR] || [Transaction Type] || [Padding 0x00 if needed]

MAC algorithm: 3DES or AES-CMAC depending on profile.

4. Cryptogram Types in Detail​

CID (9F27)MeaningWhen IssuedIssuer Expected Action
80ARQCCard wants online authorizationMust go online and verify cryptogram
40TCOffline approvalTransaction approved without issuer check
00AACCard declines (limit exceeded, expired, etc.)Transaction must be declined
10AAR (Application Advisory)Rare, usually for referralUsually decline

5. Cryptogram Detection and Validation at Every Layer​

LayerChecks PerformedWhat It Catches
Terminal / POS• 9F26 present? • CID = 80 when online expected? • ATC > previous ATC? • CVN (Cryptogram Version Number) supported?Obvious fakes, replay of old PDOL data, stripped cards
Acquirer / GatewaySame as terminal + sometimes basic format checks + ATC database per PANOrganized replay attacks across many terminals
Network (VisaNet, Banknet, etc.)Minimal checks, just routingAlmost none
Issuer Host (HISO/ACS)Full cryptographic verification: 1. Re-derive session key 2. Rebuild exact same data string 3. Compute MAC 4. Compare with 9F26Fake cards, pre-play, relay, data manipulation, yes-cards

Only the issuer host can perform the real, unbreakable check.

6. Modern Enhancements That Make Attacks Harder​

FeatureYear IntroducedWhat It Prevents
Combined DDA/AC (CDA)~2007 (contactless)Man-in-the-middle on contactless (card signs the cryptogram with static RSA key)
Dynamic Data Authentication (DDA) fallback checkAlwaysEnsures card has private key even if offline
AES cryptograms~2015–2020Much harder brute-force or key-recovery attacks
Strict ATC checking + velocityOngoingPre-play attacks (record 10 000 ARQCs and try to reuse)
Online-only CAMMastercard 2020+Forces online cryptogram even for low-value contactless
Transaction timestamp checksSome issuersRelay attacks that introduce large delays

7. Real-World Attacks That Cryptogram Checks Stopped​

Attack NameYear(s)How It WorkedHow Cryptogram Verification Stopped It
Pre-play attack2010–2014Record many ARQC/ARPC pairs from real card, later replay suitable oneIssuer recomputes cryptogram — replayed one never matches current UN + amount
Yes-card2009–2012Card always returns TC offline regardless of PIN/amountTerminals started forcing online for high amounts + CDA
Wedge/relay attackOngoingReal card in victim’s pocket approves relayed transactionCDA + strict timing + online CAM largely defeats it
Mag-stripe fallback fraud2015–2020Chip blocked → force mag-stripeRegions disabled fallback entirely
Truncated ARQC attack2011Send only first 4 bytes of ARQCTerminals began requiring full 8 bytes

8. Practical Example of a Failed Cryptogram (What the Issuer Sees)​

Code:
Received ARQC: 1122334455667788
Issuer recomputes using correct key → expected: AABBCCDDEEFF0011
→ Mismatch → Response code 05 (Do not honour) or A1 (cryptogram error)

No human ever sees this — it is fully automated and happens in <200 ms.

Conclusion​

EMV cryptogram detection is the single strongest anti-fraud mechanism in modern payments. When implemented correctly (especially full issuer verification + CDA for contactless), it makes card-present counterfeit fraud essentially impossible without physically stealing the card and PIN or performing a real-time relay attack (which is extremely hard at scale).

Even in 2025, after 25+ years of attacks, no practical break of correctly implemented EMV cryptogram verification exists when the transaction actually reaches the issuer for online verification. This is why liability shift rules place the liability on whoever did not support proper chip cryptograms.
 
Top