How to calculate the CMAC value used in ChangeKey command for NTAG 424

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

How to calculate the CMAC value used in ChangeKey command for NTAG 424

699 Views
echai
Contributor II

Hi everyone, I am currently trying to write the ChangeKey command implementation in Javascript. I ran into a few blockers & questions, and would like some clarification & help. I've read through both the Product Data Sheet & Application Note, and here is where I am stuck at:

1. How is Step 15 derived? My assumption (based on purely looking at related values) is that the Input for CMAC is made up of: Change Key Command (INS) || CmdCtr || TI || Value from Step 12
Is this assumption correct? Where did C4 come from?

2. Even using values from Table 26, I cannot get the value for Step 17. I attempted to generate a CMAC using the IV for CMACing as the CMAC key and the Input for CMAC as the value itself. This is most definitely wrong, as I cannot get the correct values. What values do I CMAC together to get the value in Step 17, and how is the IV for CMACing used?

Thank you!

Screenshot 2023-05-15 at 9.48.35 PM.png

 

Tags (2)
0 Kudos
2 Replies

368 Views
zahra2023
Contributor III

Hi @echai ,

Now I’m stuck at this step, and I’m also using JavaScript. Have you passed this step?

Any help appreciated.

0 Kudos

639 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi 

C4H is ChangeKey command's command code.

 

danielchen_0-1684818387182.png

 

Regards

Daniel

 

 

0 Kudos