All entries
Chapter VIII
Journal · 24 Nov 2026 · 13 min read

EMV ARQC vs TC vs AAC: TVR and Field 55 Decoded

ARQC vs TC vs AAC explained with tested Visa CVN 18 vectors: decoding tag 9F27, every EMV 4.4 TVR bit, field 55 tags and ARPC Method 1 vs 2.

Change one bit of the TVR between the chip and the issuer and a genuine card gets declined. In the tested Visa CVN 18 example below, setting the last bit of tag 95 moves the cryptogram from 7A788EA6B8A3E733 to BE4FF51F1D3C1699, and the issuer's HSM rejects it as a forgery.

Visa warned acquirers about this in a bulletin dated 21 November 2019, after production contactless declines traced back to terminals reporting TVR bits the card never saw. The pages ranking for these questions don't join it up. The ARQC results are AWS and IBM API references, the Wikipedia TVR table predates EMV 4.4, and the tag dictionaries for 9F27 stop at the top two bits. This guide covers the chain end to end, with every cryptogram reproduced in Python against published test vectors.

ARQC vs TC vs AAC: What Each EMV Cryptogram Means

All three are 8-byte MACs the card computes over the same transaction data with the same key. What differs is the decision, which the card signals in a separate tag, 9F27, not in the cryptogram.

CryptogramFull nameCID bits 8-7 / GENERATE AC P1Card is saying
ARQCAuthorisation Request Cryptogram10 / 0x80Ask the issuer
TCTransaction Certificate01 / 0x40Approve
AACApplication Authentication Cryptogram00 / 0x00Decline

The terminal requests one and the card answers with the same or lower, in the order TC > ARQC > AAC. Ask for a TC and you can get any of the three; ask for an AAC and that is all you get. EMV 4.4 Book 3 treats a higher cryptogram than requested as an ICC logic error.

After an online authorisation the terminal sends a second GENERATE AC, which can only return a TC or an AAC, and a third attempt gets status word 6985. The case that catches people is the issuer approving and the card then returning an AAC, usually because issuer authentication failed. The terminal must decline, and your host owes the issuer a reversal. If you have read my ISO 8583 guide, that is a 0400 you generate yourself.

How Does a Terminal Decide Which Cryptogram to Request?

Terminal action analysis (Book 3, section 10.7) compares the TVR against three pairs of bitmasks. Issuer Action Codes come from the card: IAC-Denial (9F0E), IAC-Online (9F0F) and IAC-Default (9F0D). Terminal Action Codes come from acquirer configuration. The order is fixed:

1. Denial. Any TVR bit also set in IAC-Denial or TAC-Denial: request an AAC. 2. Online. An online-only terminal requests an ARQC. An online-capable one requests an ARQC if any TVR bit matches IAC-Online or TAC-Online, otherwise a TC. 3. Default. Only when the terminal is offline-only or could not reach the host. A match gives an AAC, otherwise a TC.

The missing-value defaults are where people go wrong. An absent IAC-Denial is all zeros, but an absent IAC-Online or IAC-Default is all ones, so a card that omits them sends everything online and declines anything that can't get there. A missing TAC is all zeros, which is why Book 3 recommends TAC-Online and TAC-Default set at least the offline authentication failure bits: otherwise a counterfeit card with all-zero IACs can approve itself offline.

When the terminal decides offline it writes its own code into tag 8A: Y1 offline approved, Z1 offline declined, Y3 and Z3 for approved or declined because it could not go online.

How to Decode Cryptogram Information Data (Tag 9F27)

One byte, defined in Book 3 Table 15:

BitsMeaning
8-700 AAC, 01 TC, 10 ARQC, 11 RFU
6-5Payment system specific cryptogram
4Advice required
3-1000 no information, 001 service not allowed, 010 PIN Try Limit exceeded, 011 issuer authentication failed

So 80 is a plain ARQC and 40 a plain TC. 0A is an AAC with advice required because the PIN Try Limit was exceeded, currently the only advice case the spec defines. 01 is an AAC refused over a usage restriction. Book 4 says the CID need not be forwarded to the issuer, but most acquirer specs require 9F27 in field 55 regardless.

TVR Decoding: Every Tag 95 Bit in EMV 4.4

