NFC

Encryption on NFC Cards: AES and TLS Layers

Technical details of the AES-128, AES-256 and TLS encryption protocols used in NFC-based systems.

DK
Author
Digital Kartvizit
November 1, 202514 min read
NFC Kartlarda Şifreleme: AES ve TLS Katmanları

Security in modern NFC systems consists of multiple encryption layers stacked on top of each other. Each layer protects against a different threat model; the total architecture is designed so it cannot be compromised from a single point. This approach is known as 'defense in depth'; it's the gold standard for banking, military and high-security systems.

In this article, we'll examine the encryption layers in NFC cards at a technical level: chip-level authentication with AES-128, URL signing with HMAC-SHA256, transport encryption with TLS 1.3, and server-side at-rest encryption with AES-256. We'll explain the mathematical foundation, practical implementation, and which attack types each layer protects against in detail. By the end, you'll have CTO-level technical understanding of NFC security.

What is encryption? Fundamental concepts

Encryption is the process of converting plaintext into unreadable ciphertext. This conversion is done using a 'key'; without the correct key, the ciphertext cannot be read back. The first encryption examples in history were simple substitutions like the Caesar cipher; modern encryption is mathematically far more complex.

There are two main types of encryption. Symmetric encryption: the same key is used for both encrypting and decrypting. Fast but key sharing is difficult. AES is in this category. Asymmetric encryption: two separate keys — public (shared) and private (secret) — are used. Slow but key sharing is secure. RSA and ECC are in this category.

Modern security systems use both types. Typically, asymmetric encryption is used to securely share a 'session key'; then fast symmetric encryption is used for data transfer. TLS uses this hybrid approach.

Hashing is not encryption but is closely related. A hash function (like SHA-256) produces a fixed-length unique 'fingerprint' of data; this operation is one-way (irreversible). Used in data integrity verification and digital signatures.

1. Chip-level encryption: AES-128 and NTAG424 DNA

The newest and most security-advanced member of the NFC chip family, NTAG424 DNA, produces a dynamic verification token with AES-128 on each read. This feature completely eliminates the fundamental vulnerability of classic NFC — static content copiability.

AES (Advanced Encryption Standard) is a symmetric encryption algorithm standardized by NIST in 2001. It comes in 128, 192, and 256-bit key sizes. AES-128 provides sufficient security; brute force cracking is not possible (10^38 possible combinations). The NSA recommends AES-256 for classified data and AES-128 for sensitive but unclassified data.

