EMV chip keys: IMK → card key → session key → ARQC
A stripe is a static recording; copy it and you have the card. A chip instead computes a fresh cryptogram for every transaction with a key that never leaves it. This module follows one transaction from the issuer’s master key to the chip and back.
- explain derivation: one IMK, millions of card keys;
- compute an ARQC and an ARPC with all intermediate steps;
- say what each issuer master key (AC, SMI, SMC, IDN, CVC3) is for;
- explain why the card bureau and the network need these keys.
1. Three levels of keys
- Derivation, not storage. The issuer doesn’t store millions of card keys. It keeps one IMK (Issuer Master Key) and re-derives any card’s key on the fly from the PAN and PAN sequence number (PSN). EMV (Europay, Mastercard, Visa — the chip card standard) “Option A”: encrypt the last 16 digits of PAN‖PSN with the IMK for the left half, encrypt their inverse for the right half.
- One compromised card ≠ compromised BIN. Extracting a card’s key (very hard) gives you one card. Derivation is one-way: you can’t go from the card key back to the IMK.
- Session keys mix in the application transaction counter (ATC), so each transaction uses a different key.
2. ARQC and ARPC
At the terminal, the card signs the transaction data — amount, currency, date, terminal country, an unpredictable number from the terminal, its own ATC — with the session key. That MAC is the ARQC (Authorisation Request Cryptogram). The issuer recomputes it; if it matches, the card is genuine and the data unaltered. The issuer answers with an ARPC (Authorization Response Cryptogram), which the card checks to know the approval really came from its issuer.
Play: change the amount by one cent. The ARQC changes completely. Change the ATC: new session key, new ARQC. That’s why replaying an old cryptogram fails.
3. The issuer master keys and what each is for
| Key | Also called | TR-31 | Used for |
|---|---|---|---|
| MK-AC | IMK-AC, MDK, “card master key” | E0 | Application cryptograms: ARQC, TC, AAC; ARPC |
| MK-SMI | IMK-SMI, MAC key | E2 | Secure messaging integrity: MAC on issuer scripts sent to the card (block the card, change limits, PIN change) |
| MK-SMC | IMK-SMC, “encryption key” | E1 | Secure messaging confidentiality: encrypt data in scripts, e.g. the new PIN |
| MK-IDN | ICC dynamic number master key | E4 | Mastercard: a per-transaction dynamic number from the card |
| MK-CVC3 | CVC3 key | (vendor-specific) | Mastercard contactless mag-stripe mode: dynamic CVC3 instead of a static CVC1 |
| CVK | CVC key, CSCK | C0 | Static CVV/CVC1, CVV2/CVC2, iCVV (module 5) |
A key “set” for a new BIN is therefore typically: MK-AC, MK-SMI (Master Key for Secure Messaging Integrity), MK-SMC (+ MK-IDN, MK-CVC3 for Mastercard contactless) and a CVK (Card Verification Key) — each with its own KCV (Key Check Value).
4. Contactless: dynamic CVC3
Older contactless cards emulate a magnetic stripe. To stop that data being replayed, a card computes a dynamic CVC3 (Card Verification Code 3, dynamic, for contactless) per tap from its CVC3 key, the terminal’s unpredictable number and the ATC, and puts it into the track data.
5. Who needs these keys
- Card bureau (personalisation): derives each card’s keys from the IMKs and writes them into the chip. Needs MK-AC, MK-SMI, MK-SMC (Master Key for Secure Messaging Confidentiality), MK-IDN (Master Key for the ICC Dynamic Number)/CVC3, and the CVK for iCVV and CVV (Card Verification Value) values.
- Issuer processor: verifies ARQCs, generates ARPCs and scripts. Needs all of them.
- Network: only if it verifies cryptograms on the issuer’s behalf (stand-in processing, on-behalf services). Typically MK-AC and CVK.
Exercises
Which key is physically on the chip?
- IMK-AC
- The card’s own MK-AC (derived from the IMK)
- All future session keys
Which issuer master key protects the confidentiality of a new PIN (Personal Identification Number) sent to the card in a script?
- MK-SMI
- MK-SMC
- MK-AC
Hint
The pipeline widget shows ① card master key — set IMK, PAN and PSN.Hint
Fill the pipeline widget. The amount is 12 digits; ATC is 4 hex digits.A criminal records a genuine ARQC at a shop and replays it later for the same amount at another terminal. Why does it fail?
- The unpredictable number and ATC differ, so the issuer’s recomputed ARQC won’t match
- The issuer keeps a list of all used ARQCs
- The terminal checks it against the card
You receive a new BIN’s key set from the bureau as TR-31 (ANSI X9 Technical Report 31, the key block format) blocks. One block has header B0096E0TX00E0000…, another B0096E1TX00E0000…. A colleague mapped them in the config as “Card Master Key” and “Encryption Key”. Are they right?
- Yes: E0 is MK-AC and E1 is MK-SMC
- No: E1 is the integrity key
- No: E0 is the CVK