The most reliable way to diagnose an NFC security issue is to connect the physical tag, its issuing configuration and the verifier's actual behavior. The following checks are designed for controlled engineering tests, not as a replacement for the silicon vendor's documentation.
1. Confirm the actual issuing Profile
Begin with the Profile that personalized the tag, not a generic SDM example. Record the NDEF template, enabled mirroring options, file access settings and the keys used for the MAC and any encrypted data.
A valid NFC URL only shows that NDEF was readable. It does not establish that the backend can verify its cryptographic content.
2. Check URL offsets and encoded lengths
Compare the expected mirror offsets against the bytes actually written to the NDEF file. A misplaced placeholder or a different URI prefix changes what the tag mirrors and what the server parses.
Check hexadecimal field lengths before decoding. Be careful with URL encoding, capitalization and transformations performed by redirects or application frameworks. Verify the exact bytes expected by the configured SDM scheme.
3. Decode encrypted PICC data correctly
If the Profile uses encrypted PICC mirroring, decode and decrypt using the configured scheme and corresponding key material. Do not treat the ciphertext as a plaintext UID or counter.
Figure 1, Figure 2 and Figure 4 style configurations expose different combinations of mirrored fields. The verifier must follow the issued configuration, not assume one universal URL layout.
4. Separate MAC failures from replay rejection
First establish whether the cryptographic MAC matches. Then evaluate the tag reference, accepted counter state and lifecycle rules. A previously accepted message may still have a valid historical MAC but be rejected as a replay.
Log a non-sensitive reason code such as malformed message, unknown tag, MAC mismatch, replay or revoked. Never log plaintext master keys or derived session secrets.
5. Use a small negative-test matrix
Capture a valid read from a real personalized tag. Repeat the verification, alter one MAC character, modify the encrypted PICC field and test an unknown tag. Compare each outcome against the documented policy.
If verification fails, compare the actual tag file settings and the backend Profile before changing cryptographic code. A configuration mismatch is often easier to diagnose than a guessed algorithm defect.
Technical note: the exact commands, key roles and message formats depend on the issued tag configuration and relevant NXP documentation. No live key values are provided here.
← All engineering articles