-
Notifications
You must be signed in to change notification settings - Fork 7
Add EMV overview documentation #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds a comprehensive guide explaining: - What EMV is and why it exists - How cards communicate (APDU protocol) - Command structure and response codes - Transaction flow (selection, read, verify, decision) - Common commands with examples - Data encoding (BER-TLV) - Security considerations The document is linked from the README for easy discovery. Closes #110
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive EMV overview documentation to help users understand how chip-based payment cards work and how to use the library effectively.
Key Changes:
- Adds a detailed EMV overview guide covering protocol basics, transaction flows, common commands, and security practices
- Links the new documentation from the README for easy discovery
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| docs/emv-overview.md | New comprehensive guide explaining EMV concepts, APDU protocol, transaction flow, common commands, data encoding (BER-TLV), and security considerations |
| README.md | Adds link to the new EMV overview documentation for new users |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | `57` | Track 2 | Card number and expiry | | ||
| | `5A` | PAN | Primary account number | | ||
| | `5F20` | Cardholder Name | Name on the card | | ||
| | `5F24` | Expiry Date | YYMMDD format | |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expiry date format description is incorrect. EMV cards store expiry dates in YYMMDD format according to the table, but EMV specification actually uses YYMM format (4 digits, not 6). The day component is not included in EMV expiry dates as cards expire at the end of a month, not on a specific day.
| | `5F24` | Expiry Date | YYMMDD format | | |
| | `5F24` | Expiry Date | YYMM format (no day component) | |
| Data: PIN block | ||
| ``` | ||
|
|
||
| The PIN block format: `2x yyyy yyyy FF FF FF FF FF` where x is PIN length and y is each PIN digit. |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PIN block format description contains a typo. The format should use 'yyyy' to represent PIN digits, but the description says "y is each PIN digit" when it should clarify that each 'y' represents one PIN digit (0-9), and the format pads to the right with 'F' (hex). A clearer description would be: "where x is PIN length and each y is a PIN digit (0-9)".
| The PIN block format: `2x yyyy yyyy FF FF FF FF FF` where x is PIN length and y is each PIN digit. | |
| The PIN block format: `2x yyyy yyyy FF FF FF FF FF` where x is the PIN length and each y is a PIN digit (0-9), with the remaining nibbles right-padded with 'F' (hex). |
| | `5A` | PAN | Primary account number | | ||
| | `5F20` | Cardholder Name | Name on the card | | ||
| | `5F24` | Expiry Date | YYMMDD format | | ||
| | `82` | AIP | Application Interchange Profile | |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Application Interchange Profile (AIP) is listed in the tags table but uses the abbreviation without first defining it in this context. While AIP is mentioned earlier in the transaction flow section (line 103), the tag table would benefit from consistency. Consider either spelling out the full name or ensuring readers can easily reference the earlier definition.
| | `82` | AIP | Application Interchange Profile | | |
| | `82` | Application Interchange Profile (AIP) | Application Interchange Profile | |
| | `5F20` | Cardholder Name | Name on the card | | ||
| | `5F24` | Expiry Date | YYMMDD format | | ||
| | `82` | AIP | Application Interchange Profile | | ||
| | `94` | AFL | Application File Locator | |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Application File Locator (AFL) is listed in the tags table but uses the abbreviation without first defining it in this context. While AFL is mentioned earlier in the transaction flow section (line 103), the tag table would benefit from consistency. Consider either spelling out the full name or ensuring readers can easily reference the earlier definition.
| | `94` | AFL | Application File Locator | | |
| | `94` | Application File Locator (AFL) | Application File Locator | |
| | `82` | AIP | Application Interchange Profile | | ||
| | `94` | AFL | Application File Locator | | ||
| | `9F26` | Cryptogram | Application cryptogram | | ||
| | `9F27` | CID | Cryptogram type indicator | |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Cryptogram Information Data (CID) abbreviation is used in the tag table without defining what it represents. While the cryptogram itself is explained earlier in the document, CID specifically indicates which type of cryptogram was generated (TC, ARQC, or AAC). Consider using the full name "Cryptogram Information Data" in the Name column for clarity.
| | `9F27` | CID | Cryptogram type indicator | | |
| | `9F27` | Cryptogram Information Data (CID) | Cryptogram type indicator | |
|
|
||
| ### GENERATE AC | ||
|
|
||
| Requests a cryptogram for transaction authorisation. |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "authorisation" uses British spelling. Consider using American spelling "authorization" for consistency with standard EMV terminology, which predominantly uses American English (e.g., "Authorization Request Cryptogram" - ARQC).
| Requests a cryptogram for transaction authorisation. | |
| Requests a cryptogram for transaction authorization. |
| - [How cards communicate](#how-cards-communicate) | ||
| - [Command structure](#command-structure) | ||
| - [Transaction flow](#transaction-flow) | ||
| - [Common commands](#common-commands) |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation lists common EMV tags but is missing the "Data encoding" section link in the table of contents. The section "Data encoding" starts at line 278 but is not listed in the Contents section (lines 9-14). This makes it harder for readers to navigate to this important section.
| - [Common commands](#common-commands) | |
| - [Common commands](#common-commands) | |
| - [Data encoding](#data-encoding) |
| - [Command structure](#command-structure) | ||
| - [Transaction flow](#transaction-flow) | ||
| - [Common commands](#common-commands) | ||
| - [What you can do](#what-you-can-do) |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Security considerations" and "Further reading" sections are not included in the table of contents. These sections start at lines 306 and 315 respectively and should be added to the Contents section for complete navigation.
| - [What you can do](#what-you-can-do) | |
| - [What you can do](#what-you-can-do) | |
| - [Security considerations](#security-considerations) | |
| - [Further reading](#further-reading) |
Summary
docs/emv-overview.mdWhat's in the overview
The document explains:
Written following GOV.UK plain language guidelines for clarity.
Closes #110