NTAG 424 DNA – SDM CMAC Verification Fails with Custom Tag Data

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NTAG 424 DNA – SDM CMAC Verification Fails with Custom Tag Data

Jump to solution
2,815 Views
rabelais
Contributor I

Hello NXP Community,

We are currently implementing and testing an 'attendance verification system' based on 'Java Spring', using 'NTAG 424 DNA with SDM (Secure Dynamic Messaging)'.

### Test Environment

* 'Hardware': Omnikey HID 5022CL
* 'Software Tools':
・GoToTags Desktop
・TagXplorer
* 'Test URL Format':
'http://xxxxx.xxxxxx.com/user/nfcverify.do?uid=00000000000001&ctr=000000&c=0000000000000000'
* 'Offset Settings':
・UID Offset: '46'
・Read Counter Offset: '65'
・MAC Offset: '74'
・MAC Input Offset: '0'
* 'SDM Parameters in URL':
'uid', 'ctr', 'c'
* 'Keys Configured': Key 0 through Key 5 (all tested)


### Test Summary & Issue

1. We used 'both GoToTags and TagXplorer'.
In TagXplorer, even with 'SDM Mirroring enabled', the Offset fields remain grayed out and uneditable.
Therefore, all tag configuration was completed via 'GoToTags'.
2. All 6 keys (Key 0 ~ Key 5) have been tested with known values.
3. When using 'public test vectors' for AES-CMAC, our CMAC verification logic returns the correct result.
However, with 'our configured tag's data', the verification 'consistently fails'.


### Additional Observations

* We suspect the issue may relate to encoding or tag configuration (e.g., KDF, Truncation, Endianness, etc.).
* We have already tested all possible combinations of these settings to rule out configuration mismatches.
* We also found online that some tools may encode SDM data differently, depending on the version or environment.


### Request for Help

If anyone has insight or has experienced similar issues when configuring SDM with 'NTAG 424 DNA', we would greatly appreciate any suggestions or references.

Thank you very much in advance!

 

0 Kudos
Reply
1 Solution
2,779 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @rabelais

By any chance, have you referred to NTAG 424 DNA and NTAG 424 DNA TagTamper features and hints? Section 3 provides the details to get a deeper understanding on Secure Dynamic Messaging and also includes some examples of URLs with mirrored data. You can also refer to NTAG 424 DNA Data Sheet, Section 9.3.

Also, the 8-byte SDMMAC is calculated using AES according to the CMAC standard described in NIST Special Publication 800-38B, truncated by using only the 8 even-numbered bytes out of the 16 bytes output when represented in most-to-least-significant order. Could you please confirm that your verification is done according to this specification?

Please, consider that TagXplorer is an old software that is no longer supported. We recommend using RFIDDiscover, as this tool allows you to test and configure NTAG devices from our portfolio. RFIDDiscover supports many third-party PCSC devices; however, we also recommend PEGODA Contactless Smart Card Reader Based on PN7642.

Something important to remark is that RFIDDIscover is secured under NDA (Non-Disclosure Agreement); you can try requesting an NDA directly from the NDA online form. After this, you must request the tool through the Secure Files (Secure Access Rights FAQs | NXP Semiconductors).

Regards,
Eduardo.

View solution in original post

0 Kudos
Reply
2 Replies
2,780 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @rabelais

By any chance, have you referred to NTAG 424 DNA and NTAG 424 DNA TagTamper features and hints? Section 3 provides the details to get a deeper understanding on Secure Dynamic Messaging and also includes some examples of URLs with mirrored data. You can also refer to NTAG 424 DNA Data Sheet, Section 9.3.

Also, the 8-byte SDMMAC is calculated using AES according to the CMAC standard described in NIST Special Publication 800-38B, truncated by using only the 8 even-numbered bytes out of the 16 bytes output when represented in most-to-least-significant order. Could you please confirm that your verification is done according to this specification?

Please, consider that TagXplorer is an old software that is no longer supported. We recommend using RFIDDiscover, as this tool allows you to test and configure NTAG devices from our portfolio. RFIDDiscover supports many third-party PCSC devices; however, we also recommend PEGODA Contactless Smart Card Reader Based on PN7642.

Something important to remark is that RFIDDIscover is secured under NDA (Non-Disclosure Agreement); you can try requesting an NDA directly from the NDA online form. After this, you must request the tool through the Secure Files (Secure Access Rights FAQs | NXP Semiconductors).

