AnsweredAssumed Answered

DESFire EV1 ChangeKeySettings INTEGRITY_ERROR

Question asked by Andrey Serenkov on Jul 12, 2019
Latest reply on Jul 15, 2019 by Javier Camino

Hello!

Could you please help me to find mistake in my code which is trying to do ChangeKeySettings

1. --- AUTHENTICATE ---
--> 90-0A-00-00-01-00-00
<-- 42-DC-C7-DE-5E-3B-5F-19-91-AF
Using Key 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

 

1) Decrypt rndB 42-DC-C7-DE-5E-3B-5F-19 = D0-F8-2F-36-70-36-6D-82
2) Rotate rndB left F8-2F-36-70-36-6D-82-D0
Generate RndA = 27-C3-05-B4-16-2E-8B-A8
RndA+RnbB = 27-C3-05-B4-16-2E-8B-A8-F8-2F-36-70-36-6D-82-D0
Encrypt RndA+RndB = 1E-7C-4B-BA-A6-87-65-6B-96-18-B8-2E-3C-42-05-84
--> 90-AF-00-00-10-1E-7C-4B-BA-A6-87-65-6B-96-18-B8-2E-3C-42-05-84-00
<-- 74-F4-F2-43-90-81-FE-AD-91-00
Decrypt 2nd frame 1E-7C-4B-BA-A6-87-65-6B-96-18-B8-2E-3C-42-05-84 = C3-05-B4-16-2E-8B-A8-27
Session key = 27-C3-05-B4-F8-2F-36-70-27-C3-05-B4-F8-2F-36-70


--- CHANGE Key Settings ---
Settings to set = 0F
CRC16 of data 0F = 09-A9
settings+CRC16+Padding= 0F-09-A9-00-00-00-00-00
Using session key 27-C3-05-B4-F8-2F-36-70 IV = 00-00-00-00-00-00-00-00
Encrypting 0F-09-A9-00-00-00-00-00 = 15-21-E8-64-57-64-BD-5F
--> 90-54-00-00-08-15-21-E8-64-57-64-BD-5F-00
<-- 91-1E

Outcomes