<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to verify the CMAC myself? in NFC</title>
    <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047010#M7047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well in this case specifically&amp;nbsp; I do not know how to calculate this because I dont have the actual data, as you know every time you tap into your tag, there is some dynamic data that will be generated, so each tap there should be a different session key and I do not know the keys you have stored internally in the tag and please do not share them here since this is a public forum you dont want your keys posted here, the best would be that you apply this process to the tag or if you want you can do a dummy test where you do all the process with dummy data and keys but the best would be that you know your keys and apply the process that I have explained in my previous post here.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just take the ctr and UID and apply step 11, then step 12 to get the session mac key then the step 13 to get the mac,&amp;nbsp; it is important that you do this with the correct keys the ones in the app note are just for demonstration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jul 2020 20:26:35 GMT</pubDate>
    <dc:creator>Jonathan_Iglesias</dc:creator>
    <dc:date>2020-07-21T20:26:35Z</dc:date>
    <item>
      <title>How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1046998#M7035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Intro/Goal:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hi, my name is Manuel and&amp;nbsp; I am software engineer. Recently I bought some of your NTAG 424 DNA, that I want to use for a product authenticity solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Documents/Material:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I read through some documents but mainly the following two:&lt;BR /&gt;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/data-sheet/NT4H2421Gx.pdf" title="https://www.nxp.com/docs/en/data-sheet/NT4H2421Gx.pdf"&gt;https://www.nxp.com/docs/en/data-sheet/NT4H2421Gx.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/application-note/AN12196.pdf" title="https://www.nxp.com/docs/en/application-note/AN12196.pdf"&gt;https://www.nxp.com/docs/en/application-note/AN12196.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hardware:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I bought a Identiv u Trust 3700 F CL reader&amp;nbsp;that is&amp;nbsp;connected to my MacBook Pro and i am running the NXP TagXplorer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Configuration:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Using this as an example URL, where I have 3 custom params at the end, "n", "t", "p":&lt;/P&gt;&lt;P&gt;my-test-for-tags.com/scan?uid=00000000000000&amp;amp;ctr=000000&amp;amp;cmac=0000000000000000&amp;amp;n=2&amp;amp;t=1&amp;amp;p=3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I activated "ADD TAG UID", "ADD INTERACTION COUNTER" and "ENABLE SUN MESSAGE". I also set the calculated offset Index at 33 which is right after the questionmark in the URL (i hope this is correct?!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112860iC560C22B4B3CF80C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after writing this information to the tag i am going to NTAG 424 DNA Secruity settings where i hit "Authenticate First"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(for this first try i dont want to change any of the default keys on the chip, that would be my next step once i get this&amp;nbsp;simple example&amp;nbsp;working)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112861i53E3951127999A0A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After being successfully authenticated&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112862i190726BD69835FF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am going to the "File Management" options and&amp;nbsp;set the following data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112863iBAE7DC6150D2ACEE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When i go now to&amp;nbsp;NDEF Operations and click on READ NDEF button, it will give me for example this URI here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=c2017"&gt;https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;if i click the Read from Tag button again it gives me:&lt;BR /&gt;&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000022&amp;amp;cmac=211167FD30F03BEA&amp;amp;n=002&amp;amp;t=1&amp;amp;p=c2017"&gt;https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000022&amp;amp;cmac=211167FD30F03BEA&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which gives me the same uid, but an incremented counter and a new cmac which i guess is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This data is now being sent to the backend, but how can i now recalculate the cmac(&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=c2017" style="color: #2989c5; text-decoration: underline;"&gt;3E12626CBBFB3FB9&lt;/A&gt;)&amp;nbsp;given in the URI from the two params uid(&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=c2017" style="color: #2989c5; text-decoration: underline;"&gt;044B6A4A4E6880&lt;/A&gt;)&amp;nbsp;and ctr(&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=c2017" style="color: #2989c5; text-decoration: underline;"&gt;000021&lt;/A&gt;)&amp;nbsp;in my backend?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess I also need to know the key that was used to encrypt it also on the backend, correct?&lt;/P&gt;&lt;P&gt;I guess in this default case the key is just 16bits of zero like this 00&lt;SPAN&gt;00&lt;/SPAN&gt;&lt;SPAN&gt;00&lt;/SPAN&gt;&lt;SPAN&gt;00&lt;/SPAN&gt;&lt;SPAN&gt;00&lt;/SPAN&gt;&lt;SPAN&gt;00&lt;/SPAN&gt;&lt;SPAN&gt;00&lt;/SPAN&gt;&lt;SPAN&gt;00, correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But how exactly would this calculation now work? I cant figure it out with the two documents above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you please give me a step by step example for this cmac calculation on my backend with my values given here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2020 20:27:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1046998#M7035</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-06-15T20:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1046999#M7036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CMAC calculation algorithm shall be implemented manually if not included in a library you are using. Fortunately, it is perfectly explained in following app note, chapter 4.4.4.2:&amp;nbsp;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/application-note/AN12196.pdf" title="https://www.nxp.com/docs/en/application-note/AN12196.pdf"&gt;https://www.nxp.com/docs/en/application-note/AN12196.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Ivan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jun 2020 22:44:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1046999#M7036</guid>
      <dc:creator>IvanRuiz</dc:creator>
      <dc:date>2020-06-17T22:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047000#M7037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Ivan!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, but I already looked at the example from chapter 4.4.4.2 here (&lt;A class="link-titled" href="https://www.nxp.com/docs/en/application-note/AN12196.pdf" title="https://www.nxp.com/docs/en/application-note/AN12196.pdf"&gt;https://www.nxp.com/docs/en/application-note/AN12196.pdf&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.4.4.2 shows the following Java Method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;calculateMFCMAC(byte[] key, byte[] valueToMAC)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;which values from the example do i have to use for "key" and for "valueToMAC" to receive the value&amp;nbsp;94EED9EE65337086 for the CMAC?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;and which values would i have to use from my example up there to receive the value&amp;nbsp;3E12626CBBFB3FB9 for the cmac?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am really having a hard time here getting this to work :smileysad:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Manuel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2020 09:23:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047000#M7037</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-06-21T09:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047001#M7038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do not worry, it is a bit confusing at a first glance, but it is more understandable if you refer to the flow followed in table 5, and referring to the SUN mapping format example of chapter: 4.4.4.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Ivan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2020 21:47:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047001#M7038</guid>
      <dc:creator>IvanRuiz</dc:creator>
      <dc:date>2020-06-23T21:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047002#M7039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI, Ivan!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, still no change to get it running - tried everything by now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given table 5 which two values do i use from table 5 and feed to byte[] key and the byte[] valueToMac parameters for the function calculateMFCMAC below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume this calculateMFCMAC should return me the SDMMAC? so should give me the value&amp;nbsp;94EED9EE65337086 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am really having a very hard time working with this NFC-tags...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there maybe some chat here, where i can directly communicate with someone of the NXP technicians?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2020 14:54:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047002#M7039</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-06-29T14:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047003#M7040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="359401" data-username="manuel.mertl@gmail.com" href="https://community.nxp.com/people/manuel.mertl@gmail.com"&gt;Manuel Mertl&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Hope you are doing great, I believe the issue you are having is with the "Zero length input" Mac,&amp;nbsp; for this I believe there is a pseudo code in the AN mentioned before,&amp;nbsp; &amp;nbsp;please check the following:&lt;/P&gt;&lt;P&gt;this step&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/114108i70B5298E80C7527E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;translates to the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this case you first need to calculate the&amp;nbsp; mac on only 00's.&amp;nbsp; so first you are going to do the following:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/114107i317594FFCADB3C97/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;once you have this value you need to get the K1 and K2 values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/114104i3D4FA95947FC2B66/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this are going to be used in the next step which is getting the M1 Value,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/114105i76F0A02824B75D59/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;then you are going to calculate the MAC I used AES CBC 128,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/114106iCC73339F30B23D78/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this is better, and help you understand this process, some calculators and software for this support the zero length input&amp;nbsp; Mac so you only need to set some flag or just send the mac in 00s and they do it but it all depends on the sw used.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2020 16:36:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047003#M7040</guid>
      <dc:creator>Jonathan_Iglesias</dc:creator>
      <dc:date>2020-06-29T16:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047004#M7041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Jonathan!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your detailed answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i would need is a step by step calculations manual how i get from this URL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fmy-test-for-tags.com%2Fscan%3Fuid%3D044B6A4A4E6880%26ctr%3D000021%26cmac%3D3E12626CBBFB3FB9%26n%3D002%26t%3D1%26p%3Dc2017" rel="nofollow" style="color: #3d9ce7; background-color: #ffffff; border: 0px; text-decoration: underline; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by using&amp;nbsp;044B6A4A4E6880 (as uid) and&amp;nbsp;000021 (as ctr) to cmac(3E12626CBBFB3FB9)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The PDFs show examples with PICC_data&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what are the operations that i have to do, and in which order to get to&amp;nbsp;&lt;SPAN&gt;3E12626CBBFB3FB9 with&amp;nbsp;044B6A4A4E6880 and&amp;nbsp;000021.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope I explained my problem in a clear way. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have&amp;nbsp;here&amp;nbsp;hundreds of 424 DNA Tags next to me that are waiting to be configured :smileywink:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you :smileyhappy:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2020 17:10:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047004#M7041</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-06-29T17:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047005#M7042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Jonathan!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Still having troubles getting the correct output.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Please see my post above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2020 16:36:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047005#M7042</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-07-16T16:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047006#M7043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="359401" data-username="manuel.mertl@gmail.com" href="https://community.nxp.com/people/manuel.mertl@gmail.com"&gt;Manuel Mertl&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Hope you are doing great, as we discussed in our private messages&amp;nbsp; please check this :&lt;/P&gt;&lt;P&gt;in the application note you can check 4.4.4.2&amp;nbsp; this should work for you let me explain how,&amp;nbsp; there are different ways to do the SUN I will show the first two figures showed in AN.&amp;nbsp;&lt;/P&gt;&lt;P&gt;A.- is the way you are working&lt;/P&gt;&lt;P&gt;B.- is explained in the 4.4.4.2 example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116329i35B3A749B81A43EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;in this case the UID and CTR are encrypted and sent as "e" Variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;since you are sending the information in plain you can skip some steps of table 5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;so basically you can go directly into&amp;nbsp; step 11 because the previous steps Decrypt the information and get the UID, CTR, etc. in this case you already have that data because is in plain, so first&amp;nbsp; you will do the SV2, as explained in&amp;nbsp; step 11&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116330i22B6182C193A9613/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;the&amp;nbsp; you will need to create the session key for MACing like in step 12&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116331i2C9FEDB10F35ACF5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;which translates to this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116332iF653AF12DF135F99/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;then you will proceed to do the step&amp;nbsp; 13&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116333iFBF5CC62EF9BDC51/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;which I explained in the previous post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please let me know if this is clear to you or if you have any questions.&lt;/P&gt;&lt;P&gt;Have a nice day !&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2020 16:01:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047006#M7043</guid>
      <dc:creator>Jonathan_Iglesias</dc:creator>
      <dc:date>2020-07-20T16:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047007#M7044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jonathaniglesias"&gt;jonathaniglesias&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the answer, but i have some follow up questions to that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) is the start of the SV2 value always: 3CC3 0001 0080 no matter what UID and&amp;nbsp;Counter etc. i use? (so can i hard code this part?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) When calculating the KsesSdmFileReadMAC ... is this using the calculateMFMAC Java Function?&lt;BR /&gt;If so then the key-paramter would be 00000000000000000000000000000000 and the valueToMac-paramter would be&amp;nbsp;3CC30001008004DE5F1EACC0403D0000 ?&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116464i0F342A2A0B9BF930/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried it like this, but it gives me a different value:&lt;BR /&gt;I get&amp;nbsp;B5E3073D35AC936F instead of&amp;nbsp;3FB5F6E3A807A03D5E3570ACE393776F&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116465iDBAD97E6F23D5020/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 13:23:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047007#M7044</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-07-21T13:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047008#M7045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="359401" data-username="manuel.mertl@gmail.com" href="https://community.nxp.com/people/manuel.mertl@gmail.com"&gt;Manuel Mertl&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;for your first question,&amp;nbsp; the basic answer is yes, this is defined in the DS&amp;nbsp; section 9.3.9.1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116483i85FE07B5A2576464/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this is the previous step to session keys calculation, the SV1 is used for the session encryption and the SV2 is used for session MACing,&amp;nbsp; this is not the MAC this is used to generate the key to MAC data during a session. for example next time a customer taps on the tag the SV will change due to the ctr changes,&amp;nbsp; so each tap will generate a different key therefore a different key for encryption and MAC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for your second question the calculation should be correct, as you can see in my procedure for step 12 I see your calculations are correct,&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116484i1BADBD797DF5FA2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;as you can see here you split&amp;nbsp; the key into odd bytes,&amp;nbsp; the odd bytes are correct so the entire key should be correct, please dont do this here:&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116485i36286D26C132D073/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; that is done at the end of step 13,&amp;nbsp; not here,&amp;nbsp; because you need&amp;nbsp; the 16 bytes here for the step 13&amp;nbsp; calculations&amp;nbsp; as you can see the values on step 12 are used as key on step 13. then the result of 13&amp;nbsp; is split into odd bytes&amp;nbsp; to have 8 bytes of data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope I am being clear here if you still have questions let me know. I would highly recommend checking the&amp;nbsp; process on the DS and AN.&lt;/P&gt;&lt;P&gt;Hope you are doing great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 14:12:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047008#M7045</guid>
      <dc:creator>Jonathan_Iglesias</dc:creator>
      <dc:date>2020-07-21T14:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047009#M7046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for your explanation &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jonathaniglesias"&gt;jonathaniglesias&lt;/A&gt;‌, we are nearly there :smileygrin:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was finally able to recalculate the values from the document using this code below (for anyone interested):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116496iEDD978780C1F366C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116497i8679BFC1C264EAFA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;receiving the folllowing output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116498i428B3AE8F7D6F49A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I tried now to change my value for SV2 according to my first post all the way up here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so instead of using the following value from the example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_9.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116499i4CB9A6E551D40BA0/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_9.png" alt="pastedImage_9.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i used the uid(044B6A4A4E6880) and ctr(000021) from my example up there, leaving the other code the same:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_10.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116500i6349D41B098E72EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_10.png" alt="pastedImage_10.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which gave me the following result when i scanned the tag itself:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3"&gt;https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3"&gt;https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but my java app outputs the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_11.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116501iCE6CC2ED4F002CA6/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_11.png" alt="pastedImage_11.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so 3E12626CBBFB3FB9 != 704A92FA6DBBDB35&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;:smileysad:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you see any mistakes in my configuration screenshots from the first post? Like Offset numbers, wrong keys, etc?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find here again the screenshots:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_13.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116502iEDA6183E5679ACEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_13.png" alt="pastedImage_13.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_14.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116503i1A29224AAD837ED5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_14.png" alt="pastedImage_14.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_12.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116504i7295F92A632DFD7C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_12.png" alt="pastedImage_12.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 15:03:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047009#M7046</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-07-21T15:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047010#M7047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well in this case specifically&amp;nbsp; I do not know how to calculate this because I dont have the actual data, as you know every time you tap into your tag, there is some dynamic data that will be generated, so each tap there should be a different session key and I do not know the keys you have stored internally in the tag and please do not share them here since this is a public forum you dont want your keys posted here, the best would be that you apply this process to the tag or if you want you can do a dummy test where you do all the process with dummy data and keys but the best would be that you know your keys and apply the process that I have explained in my previous post here.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just take the ctr and UID and apply step 11, then step 12 to get the session mac key then the step 13 to get the mac,&amp;nbsp; it is important that you do this with the correct keys the ones in the app note are just for demonstration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 20:26:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047010#M7047</guid>
      <dc:creator>Jonathan_Iglesias</dc:creator>
      <dc:date>2020-07-21T20:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047011#M7048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jonathaniglesias"&gt;jonathaniglesias&lt;/A&gt;‌, &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/IvanRuiz"&gt;IvanRuiz&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for testing purposes, i have not configured any of the keys yet on the tag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i understood correctly everytime i tap the tag in my case only the&amp;nbsp;ctr-value and the&amp;nbsp;cmac-value&amp;nbsp;changes, correct? (since the UID stays the same), see my URL strucutre below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3"&gt;https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=&lt;/A&gt;&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3" style="text-decoration: underline;"&gt;000021&lt;/A&gt;&lt;A href="https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3"&gt;&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then i am creating the SV2 value by concat: "3CC3 0001 0080" +&amp;nbsp; UID +&amp;nbsp; CTR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which gives me:&amp;nbsp;3CC300010080044B6A4A4E6880000021&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then i am using my code from above calling:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;calculateMFCMAC(byte[] key, byte[] valueToMAC);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the key equals the 32 zeros and the valueToMac equals my SV2 as byte arrays&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so if the default key on the tag is 32-zeros then it should work, correct? ( -&amp;gt; but it doesnt)&lt;BR /&gt;&lt;BR /&gt;maybe you can see some of my configuration problem in the above screenshots?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 20:43:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047011#M7048</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-07-21T20:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047012#M7049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manuel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you are doing great, well I think the problem is&amp;nbsp; you are using the CTR in the wrong way&amp;nbsp; I just followed your data like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/116708i1AB15B0FCBCCAB34/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After Step 13 I get :&lt;/P&gt;&lt;P&gt;683e8e12a962a26c5ebb0afb343f90b9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;68 &lt;SPAN style="color: #ff0000;"&gt;3e&lt;/SPAN&gt; 8e &lt;SPAN style="color: #ff0000;"&gt;12&lt;/SPAN&gt; a9 &lt;SPAN style="color: #ff0000;"&gt;62&lt;/SPAN&gt; a2 &lt;SPAN style="color: #ff0000;"&gt;6c&lt;/SPAN&gt; 5e &lt;SPAN style="color: #ff0000;"&gt;bb&lt;/SPAN&gt; 0a &lt;SPAN style="color: #ff0000;"&gt;fb&lt;/SPAN&gt; 34 &lt;SPAN style="color: #ff0000;"&gt;3f&lt;/SPAN&gt; 90 &lt;SPAN style="color: #ff0000;"&gt;b9&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;cmac = 3e&amp;nbsp;12&amp;nbsp;62&amp;nbsp;6c&amp;nbsp;bb&amp;nbsp;fb&amp;nbsp;3f&amp;nbsp;b9&lt;BR /&gt;&lt;SPAN style="color: #3d3d3d;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fmy-test-for-tags.com%2Fscan%3Fuid%3D044B6A4A4E6880%26ctr%3D000021%26cmac%3D3E12626CBBFB3FB9%26n%3D002%26t%3D1%26p%3D3" rel="nofollow" style="color: #3d9ce7; background-color: #ffffff; border: 0px; text-decoration: underline; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;https://my-test-for-tags.com/scan?uid=044B6A4A4E6880&amp;amp;ctr=000021&amp;amp;cmac=3E12626CBBFB3FB9&amp;amp;n=002&amp;amp;t=1&amp;amp;p=3&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Which is equal to your calculation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jonathan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 15:08:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047012#M7049</guid>
      <dc:creator>Jonathan_Iglesias</dc:creator>
      <dc:date>2020-07-23T15:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047013#M7050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jonathaniglesias"&gt;jonathaniglesias&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I see now where my mistake is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My uid is &lt;SPAN&gt;044B6A4A4E6880 and my ctr is 000021&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Then i am creating the SV2 value by concat: "3CC3 0001 0080" +&amp;nbsp; UID +&amp;nbsp; CTR&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Which gives me:&amp;nbsp;3CC300010080044B6A4A4E6880000021&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;but instead of using this value, your value looks like this:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;3CC300010080044B6A4A4E6880210000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;so you remove the leading zeros and add them at the end.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 15:29:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047013#M7050</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-07-23T15:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047014#M7051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;:smileygrin:&amp;nbsp;let us know here in the community if in the future you have more questions.&lt;/P&gt;&lt;P&gt;Have a nice day !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 15:34:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047014#M7051</guid>
      <dc:creator>Jonathan_Iglesias</dc:creator>
      <dc:date>2020-07-23T15:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047015#M7052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;will do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you once again &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jonathaniglesias"&gt;jonathaniglesias&lt;/A&gt;‌ for your help :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 15:36:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1047015#M7052</guid>
      <dc:creator>manuel_mertl</dc:creator>
      <dc:date>2020-07-23T15:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify the CMAC myself?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1622069#M10163</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/138183"&gt;@manuel_mertl&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/65988"&gt;@Jonathan_Iglesias&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/166773"&gt;@IvanRuiz&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am following this guide and i have coded all the parts correctly except for the bit where you calculate m1 value.&lt;/P&gt;&lt;P&gt;I am using the url in the example above so i can verify that the values are correct at each step.&lt;/P&gt;&lt;P&gt;in my server code (i am using nodejs) I have calculated so far that&lt;/P&gt;&lt;P&gt;K2 =&amp;nbsp;&lt;SPAN&gt;38bc31467d83ae6525fbb5a2cfdf1694&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then i&lt;/SPAN&gt;&lt;SPAN&gt;n the docs it says&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If Mn is a complete block: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;M1 = K1 ⊕ M1* &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;else: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;M1 = K2 ⊕ (M1*||10^j)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;_________________&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Therefore&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;M1 = b8bc31467d83ae6525fbb5a2cfdf1694&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can see that the 3 from K2 has been replaced with a b in M1, but i dont understand where the b has come from.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;before this step i am able to calculate all values correctly. and if i hard code the swap for the 3 to b, then it continues to calculate the final CMAC value correctly. however, the hard code only works for this example of course, when i use a real tag (with a default private key of all 0) and the uid/ctr values are different, it doesnt work anymore, which is expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Please could you explain the M1 calculcation step?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Aamir&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 15:31:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-verify-the-CMAC-myself/m-p/1622069#M10163</guid>
      <dc:creator>aamirco</dc:creator>
      <dc:date>2023-03-26T15:31:50Z</dc:date>
    </item>
  </channel>
</rss>

