How to read an EMV transaction log
By IDNTEQ · published · technically reviewed
Runs in your browser. This page loads no analytics or third-party scripts and does not send what you type.
An APDU log records the commands the terminal sent to the card and the responses
the card returned. This article covers a contact EMV transaction, in the order
the commands appear in a log. Contactless transactions use other entry
points (the PPSE, 2PAY.SYS.DDF01) and kernel-specific flows; they are not
covered here.
The EMV transaction walkthrough shows one complete contact chip-and-PIN purchase with every command and response computed live. Read it alongside this article.
Application selection (SELECT)
On a contact card the terminal can select the Payment System Environment (PSE),
1PAY.SYS.DDF01:
00 A4 04 00 0E
31 50 41 59 2E 53 59 53
2E 44 44 46 30 31
00
(CLA INS P1 P2 and Lc = 14, then the name 1PAY.SYS.DDF01 in ASCII, then Le.)
The PSE’s FCI points to a directory file, which the terminal reads with READ
RECORD to build the list of applications. If the card has no PSE (6A82, file
not found) or the terminal does not use it, the terminal selects the AIDs it
supports one by one, with 00 A4 04 00 and the AID. The response to a
successful SELECT is an FCI template (tag 6F) with the DF name, the application
label and, if the card wants terminal data in the next step, the PDOL. Parse it
with the TLV parser. 6283 in response to SELECT means the
application is blocked.
Initiate processing (GET PROCESSING OPTIONS)
80 A8 00 00 sends the data the PDOL asked for, inside command template 83 (or
83 00 when there is no PDOL). The card returns the Application Interchange
Profile (AIP, tag 82) and the Application File Locator
(AFL, tag 94), either as format 1 (tag 80) or format 2
(tag 77). The AIP declares which offline data authentication methods the card
supports, whether it supports cardholder verification and whether issuer
authentication is performed.
Read application data (READ RECORD)
The terminal reads every record the AFL lists with 00 B2, P1 = record number,
P2 = SFI × 8 + 4. The records hold the certificates, the CDOLs, the CVM list and
the other application data. The AFL builder decodes the
AFL, lists the records in order and assembles the static data used for offline
data authentication.
Offline data authentication
The terminal picks one method that both sides support:
- SDA checks a signature over the static data. No command is sent; the terminal works from the records already read.
- DDA checks a dynamic signature that the card generates in response to
INTERNAL AUTHENTICATE (
00 88 00 00), which the terminal sends before the first GENERATE AC. - CDA combines the dynamic signature with the cryptogram: the card signs in its response to GENERATE AC, and the terminal verifies that signature after the GENERATE AC response arrives. In a CDA log there is no INTERNAL AUTHENTICATE; the GENERATE AC command has the CDA bit set in P1 and the response contains the Signed Dynamic Application Data (tag 9F4B).
In all three cases the terminal first recovers the issuer certificate with the CA public key and the ICC certificate (for DDA and CDA) with the issuer key. The EMV certificate validator does the same recovery and hash checks.
Processing restrictions, cardholder verification, risk management
Processing restrictions (version, dates, usage control) are terminal checks and send no command. Cardholder verification follows the card’s CVM list:
- offline plaintext PIN:
VERIFY,00 20 00 80with a format 2 PIN block; - offline enciphered PIN:
GET CHALLENGE(00 84 00 00 00), thenVERIFYwith P2 =88; - online PIN: no command to the card; the PIN goes to the issuer in the authorisation message.
The terminal may read the PIN Try Counter first with GET DATA (80 CA 9F 17).
Terminal risk management may read the ATC and the Last Online ATC Register with
GET DATA for velocity checking. Each outcome sets bits in the TVR; see
TVR structure and what to check when a flag is set.
First GENERATE AC
80 AE asks the card for a cryptogram. P1 gives the type requested (00 AAC,
40 TC, 80 ARQC, plus 10 when CDA is requested). The command data are the
values the card’s CDOL1 asked for, without tags. The card answers with the
Cryptogram Information Data (9F27), the ATC
(9F36), the Application Cryptogram
(9F26) and the Issuer Application Data
(9F10). The CID says which cryptogram the card actually
returned: the card may return a lower one than requested (an AAC when an ARQC was
requested), never a higher one.
Online authorisation and completion
For an ARQC the terminal goes online. The issuer’s response may carry issuer
authentication data (the ARPC, tag 91) and issuer scripts (templates 71 and 72).
Depending on the card, the terminal sends the ARPC in EXTERNAL AUTHENTICATE
(00 82 00 00) or in the data of the second GENERATE AC. Scripts in template 71
are sent before the second GENERATE AC and those in template 72 after it. The
second GENERATE AC asks for a TC (approve) or an AAC (decline), with the data the
card’s CDOL2 asked for. To check an ARQC or an ARPC with test keys, use the
ARQC verifier.
Status words
Every response ends with a two-byte status word (SW1 SW2).
| Status word | Meaning |
|---|---|
9000 | Normal completion |
61xx | xx more bytes available with GET RESPONSE (T=0) |
6Cxx | Wrong Le; repeat the command with Le = xx |
6283 | Selected file invalidated (on SELECT: application blocked) |
6985 | Conditions of use not satisfied |
6983 | Authentication method blocked (after VERIFY: PIN blocked) |
6A82 | File or application not found |
6A83 | Record not found |
63Cx | A counter with value x; its meaning depends on the command |
63Cx is generic in ISO 7816-4. In response to VERIFY it gives the number of PIN
tries remaining (63C2: wrong PIN, two tries left). After another command, read
it in that command’s context. The decoder below names status words with the
command they answer.
Decoder
Paste a log or a single command or response. The default example is a short contactless selection; replace it with your own contact log. Comments, direction markers and timestamps are removed before decoding.
Input
3 commands, 3 responses decoded.
Result
The planned EMV for Developers course covers the transaction flow in more detail.
References
See also
- The EMV transaction walkthrough: one contact chip-and-PIN purchase, every command and cryptogram computed in your browser.
- The EMV and payments glossary, with the Brazilian Portuguese terms.
- For an investigation, see EMV transaction troubleshooting.
Related tools
Decode command/response APDUs and full tracer logs (ISO 7816-4 + EMV).
TLV parser / builderDecode BER-TLV with tag names, decoded values and the EMV bitmaps; DOL mode and share links.
AFL & static data builderDecode the AFL, list the records the terminal reads and build the static data to authenticate.
EMV certificate validatorRecover issuer and ICC certificates; check hash, structure and CA key status.
ARQC / cryptogram verifierShows each derivation step and tests common input variations when an ARQC does not match.