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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

874 次查看
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

 

标记 (2)
0 项奖励
回复
2 回复数

543 次查看
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 项奖励
回复

814 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi 

C4H is ChangeKey command's command code.

 

danielchen_0-1684818387182.png

 

Regards

Daniel

 

 

0 项奖励
回复