How EMV Protocols Work

Mutt

Professional
Messages
1,369
Reaction score
912
Points
113
EMV protocols (the name comes from Europay, MasterCard, Visa) are a global standard for authenticating transactions using chip-based bank cards. They are designed to improve payment security compared to legacy magnetic stripe cards, minimizing fraud risks such as card cloning. Below, I will explain in detail how EMV protocols work, their key components, transaction steps, and security mechanisms, for educational purposes.

What is EMV?​

EMV is a set of technical standards that define the interaction between chip cards (smart cards) and payment terminals (POS terminals, ATMs) to perform secure transactions. The chip on the card is a microprocessor capable of performing cryptographic operations and storing secure data, unlike the magnetic stripe, which contains static information.

The main goals of EMV are:
  • Authentication: Confirmation of the authenticity of the card and terminal.
  • Confidentiality: Protect transaction data from interception.
  • Integrity: Ensuring that transaction data is not modified.
  • Anti-cloning: Prevents the creation of duplicate cards.

How EMV Works: Key Components​

  1. Chip on the card:
    • A microprocessor containing secure memory and cryptographic keys.
    • Stores card data (e.g. card number, expiration date) and performs authentication calculations.
  2. POS terminal or ATM:
    • A device that reads data from the chip and communicates with the issuing bank (the bank that issued the card) to authorize the transaction.
  3. Cryptographic keys:
    • EMV uses asymmetric cryptography (RSA) and symmetric cryptography (such as 3DES or AES) to protect data.
    • The card contains a private key, and the terminal uses the public key to verify the signature.
  4. Payment system:
    • Payment networks (Visa, MasterCard, Mir, etc.) define the rules and standards for processing transactions.
  5. Issuing bank:
    • The bank that issued the card checks the transaction data and makes a decision to approve or reject it.

Steps of an EMV transaction​

The EMV transaction process involves several steps that ensure security and authentication. Here's how it works:
  1. Initializing a transaction:
    • The card is inserted into the terminal (or the contactless NFC interface is used).
    • The terminal establishes a connection with the chip via physical contact (contact cards) or radio signal (wireless cards).
    • The chip is activated and transmits a list of supported applications (e.g. Visa, MasterCard) to the terminal.
  2. Reading card data:
    • The terminal asks the chip for the data required for the transaction, such as the card number, expiration date, and a list of supported authentication methods (e.g. PIN, signature, or no signature for small transactions).
    • The chip transmits data in encrypted form, including the Application Interchange Profile (AIP) and Application File Locator (AFL), which specify what data and processing methods to use.
  3. Card Authentication: EMV supports three main methods of card authentication:
    • Static Data Authentication (SDA): An obsolete method where the terminal verifies the static digital signature of the card. Rarely used due to vulnerability to cloning.
    • Dynamic Data Authentication (DDA): The chip generates a unique cryptographic signature for each transaction using a private key. The terminal verifies the signature using the public key.
    • Combined DDA/Application Cryptogram (CDA): Combines DDA with transaction cryptogram generation for additional security.
  4. Cardholder verification:
    • The terminal requests the Cardholder Verification Method (CVM):
      • PIN code: The user enters a PIN, which is verified by the chip (offline) or the bank (online).
      • Signature: Used for transactions where a PIN is not required.
      • Without verification: For low-risk transactions (e.g. small amounts for contactless payments).
    • For contactless transactions of small amounts (for example, up to 1000 rubles in Russia), the "No CVM" method can be used if the terminal and card support it.
  5. Transaction cryptogram generation:
    • The chip creates a unique cryptogram (Application Cryptogram, AC) that verifies the authenticity of the transaction. There are three types of cryptograms:
      • ARQC (Authorization Request Cryptogram): An online authorization request sent to the issuing bank.
      • AAC (Application Authentication Cryptogram): Transaction Rejection.
      • TC (Transaction Certificate): Confirmation of a successful transaction.
    • The cryptogram includes transaction data (amount, currency, date, terminal ID) and is generated using a symmetric key unique to the card.
  6. Online or offline authorization:
    • Offline: The terminal and chip independently verify data (such as transaction limits or card authenticity). Used in areas with poor connectivity.
    • Online: The terminal sends the ARQC to the issuing bank via the payment network. The bank checks the balance, limits and risks, then approves or rejects the transaction.
    • If online authorization is required, the bank returns an ARC (Authorized Response Code) that confirms or rejects the transaction.
  7. Completing a transaction:
    • After receiving approval (TC or ARC), the terminal completes the transaction and the chip records it in its memory.
    • The user receives a receipt and the transaction details are sent to the bank for debiting.

Key EMV Security Mechanisms​

  1. Cryptography:
    • EMV uses asymmetric (RSA) and symmetric (3DES, AES) cryptography to protect data.
    • Each chip has a unique private key, and terminals use public keys certified by payment systems.
  2. Dynamic data:
    • Unlike a magnetic stripe, where the data is static and can be copied, the chip generates a unique cryptogram for each transaction. This makes cloning virtually impossible, as a counterfeit card would not be able to create the correct cryptogram.
  3. Offline transaction limit:
    • The chip stores a transaction counter and limits that restrict the ability to conduct offline transactions without verification by the bank.
  4. PIN code protection:
    • The PIN is stored in a secure area of the chip and is verified locally (offline) or via the bank (online). Even if the data is intercepted, the PIN remains encrypted.
  5. Contactless transactions:
    • Contactless cards (NFC) use the same EMV protocols, but with additional measures such as limiting the amount for transactions without a PIN.

EMV Limitations and Vulnerabilities​

While EMV greatly improves security, it is not completely foolproof. Here are some vulnerabilities that are studied for educational purposes:
  1. Атаки "man-in-the-middle":
    • An attacker can interfere with the data exchange process between the card and the terminal to replace data (for example, the transaction amount). However, this requires sophisticated equipment and access to the terminal.
  2. Magnetic stripe skimming:
    • If the card is used in a terminal that accepts a magnetic stripe (for example, in countries with legacy infrastructure), the data can be copied for use in systems that do not require a chip.
  3. Phishing and data theft:
    • EMV protects physical transactions, but does not prevent card data (such as number and CVV) from being stolen through phishing for online purchases.
  4. Offline attacks:
    • In rare cases, attackers can exploit vulnerabilities in offline mode if the terminal does not verify the transaction online.

Payment systems and banks are constantly updating EMV protocols to eliminate vulnerabilities. For example, the introduction of 3D-Secure for online transactions adds an additional layer of protection to EMV.

Benefits of EMV​

  • Anti-cloning: Dynamic cryptograms make it impossible to create an exact copy of the card.
  • Global Interoperability: EMV is used worldwide, providing a single standard.
  • Flexibility: Supports contact and contactless transactions, as well as offline and online modes.
  • Reduced Fraud: In countries where EMV is widely implemented, card fraud rates have dropped significantly.

Conclusion​

EMV protocols provide a high level of security through the use of cryptography, dynamic data, and strong authentication. They protect against card cloning and fraud in physical transactions, but require additional measures (e.g. 3D-Secure) for online payments. Understanding how EMV works is useful for cybersecurity professionals to develop more robust security systems.

If you want to dive deeper into specific aspects, such as EMV cryptographic algorithms, PCI DSS standards, or online fraud protection, let me know and I will provide more detailed information. I can also explain how to test the security of payment systems in a legal and ethical environment (e.g. through simulations on platforms like TryHackMe).
 
Top