The Terminal Verification Results are five bytes of flags the terminal sets as it goes. EMV 4.4 (October 2022) filled bits that older tables still show as RFU, marked ★.

ByteBit (mask)Meaning
18 (80)Offline data authentication not performed
17 (40)SDA failed
16 (20)ICC data missing
15 (10)Card on terminal exception file
14 (08)DDA failed
13 (04)CDA failed
12 (02)SDA selected
11 (01)XDA selected ★
28 (80)ICC and terminal application versions differ
27 (40)Expired application
26 (20)Application not yet effective
25 (10)Requested service not allowed for card product
24 (08)New card
22-1 (02, 01)Biometric successful; biometric template format not supported ★
38 (80)Cardholder verification not successful
37 (40)Unrecognised CVM
36 (20)PIN Try Limit exceeded
35 (10)PIN required, PIN pad not present or not working
34 (08)PIN required, PIN pad present, PIN not entered
33 (04)Online CVM captured (formerly "Online PIN entered")
32-1 (02, 01)Biometric device not working; biometric entry bypassed ★
48 (80)Transaction exceeds floor limit
47 (40)Lower consecutive offline limit exceeded
46 (20)Upper consecutive offline limit exceeded
45 (10)Randomly selected for online processing
44 (08)Merchant forced transaction online
43-1 (04, 02, 01)Biometric try limit exceeded; biometric type not supported; XDA signature failed ★
58 (80)Default TDOL used
57 (40)Issuer authentication failed
56 (20)Script processing failed before final GENERATE AC
55 (10)Script processing failed after final GENERATE AC
53-2 (04, 02)CA ECC key missing; ECC key recovery failed ★

Byte 5 bits 4 and 1 are reserved for the contactless specifications, and this is where single-table decoders break. Mastercard's Kernel 2 uses byte 5 bits 4 to 1 for relay resistance status, overlapping the ECC bits EMV 4.4 added for contact. Decode byte 5 per kernel.

Three values you will see constantly. 0000008000 is a floor limit breach and nothing else. 8000048000 adds no offline authentication and an online CVM, typical of an online-PIN card. 0000000000 is normal on Visa contactless, because the Visa kernel feeds the card an all-zero TVR, which is exactly why rewriting it in the authorisation breaks the cryptogram.

Which EMV Tags Go in ISO 8583 Field 55?

Book 4 sets the minimum ICC data for an authorisation (cryptogram, AIP, ATC, IAD, TVR, unpredictable number, amounts, PAN sequence number, country, currency, date and type), and acquirers add CVM Results, Terminal Capabilities and Terminal Type. Here is a 113-byte field 55 built from the test vector in the next section:

9F26087A788EA6B8A3E7339F2701809F100706011203A0B8009F370452BF45859F3602001C
950580000480009A031911059C01019F02060000000040005F2A020124820218009F1A020124
9F03060000000000009F34034203009F3303E040C89F3501148407A00000000310105F340100

Decoded with a short BER-TLV parser:

TagNameValueReads as
9F26Application Cryptogram7A788EA6B8A3E733The ARQC
9F27CID80ARQC, no advice
9F10Issuer Application Data06011203A0B800Visa: DKI 01, CVN byte 12, CVR 03A0B800
9F36ATC001C28th transaction on this card
95TVR8000048000No ODA, online CVM, over floor limit
9A / 9CDate / type191105 / 015 Nov 2019, cash withdrawal
9F02 / 5F2AAmount / currency000000004000 / 0124CAD 40.00
82AIP1800No SDA, DDA or CDA support
9F34CVM Results420300Online PIN, result "unknown"
9F35Terminal Type14Unattended, financial institution

The AIP explains the TVR: a card that supports no offline authentication method always sets byte 1 bit 8. And 9F34 ends in 00 (unknown) for online PIN because the terminal never learns whether the issuer accepted the PIN.

The split that matters is between tags inside the MAC and tags along for the ride. For Visa CVN 18 the issuer rebuilds the input from 9F02, 9F03, 9F1A, 95, 5F2A, 9A, 9C, 9F37, 82, 9F36 and 9F10. Rewrite any of those in a gateway and the ARQC fails. 9F33, 9F34, 9F35 and 84 are outside the MAC here.

