Mutt
Professional
- Messages
- 1,371
- Reaction score
- 914
- Points
- 113
For educational purposes, I will provide a more detailed explanation of how EMV chips work, their cryptographic protection, the role of hardware security modules (HSMs), and why cloning chips is difficult for carders. I will also provide context for carding, describing why fraudsters prefer other attack methods, and provide technical details to explain why counterfeiting EMV chips is virtually impossible for most attackers. I will also keep the answer within the bounds of a legal and ethical discussion, avoiding instructions on how to commit illegal acts.
Carders who commit fraudulent transactions with bank cards prefer magnetic stripes because they are easier and cheaper to clone. EMV chips, on the other hand, create many barriers to attack.
These examples show that even successful attacks on EMV systems are usually not aimed at cloning the chip, but at bypassing protocols or exploiting vulnerabilities in terminals.
For carders, counterfeiting EMV chips is "high risk, low reward." Most fraudsters choose more accessible methods, such as social engineering or exploitation of legacy systems (e.g. magnetic stripes). The EMV standard has significantly increased the security of payment systems, and its vulnerabilities are usually related to human error or weak terminal implementations, not to the chips themselves.
If you want to go into more detail on specific aspects (e.g. technical details of EMV protocols, terminal vulnerabilities, or cryptanalysis), write me and I will continue!
1. Basics of EMV chips and how they differ from magnetic stripes
EMV (Europay, MasterCard, Visa) is a standard for smart cards used in bank cards that has replaced the outdated magnetic stripes in most countries. To understand why counterfeiting EMV chips is difficult, it is important to compare them to magnetic stripes:- Magnetic stripe:
- Contains static data: card number, expiration date, cardholder name and CVV1.
- This data is easily copied using skimmers (devices installed on ATMs or terminals).
- Since the data is immutable, the cloned magnetic stripe card can be used for transactions in systems that do not require online authentication.
- EMV chips:
- These are microprocessors with protected memory and cryptographic functions.
- They generate dynamic data for each transaction, such as ARQC (Authorization Request Cryptogram), which makes it impossible to simply copy the data.
- The chips use cryptography to authenticate the card and transaction, and are tamper-resistant.
Carders who commit fraudulent transactions with bank cards prefer magnetic stripes because they are easier and cheaper to clone. EMV chips, on the other hand, create many barriers to attack.
2. EMV Cryptography: ARQC, iCVV and Keys
The cryptographic protection of EMV chips is based on complex algorithms and protocols that ensure transaction security. Let's look at the key elements:2.1 ARQC (Authorization Request Cryptogram)
- What is it? ARQC is a cryptographic code generated by the chip for each transaction. It confirms the authenticity of the card and protects transaction data from counterfeiting.
- How does it work?
- The chip receives transaction data from the terminal: amount, currency, date, terminal ID, random number (nonce), etc.
- Using the card's unique key (derived key), the chip calculates ARQC as a MAC (Message Authentication Code) using an algorithm such as 3DES (Triple DES) or AES.
- Formula (simplified):
ARQC = MAC (Key, Transaction Data || Nonce || Counter) - The ARQC is sent via the payment system (Visa, MasterCard, etc.) to the issuing bank, which verifies it using its copy of the key.
- Why is it difficult to counterfeit?
- ARQC is unique for each transaction and depends on the input data (e.g. amount and time). ARQC cannot be reused.
- The card key is stored in the secure memory of the chip and is not transmitted in clear text.
- To counterfeit ARQC, you need to know the card key, which requires extracting it from the chip or hacking the bank's HSM, which is extremely difficult (see the section on HSM).
2.2 iCVV (Integrated Circuit Card Verification Value)
- What is it? iCVV is a dynamic analogue of CVV1, used for transactions when the terminal does not support the chip and uses magnetic stripe data (fallback transactions).
- How does it work?
- iCVV is generated by the chip based on the cryptographic key and transaction data.
- It is different from the static CVV1, which is stored on the magnetic stripe and cannot be copied directly.
- Why is it difficult to counterfeit?
- Like ARQC, iCVV depends on a cryptographic key that is protected by hardware.
- Even if the carder copies the magnetic stripe data, the iCVV will be invalid without the correct key.
2.3 Cryptographic keys
- Key hierarchy:
- Issuer Master Key: Stored in the bank's HSM and used to generate keys for each card.
- Card Key: Unique to each card, derived from the master key. Stored in the chip's secure memory.
- Session Key: Can be generated for each transaction to further enhance security.
- Algorithms:
- The basic algorithm is 3DES (obsolete, but still used in some systems) or AES (modern standard).
- Key length: 128 bits for 3DES (effective length 112 bits due to algorithm features) or 128/256 bits for AES.
- Why is it difficult to get keys?
- The card keys never leave the chip and are protected by hardware.
- Master keys are stored in HSMs, which are resistant to physical and logical attacks.
3. The Role of HSM in Key Protection
Hardware Security Modules (HSMs) are a key element in protecting cryptographic keys in the EMV system.3.1 What is HSM?
- HSMs are specialized devices designed to securely store, generate, and use cryptographic keys.
- They are certified to standards such as FIPS 140-2/3 or PCI HSM and are used by banks, payment systems and card issuers.
- Примеры HSM: Thales nShield, Utimaco CryptoServer, IBM Crypto Express.
3.2 How does HSM protect keys?
- Physical protection:
- HSMs are resistant to physical opening. If an access attempt is made (for example, opening the case), the device erases all keys.
- Temperature, voltage and electromagnetic radiation sensors are used to prevent attacks.
- Logical protection:
- The keys are stored encrypted and never leave the HSM.
- All cryptographic operations (such as ARQC verification or card key generation) are performed inside the HSM via secure APIs.
- Access to the HSM is strictly controlled: multi-factor authentication is required, and keys are divided among multiple administrators (k-of-n control).
- Role in EMV:
- HSM stores the issuer's master keys from which card keys are generated.
- When processing a transaction, the HSM verifies the ARQC by comparing it to a calculated value using the master key and transaction data.
- The HSM also helps personalize cards by writing unique keys onto the chip when the card is issued.
3.3 Why is HSM difficult to hack?
- HSM attacks:
- Physical attacks: Require equipment costing hundreds of thousands of dollars (e.g. electron microscopes, FIB stations for working with microchips).
- Side-channel attacks: Differential power analysis (DPA), electromagnetic radiation analysis, or execution time analysis. These attacks require thousands of measurements and complex software.
- Logical attacks: Require vulnerabilities in the HSM firmware, which are extremely rare due to rigorous testing and certification.
- Economic inexpediency:
- Hacking an HSM requires resources available only to government agencies or large crime syndicates.
- Even if the HSM is successfully compromised, the keys are limited to a single issuer, reducing the value of the attack compared to the cost.
4. Why does EMV chip cloning require expensive equipment and expertise?
Cloning an EMV chip involves creating a card that can successfully authenticate itself in a payment system. This requires overcoming several technical barriers:4.1 Physical protection of the chip
- Hardware protection:
- EMV chips (for example, chips from NXP, Infineon or STMicroelectronics) have built-in protection mechanisms:
- Tamper-resistance: When physical access is attempted (for example, removing the protective layer), the chip self-destructs or erases the data.
- Encrypted memory: Keys are stored in a secure area of memory that can only be accessed through internal cryptographic operations.
- Anti-probing layers: Metal meshes or sensors that detect microprobing attempts.
- EMV chips (for example, chips from NXP, Infineon or STMicroelectronics) have built-in protection mechanisms:
- Necessary equipment:
- To extract data from the chip you need:
- Electron microscope (cost: $100,000–$1,000,000).
- Laser cutters for removing protective layers.
- FIB (Focused Ion Beam) for working with microchips (cost: $500,000+).
- Even with such equipment, success is not guaranteed due to the self-destruction of the chip.
- To extract data from the chip you need:
4.2 Extracting cryptographic keys
- Problem:
- The card keys are stored in secure memory and cannot be read directly.
- Trying to extract keys requires side-channel attacks:
- Differential Power Analysis (DPA): Measuring the power consumption of a chip during cryptographic operations to recover the key. Requires thousands of measurements and specialized software.
- Electromagnetic Analysis (EMA): Collecting the chip's emissions for analysis. Requires shielded rooms and $50,000+ worth of equipment.
- Timing attacks: Analysis of the execution time of operations to recover the key. The effectiveness of such attacks is reduced due to optimizations in modern chips.
- Expertise:
- These attacks require deep knowledge of cryptanalysis, microelectronics and programming.
- Only highly skilled professionals (for example, with experience in reverse engineering chips) can carry out such attacks.
4.3 Programming a Fake Chip
- Problem:
- Even if the keys are extracted, a chip needs to be created that emulates the behavior of the original EMV chip.
- This requires:
- Programmable smart cards (e.g. Java Card) that support EMV protocols.
- Accurate reproduction of the EMV protocol (ISO/IEC 7816 and EMVCo specifications).
- Programming the chip to generate valid ARQC and respond to terminal requests.
- Difficulties:
- Programmable smart cards are expensive ($10 to $100 each, depending on the model).
- Knowledge of EMV specifications (thousands of pages of documentation) and terminal communication protocols is required.
- The counterfeit chip must emulate the behavior of the original in real time, which requires high computing power and precise implementation.
4.4 Economic inexpediency
- Costs:
- Chip attack equipment: $100,000–$1,000,000.
- Time: months or years to develop an attack for one card.
- Expertise: We require a team of specialists with experience in cryptanalysis and microelectronics.
- Benefit:
- Successful cloning of one card provides limited access (for example, up to the transaction limit or until the card is blocked by the bank).
- Banks quickly detect suspicious transactions through monitoring systems, which reduces the cost of an attack.
- Comparison:
- Carders can make much more profit with less cost through phishing, skimming or terminal attacks.
5. Why do carders choose other methods?
In the context of carding, EMV chips are a difficult target, and fraudsters prefer simpler and cheaper methods:- Magnetic stripe skimming:
- In countries where magnetic stripe terminals are still used, carders install skimmers to copy static data.
- Skimmer cost: $100–$1,000, which is affordable even for small-time scammers.
- Fallback transactions:
- If the terminal does not support the chip, it may request data from the magnetic strip. Carders can replace the terminal or use cards with a counterfeit magnetic strip.
- Problem: Banks and payment systems are increasingly rejecting such transactions.
- Terminal Attacks:
- Carders can hack or spoof a POS terminal to intercept card data (such as PIN or transaction data).
- Example: installing shimmers (thin devices that read the chip data when the card is inserted). However, shimmers cannot extract keys, but only intercept data that still requires ARQC for validation.
- Phishing and Social Engineering:
- Obtaining card data (number, CVV2, PIN) through fake websites, calls or letters.
- It is much cheaper (cost of creating a phishing site: $50–$500) and does not require technical expertise.
- Contactless transactions:
- In some countries, contactless transactions for small amounts do not require a PIN or ARQC (offline transactions). Carders may use stolen cards or data for such transactions.
- Problem: The limits on such transactions are low, and banks quickly block suspicious cards.
- Attacks on online platforms:
- Carders use stolen card data for online purchases where a chip is not required (only the card number, CVV2 and expiration date).
- This is a popular method because it does not require interaction with a physical chip.
6. Practical examples and vulnerabilities
While EMV chips are highly secure, there have been cases in history where attackers have attempted to bypass their protection. However, these attacks highlight the difficulty and rarity of such attempts:- Attack on the EMV protocol (2010, Cambridge University):
- Researchers have shown that some EMV implementations can be subject to a man-in-the-middle attack by spoofing PIN data.
- This is not chip cloning, but an attack on the terminal, which requires physical access to the device and modification of its firmware.
- The issue was resolved by updating protocols and terminals.
- Shimmers:
- Devices installed in the chip slot can intercept the communication data between the chip and the terminal. However, they do not extract keys, only data that still requires ARQC for validation.
- Such attacks are limited and require physical access to the terminal.
- Offline transactions:
- In rare cases, terminals can accept offline transactions (without ARQC verification by the bank). Carders can try to use counterfeit cards in such scenarios, but this requires modification of the terminal.
These examples show that even successful attacks on EMV systems are usually not aimed at cloning the chip, but at bypassing protocols or exploiting vulnerabilities in terminals.
7. Conclusion
Counterfeiting EMV chips is theoretically possible, but extremely difficult due to:- Cryptographic protection: ARQC and iCVV use dynamic data and unique keys that cannot be forged without access to the card keys.
- Hardware protection: Chips are resistant to physical opening, and keys are protected in HSM.
- High costs: Equipment (microscopes, lasers, FIB) and expertise (cryptanalysis, reverse engineering) cost hundreds of thousands of dollars and require months of work.
- Economic inefficiency: Carders benefit more from simple methods such as phishing, skimming or terminal attacks.
For carders, counterfeiting EMV chips is "high risk, low reward." Most fraudsters choose more accessible methods, such as social engineering or exploitation of legacy systems (e.g. magnetic stripes). The EMV standard has significantly increased the security of payment systems, and its vulnerabilities are usually related to human error or weak terminal implementations, not to the chips themselves.
If you want to go into more detail on specific aspects (e.g. technical details of EMV protocols, terminal vulnerabilities, or cryptanalysis), write me and I will continue!