Free NTAG 424 DNA SDM Offset Calculator

Build a Secure Unique NFC (SUN) verification URL template for NTAG 424 DNA or NTAG 424 DNA TagTamper, verify that it fits the 256-byte NDEF file (E104h), and get the exact byte offsets and 3-byte little-endian hex values for ChangeFileSettings (0x5F). Runs locally in this page with no key inputs, uploads or browser storage.

Updated

Your server endpoint without the dynamic SDM placeholders. Existing static query parameters are preserved.

SDM mirroring mode

Mirrors 16-byte AES-encrypted UID + counter as 32 ASCII hex characters (PICCDataOffset) plus the truncated AES-CMAC as 16 characters.

Holds 32 ASCII '0' placeholder bytes in the template.

16 ASCII hex chars (8-byte truncated AES-CMAC).

2 ASCII chars in plaintext mode on NT4H2421Tx.

Sets which byte in E104h starts the ASCII slice hashed into the AES-CMAC up to SDMMACOffset.

Calculated offsets & NDEF file

Enter a verification endpoint URL, or load the example URL, to calculate the SDM offsets.

E104h NDEF file usage –
256 bytes total (2-byte NLEN + up to 254B message)
SDM parameter Byte offset 3-byte LE (0x5F) Len Role
Enter a verification URL to see the offsets.

Template URI to write into NDEF

–
Sample tap URL (illustrative placeholders)
–
ASCII slice hashed by SDMMACInputOffset..SDMMACOffset
–
Complete E104h NDEF file hex & byte-by-byte map

Complete E104h file bytes (2-byte NLEN + NDEF message)

–

NDEF message only (without 2-byte NLEN)

–
File bytesSegmentHexBytes
No NDEF file built yet.

Need NTAG 424 DNA samples or factory SDM pre-configuration?

Proud Tek manufactures NTAG 424 DNA NFC labels in Shenzhen and can supply blank labels for your own personalisation or prepare an agreed NDEF/SDM configuration through our RFID and NFC encoding service. Use the optional brief to copy non-secret layout requirements; never include AES keys.

Standard product samples are free; custom or pre-configured samples carry a setup fee, confirmed in the quotation.

How NTAG 424 DNA SDM byte offsets are calculated

When Secure Dynamic Messaging (SDM) is enabled on NTAG 424 DNA’s NDEF file (E104h), the chip does not parse URL syntax. Instead, you write an ordinary NDEF URI record containing fixed-length ASCII zero placeholders (0x30), and give ChangeFileSettings (0x5F) the exact byte offsets from byte 0 of E104h where the chip should overwrite dynamic hex on each read.

Three framing details shift those offsets relative to the visible URL string:

  • Bytes 0–1 (NLEN): NFC Forum Type 4 Tags store a 2-byte big-endian message length before the NDEF message (NXP AN12196 §5.7).
  • Bytes 2–5 (NDEF short-record header): Because E104h is 256 bytes, any single URI record fits within the 1-byte Short Record payload length (≤ 254 bytes): D1 01 <payloadLen> 55.
  • Byte 6 (URI prefix identifier): NFC Forum URI records compress https:// (8 characters) into single byte 04h, and https://www. (12 characters) into single byte 02h. The rest of the UTF-8 URL starts at byte 7 either way.

Here is the build-time byte map for https://verify.example.com/tap?picc_data=00000000000000000000000000000000&cmac=0000000000000000 (94 of 256 bytes):

ParameterFile offset3-byte LE (0x5F)Length
PICCDataOffset 40 (0x000028) 28 00 00 32 bytes
SDMMACInputOffset 40 (0x000028) 28 00 00 38 bytes
SDMMACOffset 78 (0x00004E) 4E 00 00 16 bytes

Choosing SDMMACInputOffset and server verification rules

On each unauthenticated NDEF read, the chip derives a session MAC key from the configured SDMFileRead AES-128 key, UID and 24-bit read counter, then computes an 8-byte truncated AES-CMAC (NIST SP 800-38B; NT4H2421Gx §9.3.7–9.3.9). SDMMACInputOffset tells the chip which ASCII bytes inside E104h (with the dynamic placeholders already filled in) are fed into that CMAC calculation up to SDMMACOffset:

  • Start at first mirrored field (default): hashes from PICCDataOffset (or UIDOffset) through the separator right before the CMAC value (in the example above, 38 bytes: 0000…0000&cmac=). Your verification server must feed the exact same substring into its AES-CMAC check.
  • Start at URI payload (byte 7): binds the domain name and URL path into the CMAC as well, preventing someone from moving valid query parameters onto another path under the same key.
  • Equal to SDMMACOffset (0 bytes): hashes only the session vector SV2, without covering any NDEF file bytes.

Keep two architectural boundaries clear before ordering labels: first, rejecting repeated or out-of-order counters catches reused URLs, not a previously unseen tap URL captured earlier (NT4H2421Gx §9.3); second, if you encrypt the UID inside PICCData, the SDMMetaRead key cannot be UID-diversified (AN12196 §3.4.2).

Questions about NTAG 424 DNA SDM offsets

Why do SDM offsets differ from the character index in my https:// URL?

NTAG 424 DNA stores NDEF inside a 256-byte NFC Forum Type 4 file (E104h). Bytes 0 and 1 hold the 2-byte big-endian message length (NLEN), bytes 2 to 5 hold the 4-byte short-record NDEF URI header (D1 01 <len> 55), and byte 6 holds a 1-byte URI prefix code: 04h replaces the 8 characters of https://, while 02h replaces all 12 characters of https://www. Counting visible URL characters without subtracting the compressed prefix and adding the 7 framing bytes shifts every SDM offset and breaks CMAC verification.

Should I choose Encrypted PICCData or plaintext UID and counter mirroring?

Encrypted PICCData (32 ASCII hex characters) encrypts the 7-byte UID and 24-bit SDMReadCtr into one 16-byte AES-128 block under the SDMMetaRead key, hiding both from casual observers until your server decrypts them. Note NXP AN12196 §3.4.2: when the UID is encrypted, the SDMMetaRead key cannot be UID-diversified because the server needs it first to recover the UID. Plaintext mirroring (14 chars for UID, 6 chars for counter) lets the server look up the tag’s diversified SDMFileRead key directly from the visible UID.

How are SDM offsets formatted in the ChangeFileSettings (0x5F) command?

Every SDM offset and length in ChangeFileSettings (command code 5Fh) is sent as a 3-byte unsigned integer in little-endian order — least-significant byte first. For example, decimal offset 23 (0x000017) is sent as 17 00 00. The table above shows both the decimal/hex offset and the exact 3-byte little-endian value ready to copy.

Does this calculator ask for AES keys or send my verification URL anywhere?

No. Byte offsets depend only on the URL structure and placeholder lengths, never on secret keys, so this tool has no key inputs at all. Everything runs locally in your browser: nothing is uploaded, saved in browser storage or placed in inquiry links. Never include AES keys in an inquiry form or ordinary email. The analytics and cookie rules for the site are explained in the privacy policy.

Does a valid SDM CMAC and counter check block every replay?

No. Rejecting repeated or out-of-order counters stops reuse of URLs the server has already seen, but a tap message harvested earlier and never submitted can still pass a later check. NXP documents this boundary in the NTAG 424 DNA data sheet (§9.3). Your integrator must define the verification policy; Proud Tek supplies the labels and any agreed personalisation, not the verification backend.

Sources

Related pages

WhatsApp