How Is an ARQC Calculated? A Tested Visa CVN 18 Example

The vector comes from the test suite of pyemv, an open-source Python EMV library. I reimplemented it with cryptography 50 rather than running the library, and it matches, as do the CVN 10, Mastercard and ARPC vectors in the same file. Test keys only; production issuer keys never leave an HSM.

from cryptography.hazmat.decrepit.ciphers.algorithms import TripleDES
from cryptography.hazmat.primitives.ciphers import Cipher, modes

def des(key, block, decrypt=False): key = key * 3 if len(key) == 8 else key + key[:8] # DES or 2-key TDES c = Cipher(TripleDES(key), modes.ECB()) op = c.decryptor() if decrypt else c.encryptor() return op.update(block) + op.finalize()

def xor(a, b): return bytes(x ^ y for x, y in zip(a, b))

def option_a(mdk, pan, psn): # EMV Book 2, A1.4.1 y = bytes.fromhex((pan + psn)[-16:].rjust(16, "0")) return des(mdk, y) + des(mdk, xor(y, b"\xff" * 8))

def session_key(mk, atc): # EMV common session key, A1.3.1 return des(mk, atc + b"\xf0" + bytes(5)) + des(mk, atc + b"\x0f" + bytes(5))

def retail_mac(key, data, method=2): # ISO/IEC 9797-1 MAC algorithm 3 if method == 2: data += b"\x80" data += bytes(-len(data) % 8) h = bytes(8) for i in range(0, len(data), 8): h = des(key[:8], xor(h, data[i:i + 8])) return des(key[:8], des(key[8:], h, decrypt=True))

H = bytes.fromhex udk = option_a(H("0123456789ABCDEFFEDCBA9876543210"), "1234567890123456", "00") sk = session_key(udk, H("001C")) data = H("000000004000" "000000000000" "0124" "8000048000" "0124" "191105" "01" "52BF4585" "1800" "001C" "06011203A0B800") print(retail_mac(sk, data).hex().upper()) # 7A788EA6B8A3E733

Option A encrypts the rightmost 16 digits of PAN plus sequence number (3456789012345600) and their complement under the issuer master key. With parity adjusted, the card key is 154F349D8585CB7F6B0798E9839B10C1 (KCV BAB0) and the ATC-derived session key is 436B942AD637E08564B532B0EC97CB26 (KCV 22C8). The 40-byte input is already block-aligned, so method 2 padding adds a whole block of 80 00 00 00 00 00 00 00. Get the padding wrong and you get a different cryptogram that looks just as plausible.

Visa CVN 10 vs CVN 18 vs Mastercard: What Changes

Same master key, PAN and ATC throughout. The Mastercard vectors use different transaction data, so compare structure, not values.

Visa CVN 10Visa CVN 18Mastercard, own session keyMastercard, EMV session key
MAC keyCard key directlyEMV CSK from ATCSession key from ATC and UNEMV CSK from ATC
PaddingMethod 1 (zeros)Method 2 (80)Method 2Method 2
Issuer data in input4-byte CVRFull 9F106-byte CVR6-byte CVR
Test ARQC29CCA15AE665FA2E7A788EA6B8A3E73324CCF3DEE3158C70CD29615D6452E70E
AWS derivation memberVisaEmvCommonMastercardEmvCommon
payShield commandKQKWKQKW

The trade-off is replay resistance. CVN 10 uses one static key per card, so only the ATC and unpredictable number inside the MAC input stop a replay. Session-key versions change the key every transaction, and Mastercard's own derivation pulls the terminal's unpredictable number into the key itself. CVN 22 uses the same session key and MAC as CVN 18; AWS says only the transaction data differs.

Naming is a mess. Visa's CVN 18 is the byte 0x12 read as decimal, while AWS documents Mastercard CVN 14 and 15 as EMV CSK and pyemv labels its equivalent tests 20 and 21, which is 0x14 and 0x15 read as decimal. Dispatch on the byte, not the label.

ARPC Method 1 vs Method 2: What the Issuer Sends Back