NTAG424 DNA operating principle: every chip contains a hidden AES-128 'master key.' This key is programmed at the factory; extracting it from the chip is impossible (by the manufacturer's technical controls). Each time the chip is read, it encrypts transaction-specific data with the master key to produce a 'SUN message' (Secure Unique NFC). This message is appended to the URL as a parameter.

Server verification flow: the phone sends the URL to our server. The server decodes the SUN message in the URL parameter; it performs the same calculation with the same master key on its side. If the two SUN messages match, the card is original; if they don't match, the card is fake or cloned.

The beauty of this architecture: the master key never leaves the chip, is never transmitted over the network, and never appears in log files. Only the manufacturer and server know the master key; since an attacker can't obtain the key, they can't create a fake card.

2. URL-level signing: HMAC-SHA256

In addition to chip-level encryption, there's a URL-level signing layer. The URL on your card actually contains a token signed with HMAC-SHA256 (Hash-based Message Authentication Code with SHA-256).

What is HMAC? A cryptographic technique designed for message integrity and authentication. It passes a message through a hash function (SHA-256) together with a secret key; the result is an 'authentication tag.' The same message + same key always produces the same tag.

URL signing flow: when the profile URL is created, an additional HMAC tag is added. For example: dkartvizit.co/ahmet-yilmaz?sig=abc123def456. When the server receives the URL: it passes the user part (ahmet-yilmaz) through HMAC-SHA256 with the secret key; compares the result with the sig parameter in the URL.

If there's no match: the URL has been manipulated. The server denies access and returns an 'invalid signature' error. This provides protection against phishing or URL hijacking attacks.

The security of HMAC-SHA256: the SHA-256 hash function has high collision resistance. Producing the same hash for two different inputs is mathematically impractical. Generating a valid HMAC tag without the secret key is not possible.

3. Transport level: end-to-end encryption with TLS 1.3

The moment the card is read, all traffic between the phone and Digital Kartvizit's server is end-to-end encrypted with TLS 1.3 (Transport Layer Security version 1.3). This is the most current standard used in modern banking and government applications.

TLS 1.3 was standardized by the IETF in 2018; it closes all known vulnerabilities of older versions (TLS 1.2, 1.1, 1.0). Important improvements: handshake time reduced from 2 round trips to 1 (faster connection), weak cipher suites (RC4, 3DES, MD5) eliminated, perfect forward secrecy made mandatory.

What does perfect forward secrecy (PFS) mean? A new encryption key is generated for each session. Even if one session's key is compromised, past or future sessions are unaffected. In classic encryption, if a single master key is compromised, all past traffic can be cracked; PFS eliminates this risk.

TLS 1.3 cipher suites: AES-128-GCM, AES-256-GCM, ChaCha20-Poly1305. All are authenticated encryption (AEAD); encryption + integrity checking in a single operation. AES-GCM is the modern banking standard; ChaCha20-Poly1305 is faster on mobile devices (for devices without hardware acceleration).

In practical terms: when an attacker intercepts traffic between the phone and server, they only see encrypted data. Decrypting this data without the encryption key is impossible. Brute forcing AES-128 would require billions of years of computing time on current supercomputers.

4. Server-side: at-rest encryption with AES-256

Your profile information is stored encrypted with AES-256 on Digital Kartvizit's servers. Even with physical access to the database, data cannot be read without encryption keys.

At-rest encryption protects data that is not actively being used. Database files, backups, log files — all are encrypted. During active use (decrypt-on-read), the cipher is decrypted; after the response is produced (write), it's encrypted again.

AES-256 is the strongest version of the AES family. Approved by the NSA for top secret data classification. 256-bit key size (2^256 possible combinations), even quantum computers don't pose a practical threat (quantum computers would need 2^128 operations with Grover's algorithm to crack AES-256 — still astronomical).

Key management: AES-256 keys are stored in an HSM (Hardware Security Module) based system like AWS KMS (Key Management Service). HSM provides physical hardware security; keys are never transferred to RAM, only processed within the HSM. Keys are regularly rotated (every 90 days).

Practical protection: even if an attacker gains physical access to the database (e.g., disk theft), they only see encrypted data. Keys are secure in the HSM; a separate compromise is needed. Multi-tier security architecture.

Certification and auditing: ISO 27001

Digital Kartvizit's infrastructure is certified to the ISO/IEC 27001:2022 standard. This is the international standard for Information Security Management Systems (ISMS). It covers 114 control points; each is verified through independent auditing.

The certification process is annual. An accredited auditing body (like BSI, TUV, SGS) examines our systems; checks our policies; interviews our employees; tests the technical infrastructure. If found compliant with the standard requirements, the certificate is renewed; if not found compliant, time is granted or the certificate is revoked.

Additionally, independent penetration tests are conducted twice a year. White hat hacker teams (like Offensive Security) simulate attacks on our systems; they report vulnerabilities found. These vulnerabilities are fixed within 30 days; report results are shared with Enterprise customers.

Compliance certificates are critical for customer trust. For high-security customers like insurance companies, banks, and government agencies, ISO 27001 certification is a vendor selection criterion. Digital Kartvizit having this certification is an important differentiator in corporate customer acquisition.

Threat models and countermeasures

Threat 1: Chip cloning. Attacker copies your card's content to another chip. Countermeasure: dynamic AES-128 token with NTAG424 DNA. Cloned chip cannot generate a new token; server detects it.

Threat 2: URL hijacking. Attacker gets a similar URL and redirects users to a fake profile. Countermeasure: HMAC-SHA256 URL signing. Manipulated URLs have invalid signatures.

