A payment terminal communicates with a chip card (also known as a smart card or EMV card) through a standardized process that ensures secure and reliable data exchange. This communication is primarily governed by the EMV (Europay, Mastercard, and Visa) standards, which define the protocols and procedures for interaction between the card and the terminal. Below is a detailed explanation of how this communication works:
1. Physical Connection
- Contact Cards: For contact-based chip cards, communication begins when the card is inserted into the payment terminal's card reader. The chip on the card has a set of gold-plated contact points (usually 8 pins) that physically connect to the terminal's reader. These pins are defined by the ISO/IEC 7816 standard and include:
- VCC (power supply)
- GND (ground)
- RST (reset)
- CLK (clock signal)
- I/O (input/output for data exchange)
- VPP (programming voltage, often unused in modern cards)
- Contactless Cards: For contactless chip cards, communication occurs wirelessly using Near Field Communication (NFC) technology, based on the ISO/IEC 14443 standard. The terminal generates an electromagnetic field, and the card's chip is powered by this field through inductive coupling. Data is exchanged via radio frequency (RF) signals.
2. Powering the Card
- Contact Cards: The terminal supplies power to the chip card through the VCC and GND pins, enabling the card's microprocessor to function.
- Contactless Cards: The card is powered by the electromagnetic field generated by the terminal. No physical connection is required.
3. Initialization and Reset (ATR - Answer to Reset)
- For contact cards, once powered, the terminal sends a reset signal (via the RST pin) to the card to initialize communication.
- The card responds with an Answer to Reset (ATR) message, which is a string of bytes that provides information about the card, such as:
- Supported communication protocols (e.g., T=0 or T=1, which are asynchronous protocols defined by ISO/IEC 7816).
- Card capabilities and characteristics.
- For contactless cards, a similar initialization process occurs, but it uses NFC-specific commands (e.g., REQA, ATQA) to establish communication.
4. Protocol Negotiation
- The terminal and card negotiate the communication protocol to be used (e.g., T=0 or T=1 for contact cards, or specific NFC protocols for contactless cards). This ensures compatibility and efficient data exchange.
- The terminal selects the appropriate application on the card (e.g., a payment application like Visa, Mastercard, or a regional payment scheme) using the Application Identifier (AID). This is done via the SELECT command, and the card responds with information about the selected application.
5. Data Exchange
- Once the application is selected, the terminal and card exchange data using a series of commands and responses, following the APDU (Application Protocol Data Unit) format defined by ISO/IEC 7816.
- Command APDU: Sent by the terminal to the card, it includes instructions such as reading data, verifying a PIN, or generating a cryptographic signature.
- Response APDU: Sent by the card to the terminal, it includes the requested data or status codes indicating success or failure.
- Examples of data exchanged include:
- Cardholder information (e.g., card number, expiry date).
- Transaction details (e.g., amount, currency, date).
- Cryptographic data for security (e.g., digital signatures, authentication codes).
6. Authentication
- The terminal and card perform mutual authentication to ensure both are legitimate. This is a critical part of the EMV security framework and involves:
- Static Data Authentication (SDA): Verifies the integrity of static data on the card (less secure, rarely used today).
- Dynamic Data Authentication (DDA): Uses public-key cryptography to verify the card's authenticity by generating a dynamic signature.
- Combined Data Authentication (CDA): Combines DDA with transaction-specific data to provide even stronger security.
- The card may also authenticate the terminal to ensure it is not a fraudulent device.
7. Cardholder Verification
- The terminal may request cardholder verification, depending on the transaction and card configuration. Common methods include:
- PIN Verification: The cardholder enters a PIN, which is sent to the card for verification. The card compares the entered PIN with the stored PIN (encrypted on the chip) and responds with a success or failure code.
- Signature: For some transactions, the cardholder may be required to sign a receipt instead of entering a PIN.
- No Verification: For low-value contactless transactions, cardholder verification may be skipped (e.g., "tap and go").
8. Transaction Processing
- The terminal sends transaction details (e.g., amount, currency) to the card, which processes the data and applies its internal risk management rules (e.g., checking if the transaction amount exceeds a limit).
- The card generates a Transaction Certificate (TC) or Application Cryptogram (AC), which is a cryptographic code that proves the transaction was authorized by the card. This cryptogram is sent to the terminal and eventually to the payment network for authorization.
9. Security Features
- Encryption: Sensitive data (e.g., PIN, cardholder data) is encrypted during communication to prevent eavesdropping.
- Cryptographic Keys: The card and terminal use cryptographic keys (symmetric or asymmetric) to secure data exchange and authentication.
- Tamper Resistance: The chip on the card is designed to be tamper-resistant, meaning it will erase sensitive data if someone attempts to physically access or manipulate it.
10. Completion of Transaction
- Once the terminal receives the transaction cryptogram and any other required data, it sends the information to the payment network (e.g., Visa, Mastercard) for authorization.
- The terminal displays the result (e.g., "Approved" or "Declined") and may issue a receipt.
- For contact cards, the card is removed from the reader. For contactless cards, the cardholder moves the card away from the terminal, ending the communication.
Key Standards Involved
- ISO/IEC 7816: Governs the physical and electrical characteristics of contact chip cards, as well as the APDU communication protocol.
- ISO/IEC 14443: Governs contactless communication using NFC.
- EMV Specifications: Define the application-level protocols and security mechanisms for payment transactions.
Summary
The communication between a payment terminal and a chip card is a highly secure, standardized process that involves physical or wireless connection, initialization, protocol negotiation, data exchange, authentication, and cryptographic security. This ensures that transactions are safe, reliable, and resistant to fraud, making chip cards a cornerstone of modern payment systems.