The issuer proves its response is genuine with an Authorisation Response Cryptogram in tag 91 (8 to 16 bytes), which reaches the card through EXTERNAL AUTHENTICATE or the second GENERATE AC.

  • Method 1 encrypts the ARQC XORed with the 2-byte response code. For CVN 10 with ARC 3030 ("00" in ASCII) the ARPC is 28993816AFAE4AEB. It authenticates the response code and nothing else.
  • Method 2 MACs the ARQC, a 4-byte Card Status Update and up to 8 bytes of proprietary data, keeping 4 bytes. For CVN 18 with CSU 00000000 the ARPC is 9AF514C1.
Method 2 wins when the issuer needs to send the card authenticated instructions in the same response, which is what the CSU is for. If the card rejects the ARPC it answers 6300, the terminal sets TVR byte 5 bit 7, and the card may return an AAC with CID reason 011: the approved-then-declined case from the first section.

AWS Payment Cryptography vs payShield for ARQC Verification

AWS exposes this as one call, VerifyAuthRequestCryptogram:

{
  "KeyIdentifier": "alias/issuer-imk-ac",
  "MajorKeyDerivationMode": "EMV_OPTION_A",
  "TransactionData": "0000000040000000...06011203A0B8008000000000000000",
  "AuthRequestCryptogram": "7A788EA6B8A3E733",
  "SessionKeyDerivationAttributes": {
    "EmvCommon": { "PrimaryAccountNumber": "1234567890123456",
                   "PanSequenceNumber": "00", "ApplicationTransactionCounter": "001C" }
  },
  "AuthResponseAttributes": { "ArpcMethod2": { "CardStatusUpdate": "00000000" } }
}

Three things the reference pages underplay. You pad TransactionData yourself: the docs say it "should be padded prior to sending" and there is no padding flag, so a padding bug returns the same VerificationFailedException (HTTP 400) as a forged card. The issuer key must be TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS with algorithm TDES_2KEY, so there is no AES cryptogram path today. And pricing is $1 per key per month plus $2 per 10,000 calls for the first 20 million, so verifying 10 million authorisations a month costs about $2,000.

Thales payShield splits the work across two host commands: KQ for static card keys and Mastercard's own derivation, KW for EMV and cloud-based session keys. Azure Payment HSM is payShield 10K hardware rented as a bare-metal service, so the same commands apply. AWS gives you IAM and per-call billing with nothing to operate. payShield gives you the full command set at a fixed cost, plus an HSM to run or rent.

Will TDES Cryptograms Survive Visa's 2030 AES Deadline?

Visa's September 2025 guidance asks the industry to move to AES before the end of 2030 and to stop new TDES use for application cryptograms and PIN encryption by 2031. EMVCo's Common Core Definitions already reserve cryptogram version 5 for TDES and 6 for AES.

My position: issuers will still be verifying TDES ARQCs in 2034. The guidance targets new use, and a card personalised in late 2030 with a four-year expiry keeps its TDES key until it expires. Expect the cloud HSM APIs to add AES cryptogram verification well before then, since an AWS endpoint that takes only TDES_2KEY is the obvious gap. Build CVN dispatch from the 9F10 data now, so version 6 is a table entry rather than a rewrite.

What This Means for Payment Engineers

1. Log decoded fields, not raw field 55. Store the CID, TVR, TSI, CVM Results and CVN on every chip authorisation. The raw blob can carry tag 57, track 2 equivalent data. 2. Treat MAC inputs as read-only. No gateway, terminal app or "normaliser" may rewrite 95, 9F37, 9F36, amounts or dates. The 2019 Visa declines came from exactly that. 3. Handle approved-then-AAC. If the second GENERATE AC returns an AAC after an issuer approval, decline and reverse. 4. Put these vectors in CI. Visa CVN 10 needs method 1 padding; CVN 18, 22 and Mastercard need method 2. A unit test per CVN catches the bug before an HSM does. 5. Know what your platform exposes. Stripe Terminal returns terminal_verification_results and transaction_status_information on card_present.receipt; Square's CardPaymentDetails gives you the cryptogram and verification method but no TVR. Pick the one you can debug.

If you are building the issuer side, my card issuing authorisation guide covers the webhook half and the DUKPT guide covers PIN keys. More from Tom Wang on card infrastructure in the archive.