Threat 3: Man-in-the-middle attack. Attacker intercepts and manipulates communication between phone and server. Countermeasure: TLS 1.3 end-to-end encryption + certificate pinning. Practically impossible.

Threat 4: Database breach. Attacker accesses the database and steals data. Countermeasure: AES-256 at-rest encryption + HSM key management. Encrypted data cannot be read.

Threat 5: Insider threat. Employee or authorized user misuses access to sensitive data. Countermeasure: role-based access control, audit log, principle of least privilege. Every action is recorded; abnormal activity is detected.

Threat 6: Phishing. Users being deceived through social engineering. Countermeasure: user education, communication through official channels, mandatory 2FA. Technology alone isn't enough; user awareness is critical.

Quantum computing threat: future preparedness

Quantum computing poses a new threat to classical encryption algorithms. It's not yet a practical threat — today's quantum computers are extremely limited (1,000-5,000 qubits) — but it could become a significant concern within 10-15 years.

Shor's algorithm: quantum computers can theoretically break asymmetric encryption algorithms like RSA and ECC quickly. This will affect current SSL/TLS certificates. The industry is planning to transition to 'post-quantum cryptography' (PQC) algorithms.

Grover's algorithm: weakens symmetric encryptions like AES by half. AES-128 effectively drops to AES-64 level (still practically hard to crack). AES-256 effectively remains at AES-128 level (secure).

Digital Kartvizit's roadmap plans a hybrid transition to PQC algorithms by 2027-2028. CRYSTALS-Kyber and CRYSTALS-Dilithium algorithms standardized by NIST in 2024 will be used. No changes are required for users; the backend infrastructure is silently renewed.

Practical security recommendations for users

Recommendation 1: Protect your dashboard account with 2FA. Password + phone confirmation (Google Authenticator or SMS). Password alone doesn't provide sufficient security.

Recommendation 2: Regular password updates. Change your password at least once a year. Don't reuse passwords you commonly use across different sites.

Recommendation 3: Watch out for phishing. The Digital Kartvizit team never asks for your password or requests account details via email. Use the official support channel for suspicious emails.

Recommendation 4: Don't keep sensitive information on your profile. National ID, bank account number, credit card information should not be on your digital business card. Public contact information is sufficient.

Recommendation 5: Check your account regularly. Look at the audit log monthly; is there any access you don't recognize? Review activity logs.

FAQ

Frequently Asked Questions

Answers to the 6 most asked questions on this topic.

Do encryption layers affect performance?
Very little. Modern CPUs support AES instructions (AES-NI); encryption operations are completed at the nanosecond level with hardware acceleration. Profile loading time increases by 5-10 ms due to encryption; unnoticeable by users.
Is there support for older TLS versions?
No. TLS 1.2 support was removed in 2024; only TLS 1.3 is supported. Older versions have known security vulnerabilities; modern browsers already automatically use TLS 1.3. If you have a very old device (pre-2018), you may experience connection issues.
Is there a practical difference between AES-256 and AES-128?
In terms of security, both are sufficient. AES-128 is infinitely secure against current pre-quantum threats; AES-256 offers extra protection in the post-quantum era. Performance-wise, AES-128 is approximately 30% faster; preferred for transport encryption. AES-256 is standard for at-rest encryption.
Where can I verify the ISO 27001 certification?
The certificate number and validity date are listed on Digital Kartvizit's website 'Security' page. You can verify by searching the certificate number in the accredited audit body's (e.g., BSI) public certificate registry. Transparency is important.
Where is data stored (country)?
Turkish customer data is primarily stored on AWS Frankfurt (EU region) and AWS Istanbul (coming soon) servers. This is critical for KVKK and GDPR compliance. Custom region preferences can be made in Enterprise packages.
How can I access audit logs?
In Pro and Enterprise packages, there's an 'Audit Log' section in the dashboard. All accesses to your account, changes to your profile, password updates — everything is recorded with timestamps. If you detect abnormal activity, notify the Digital Kartvizit support team.
Didn't find an answer to your question?
Reach out to our team and we'll help you quickly.
Ask Us
DK
Author
Digital Kartvizit
All Posts