Regards,
Eduardo.

0 Kudos
Reply
2,733 Views
rabelais
Contributor I

Thank you very much for your kind advice.

I'll try again using the combination of 'RFIDDiscover' and the 'PEGODA Contactless Smart Card Reader' as you suggested.

Much appreciated!

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2196324%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ENTAG%20424%20DNA%20%E2%80%93%20SDM%20CMAC%20Verification%20Fails%20with%20Custom%20Tag%20Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2196324%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20NXP%20Community%2C%3C%2FP%3E%3CP%3EWe%20are%20currently%20implementing%20and%20testing%20an%20'attendance%20verification%20system'%20based%20on%20'Java%20Spring'%2C%20using%20'NTAG%20424%20DNA%20with%20SDM%20(Secure%20Dynamic%20Messaging)'.%3C%2FP%3E%3CP%3E%23%23%23%20Test%20Environment%3C%2FP%3E%3CP%3E*%20'Hardware'%3A%20Omnikey%20HID%205022CL%3CBR%20%2F%3E*%20'Software%20Tools'%3A%3CBR%20%2F%3E%E3%83%BBGoToTags%20Desktop%3CBR%20%2F%3E%E3%83%BBTagXplorer%3CBR%20%2F%3E*%20'Test%20URL%20Format'%3A%3CBR%20%2F%3E'%3CA%20href%3D%22http%3A%2F%2Fxxxxx.xxxxxx.com%2Fuser%2Fnfcverify.do%3Fuid%3D00000000000001%26amp%3Bctr%3D000000%26amp%3Bc%3D0000000000000000%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fxxxxx.xxxxxx.com%2Fuser%2Fnfcverify.do%3Fuid%3D00000000000001%26amp%3Bctr%3D000000%26amp%3Bc%3D0000000000000000%3C%2FA%3E'%3CBR%20%2F%3E*%20'Offset%20Settings'%3A%3CBR%20%2F%3E%E3%83%BBUID%20Offset%3A%20'46'%3CBR%20%2F%3E%E3%83%BBRead%20Counter%20Offset%3A%20'65'%3CBR%20%2F%3E%E3%83%BBMAC%20Offset%3A%20'74'%3CBR%20%2F%3E%E3%83%BBMAC%20Input%20Offset%3A%20'0'%3CBR%20%2F%3E*%20'SDM%20Parameters%20in%20URL'%3A%3CBR%20%2F%3E'uid'%2C%20'ctr'%2C%20'c'%3CBR%20%2F%3E*%20'Keys%20Configured'%3A%20Key%200%20through%20Key%205%20(all%20tested)%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%23%23%23%20Test%20Summary%20%26amp%3B%20Issue%3C%2FP%3E%3CP%3E1.%20We%20used%20'both%20GoToTags%20and%20TagXplorer'.%3CBR%20%2F%3EIn%20TagXplorer%2C%20even%20with%20'SDM%20Mirroring%20enabled'%2C%20the%20Offset%20fields%20remain%20grayed%20out%20and%20uneditable.%3CBR%20%2F%3ETherefore%2C%20all%20tag%20configuration%20was%20completed%20via%20'GoToTags'.%3CBR%20%2F%3E2.%20All%206%20keys%20(Key%200%20~%20Key%205)%20have%20been%20tested%20with%20known%20values.%3CBR%20%2F%3E3.%20When%20using%20'public%20test%20vectors'%20for%20AES-CMAC%2C%20our%20CMAC%20verification%20logic%20returns%20the%20correct%20result.%3CBR%20%2F%3EHowever%2C%20with%20'our%20configured%20tag's%20data'%2C%20the%20verification%20'consistently%20fails'.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%23%23%23%20Additional%20Observations%3C%2FP%3E%3CP%3E*%20We%20suspect%20the%20issue%20may%20relate%20to%20encoding%20or%20tag%20configuration%20(e.g.%2C%20KDF%2C%20Truncation%2C%20Endianness%2C%20etc.).%3CBR%20%2F%3E*%20We%20have%20already%20tested%20all%20possible%20combinations%20of%20these%20settings%20to%20rule%20out%20configuration%20mismatches.%3CBR%20%2F%3E*%20We%20also%20found%20online%20that%20some%20tools%20may%20encode%20SDM%20data%20differently%2C%20depending%20on%20the%20version%20or%20environment.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%23%23%23%20Request%20for%20Help%3C%2FP%3E%3CP%3EIf%20anyone%20has%20insight%20or%20has%20experienced%20similar%20issues%20when%20configuring%20SDM%20with%20'NTAG%20424%20DNA'%2C%20we%20would%20greatly%20appreciate%20any%20suggestions%20or%20references.%3C%2FP%3E%3CP%3EThank%20you%20very%20much%20in%20advance!%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2197160%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20NTAG%20424%20DNA%20%E2%80%93%20SDM%20CMAC%20Verification%20Fails%20with%20Custom%20Tag%20Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2197160%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20very%20much%20for%20your%20kind%20advice.%3C%2FP%3E%3CP%3EI'll%20try%20again%20using%20the%20combination%20of%20'RFIDDiscover'%20and%20the%20'PEGODA%20Contactless%20Smart%20Card%20Reader'%20as%20you%20suggested.%3C%2FP%3E%3CP%3EMuch%20appreciated!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2196839%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20NTAG%20424%20DNA%20%E2%80%93%20SDM%20CMAC%20Verification%20Fails%20with%20Custom%20Tag%20Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2196839%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F256175%22%20target%3D%22_blank%22%3E%40rabelais%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EBy%20any%20chance%2C%20have%20you%20referred%20to%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12196.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ENTAG%20424%20DNA%20and%20NTAG%20424%20DNA%20TagTamper%20features%20and%20hints%3C%2FA%3E%3F%20Section%203%20provides%20the%20details%20to%20get%20a%20deeper%20understanding%20on%20Secure%20Dynamic%20Messaging%20and%20also%20includes%20some%20examples%20of%20URLs%20with%20mirrored%20data.%20You%20can%20also%20refer%20to%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fdata-sheet%2FNT4H2421Tx.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ENTAG%20424%20DNA%20Data%20Sheet%3C%2FA%3E%2C%20Section%209.3.%3C%2FP%3E%0A%3CP%3EAlso%2C%20the%208-byte%20SDMMAC%20is%20calculated%20using%20AES%20according%20to%20the%20CMAC%20standard%20described%20in%20NIST%20Special%20Publication%20800-38B%2C%20truncated%20by%20using%20only%20the%208%20even-numbered%20bytes%20out%20of%20the%2016%20bytes%20output%20when%20represented%20in%20most-to-least-significant%20order.%20Could%20you%20please%20confirm%20that%20your%20verification%20is%20done%20according%20to%20this%20specification%3F%3C%2FP%3E%0A%3CP%3EPlease%2C%20consider%20that%20TagXplorer%20is%20an%20old%20software%20that%20is%20no%20longer%20supported.%20We%20recommend%20using%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fapplications%2Ftechnologies%2Fsecurity%2Findustrial-security%2Frfiddiscover%3ARFID-DISCOVER%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ERFIDDiscover%2C%3C%2FA%3E%20as%20this%20tool%20allows%20you%20to%20test%20and%20configure%20NTAG%20devices%20from%20our%20portfolio.%20RFIDDiscover%20supports%20many%20third-party%20PCSC%20devices%3B%20however%2C%20we%20also%20recommend%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fdevelopment-boards-and-designs%2FCLRD730%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EPEGODA%20Contactless%20Smart%20Card%20Reader%20Based%20on%20PN7642%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3ESomething%20important%20to%20remark%20is%20that%20RFIDDIscover%20is%20secured%20under%20NDA%20(Non-Disclosure%20Agreement)%3B%20you%20can%20try%20requesting%20an%20NDA%20directly%20from%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fwebapp-signup%2FndaReqForm%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ENDA%20online%20form%3C%2FA%3E.%20After%20this%2C%20you%20must%20request%20the%20tool%20through%20the%20Secure%20Files%20(%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fsupport%2Fsupport%2Fsecure-access-rights%2Fsecure-access-rights-faqs%3ASEC-ACCESS-FAQS%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ESecure%20Access%20Rights%20FAQs%20%7C%20NXP%20Semiconductors%3C%2FA%3E).%3C%2FP%3E%0A%3CP%3ERegards%2C%3CBR%20%2F%3EEduardo.%3C%2FP%3E%3C%2FLINGO-BODY%3E