All Tools
Tools/ARQC / ARPC Calculator
🧮
EMV & ChipAvailable

ARQC / ARPC Calculator

Compute and verify EMV ARQC and ARPC cryptograms for Visa CVN 10 (UDK as key, zero padding, ARPC method 1) and CVN 18 (EMV common session key, ARPC method 2) — checked against EMV Book 2 reference values.

Follows EMV 4.3 Book 2 Annex A1 · Visa CVN 10 / CVN 18MAC algorithm 3, common session key, ARPC methods 1 and 2·verified Oct 2026· double-checked Oct 2026— matches the pyemv reference examples; CVN 18 IAD-based example cross-checked with Python cryptography

Try it as a puzzle: deliver a chip’s cryptogram to the one system that can check it →

Use test data only. All calculations run locally in your browser — PayProbe never sees, transmits, or stores your PAN, CVV, keys, PINs, or cryptographic inputs. How we handle data →

How the cryptogram is computed

How an EMV Application Cryptogram is built for Visa CVN 10 and CVN 18. The card MACs the transaction data with its card key (CVN 10) or a session key derived from it (CVN 18); the issuer validates it and returns an ARPC the card can verify in return.

1 / 6
🧾
Transaction Dataamount, ATC, UN…
🗝️
Derive UDK
🔑
Session Key
🧱
Build Block
🔐
ARQC = MAC
↩️
ARPC

1Transaction Data

CDOL1 values + CVR / IAD

The inputs are the CDOL1 values in order (amount, other amount, terminal country, TVR, currency, date, transaction type, unpredictable number, AIP, ATC), without tags or lengths. Visa CVN 10 then appends the 4-byte CVR; CVN 18 appends the full Issuer Application Data (9F10 value).

Algorithm overview

ARQC = ISO/IEC 9797-1 MAC algorithm 3 over the CDOL1 data, keyed with the AC session key (CVN 18) or with the UDK itself (CVN 10).
CVN 10: no session key — the card's AC master key (UDK) is the MAC key; input = CDOL1 values ‖ CVR; data padded with zeros (method 1); ARPC method 1 = 3DES(UDK)[ARQC ⊕ (ARC ‖ 00…00)], tag 91 = ARPC ‖ ARC.
CVN 18: session key = EMV common session key derivation with R = ATC ‖ 00…00 (byte 3 set to F0 / 0F); input = CDOL1 values ‖ full Issuer Application Data (9F10); data padded with 80 00… (method 2); ARPC method 2 = 4-byte MAC over ARQC ‖ CSU, tag 91 = ARPC ‖ CSU.
The UDK itself comes from the issuer master key and PAN/PSN. The option depends on the PAN, not the CVN (EMV Book 2 A1.4): Option A for PANs of up to 16 digits, Option B for longer PANs.

</> Code Implementation
# EMV ARQC Calculator — CBC-MAC with 3DES (ISO 9797-1 Alg 3)
# Requires: pip install pycryptodome
from Crypto.Cipher import DES

def retail_mac(data: bytes, key: bytes) -> bytes:
    """ISO 9797-1 Alg 3 MAC: single-DES CBC under K1 over every block,
    then output transformation: decrypt under K2, encrypt under K1."""
    k1, k2 = key[:8], key[8:16]
    pad_len = 8 - (len(data) % 8)
    padded  = data + bytes([0x80] + [0x00] * (pad_len - 1))
    state   = bytes(8)
    for i in range(0, len(padded), 8):
        block = padded[i:i+8]
        state = DES.new(k1, DES.MODE_ECB).encrypt(
            bytes(a ^ b for a, b in zip(state, block))
        )
    dec  = DES.new(k2, DES.MODE_ECB).decrypt(state)
    return DES.new(k1, DES.MODE_ECB).encrypt(dec)

def compute_arqc(key_hex: str, tx_data_hex: str) -> str:
    key  = bytes.fromhex(key_hex)
    data = bytes.fromhex(tx_data_hex)
    return retail_mac(data, key).hex().upper()

# Visa CVN 18: padding method 2, key = the AC session key derived from the UDK and ATC
# (EMV common session key; here UDK 0123456789ABCDEF FEDCBA9876543210, ATC 0001).
# Data = CDOL1 values (no tags) followed by the full Issuer Application Data 06011203A00000.
# For Visa CVN 10 pad with zeros (ISO 9797-1 method 1), append only the CVR, and use the UDK as the key.
sk      = "858C34707F67D50845F8296EF19BBFFD"
tx_data = "000000002000000000000000012400000080000124110309003804823E5800000106011203A00000"
arqc    = compute_arqc(sk, tx_data)
print(f"ARQC: {arqc}")  # ARQC: 81ECF67932FB64D6
Something wrong or missing? Report a problem— we check reports against the specs and fix them.