Jollier
Professional
- Messages
- 1,197
- Reaction score
- 1,272
- Points
- 113
In EMV (Europay, Mastercard, Visa) chip card transactions, offline data authentication ensures the card is genuine and its data has not been tampered with, even when the terminal cannot connect to the issuer’s network. This is achieved through Static Data Authentication (SDA) and Dynamic Data Authentication (DDA). Below is a technical breakdown of how these mechanisms work:
1. Static Data Authentication (SDA)
SDA verifies static data stored on the card (e.g., card number, expiration date, certificate). It ensures the card’s data has not been altered or cloned.How SDA Works
- Issuer Certificates:
- The issuer (bank) embeds a digital certificate in the card during personalization. This certificate is signed by a Certification Authority (CA) public key (stored in the terminal’s secure element).
- The card also stores a hash of its critical data (e.g., PAN, expiration date) and a digital signature generated by the issuer’s private key.
- Terminal Verification:
- The terminal reads the card’s certificate chain and verifies the CA’s signature using its preloaded CA public key.
- Once the issuer’s public key is authenticated, the terminal recalculates the hash of the card’s static data and compares it to the decrypted signature using the issuer’s public key.
- If the hashes match, the data is confirmed as genuine and unmodified.
Limitations
- SDA only validates static data, making it vulnerable to cloning if the card’s data is copied.
- It does not detect counterfeit cards that replicate valid static data.
2. Dynamic Data Authentication (DDA)
DDA enhances security by validating dynamic data unique to each transaction, preventing replay attacks and cloning.How DDA Works
- Card Challenge:
- The terminal generates a random challenge (a unique number) and sends it to the card.
- The card combines the challenge with its internal data (e.g., transaction counter, unpredictable number) to generate a cryptogram (dynamic signature).
- Digital Signature:
- The card signs the challenge using its private key (unique to the card and derived from the issuer’s private key).
- The terminal verifies the cryptogram using the card’s public key, which is itself validated through the issuer’s certificate chain (similar to SDA).
- Dynamic Validation:
- Since the challenge is random and changes per transaction, the cryptogram is unique for each interaction. This prevents attackers from reusing intercepted data.
Advantages
- Prevents replay attacks: Each transaction requires a new cryptogram.
- Detects counterfeit cards: Attackers cannot forge the dynamic signature without the card’s private key.
3. Combined SDA + DDA (Hybrid)
Some implementations use both SDA and DDA for layered security:- SDA validates static data integrity.
- DDA ensures dynamic transaction uniqueness.
Offline Transaction Flow
- Card Insertion:
- The terminal reads the card’s ATR (Answer To Reset) and selects the EMV application.
- Data Authentication:
- The terminal requests the card’s certificate chain and performs SDA/DDA.
- Risk Management:
- If authentication passes, the terminal checks offline risk parameters (e.g., transaction counter, floor limit, velocity checks).
- Authorization:
- If risks are acceptable, the terminal approves the transaction locally (without contacting the issuer).
Security Implications
- SDA is sufficient for low-risk environments but is deprecated in favor of stronger methods.
- DDA is mandatory for high-security scenarios (e.g., contactless payments) to resist cloning.
- Offline vs. Online: Even with strong offline authentication, terminals may still require online authorization for high-value transactions or to update revocation lists.
Example (Simplified)
- SDA:
- Card sends:
Hash = SHA-1(Card Number + Expiry Date)
Signature = RSA_Encrypt(Issuer Private Key, Hash) - Terminal:
- Verifies issuer certificate with CA key.
- Recalculates hash and compares to decrypted signature.
- Card sends:
- DDA:
- Terminal sends challenge RND = 0x123456.
- Card computes:
Cryptogram = RSA_Encrypt(Card Private Key, RND + ATC),
where ATC (Application Transaction Counter) increments with each transaction. - Terminal verifies cryptogram using card’s public key.