4 Notes on EMV works on Proxmark3
7 - [EMV commands](#emv-commands)
8 - [Table of Contents](#table-of-contents)
9 - [EMV Implemented parts](#emv-implemented-parts)
10 - [Working parts of qVSDC](#working-parts-of-qvsdc)
11 - [`not implemented` parts of EMV](#not-implemented-parts-of-emv)
12 - [Commands](#commands)
13 - [VISA(r) transactions](#visar-transactions)
14 - [Mastercard(r) transactions](#mastercardr-transactions)
15 - [all commands](#all-commands)
16 - [Useful links](#useful-links)
17 - [EMV kernels](#emv-kernels)
21 ### EMV Implemented parts
25 - Get AID by PSE (`emv pse`)
26 - Get AID by application list (`emv search`)
27 - Select application (`emv select`)
28 - Format PDOL (look at next part)
29 - Execute GPO (`emv gpo` this step and format PDOL)
30 - Get records from AFL (`emv readrec`)
31 - Make SDA (check records from GPO)
32 - Make DDA (`emv challenge` `emv intauth`)
33 - Check PIN (`not implemented`)
34 - Fill CDOL1 and CDOL2 (look at next part)
35 - Execute AC1 (with CDA support) (`emv genac`)
36 - Check ARQC (bank part) (`not implemented`)
37 - Make ARPC (bank part) (`not implemented`)
38 - Execute external authenticate (`not implemented`)
39 - Execute AC2 (with CDA support) (`not implemented`)
40 - Check ARQC cryptogram (`not implemented`)
41 - Issuer scripts processing (`not implemented`)
43 ### Working parts of qVSDC
47 - Get AID by PSE (`emv pse`)
48 - Get AID by application list (`emv search`)
49 - Select application (`emv select`)
50 - Format PDOL (look at next part)
51 - Execute GPO (`emv gpo` this step and format PDOL)
52 - Get records from AFL (`emv readrec`)
53 - Make fDDA (`emv challenge` `emv intauth`)
54 - External authenticate command (`not implemented`)
55 - Issuer scripts processing (`not implemented`)
57 ### `not implemented` parts of EMV
60 They can be implemented, but it needs to know issuer's card keys (usually 3DES) and now this parts can be tested only on special test cards.
65 All this commands are parts of command `emv exec`.
66 command `emv exec` executes EMV transaction. it have parameters:
68 -j, --jload Load transaction parameters from `emv/defparams.json` file.
69 --forceaid Force search AID. Search AID instead of execute PPSE.
70 By default: Transaction type - MSD
71 -v, --qvsdc Transaction type - qVSDC or M/Chip.
72 -c, --qvsdccda Transaction type - qVSDC or M/Chip plus CDA (SDAD generation).
73 -x, --vsdc Transaction type - VSDC.
74 -g, --acgpo VISA. generate AC from GPO.
75 -w, --wired Send data via contact (iso7816) interface. Contactless interface set by default.
77 It works for VISA(r) and Mastercard(r) transactions. It may work with other EMV payment system's card (and it works in general cases that is described in EMV).
79 ### VISA(r) transactions
82 MSD - Magnetic Stripe mode
83 VSDC - contact transaction
84 qVSDC - contactless transaction
86 ### Mastercard(r) transactions
89 MSD - Magnetic Stripe mode
90 M/Chip - contact and contactless transaction
92 Different cards have different modes on/of and different behavior in them. So needs to check card in all this modes.
93 MSD - compatibility mode. Now it work always. But it less secure and in near future it will be slowly) disabled.
99 ----------- ----------------------- general -----------------------
101 list List ISO7816 history
102 test Crypto logic test
103 ----------- ---------------------- operations ---------------------
104 challenge Generate challenge
105 exec Executes EMV contactless transaction
106 genac Generate ApplicationCryptogram
107 gpo Execute GetProcessingOptions
108 intauth Internal authentication
109 pse Execute PPSE. It selects 2PAY.SYS.DDF01 or 1PAY.SYS.DDF01 directory
110 reader Act like an EMV reader
111 readrec Read files from card
112 roca Extract public keys and run ROCA test
113 scan Scan EMV card and save it contents to json file for emulator
114 search Try to select all applets from applets list and print installed applets
118 All main commands are parts of EMV specification. Commands than not described there:
120 `emv scan` - scans card and saves all records to json file. Can be executed with or without tags disassembly.
122 `emv roca` - extract public keys from cards (part of `emv scan`)
124 `emv test` - test all crypto code from emv part of proxmark.
130 http://www.emvco.com/specifications.aspx?id=155
132 Excelent explanation of EMV
133 http://www.openscdp.org/scripts/emv/index.html
135 Fully working terminal written in Ruby.
136 https://code.google.com/p/ruby-pboc2-lib/source/browse/trunk/lib/pboc.rb
138 EMV kernel written in C++
139 https://github.com/ntufar/EMV/tree/master/EMV_Library
141 C EMV library (part of this library uses proxmark)
142 https://github.com/lumag/emv-tools
144 Resources (keys, country codes, etc):
145 https://github.com/binaryfoo/emv-bertlv/tree/master/src/main/resources
150 POS terminal checks card and selects one of EMV kernels and launches it for EMV transaction. Different kernels have different rules to make EMV transaction.
154 EMVco Architecture and General Requirement V2.4 volume A.
155 EMVco Entry Point specification V2.4 volume B
157 - EMVco C-1 Kernel 1 V2.4 for some cards with JCB AIDs and some cards with Visa AIDs
158 - EMVco C-2 Kernel 2 V2.4 for MasterCards AIDs
159 - EMVco C-3 Kernel 3 V2.4 for Visa AIDs
160 - EMVco C-4 Kernel 4 V2.4 for American Express AIDs
161 - EMVco C-5 Kernel 5 V2.4 for JCB AIDs
162 - EMVco C-6 Kernel 6 V2.4 for Discover AIDs
163 - EMVco C-7 Kernel 7 V2.4 for UnionPay AIDs