5.10.5. MIFARE DESFire EV2 : Change Key¶
Warning
To run this example, you would need the nxpnfcrdlib component for which a Non-Disclosure Agreement(NDA) needs to be signed. Please contact your FAE for additional details.
5.10.5.1. Prerequisites¶
MIFARE DESFire EV2 : Prepare MFDFEV2 must have been executed, so that the MIFARE DESFire EV2 card has the required credentials. For relevant platforms, a KSDK package is available. Please import and execute the example MIFARE DESFire EV2 : Prepare MFDFEV2.
MIFARE DESFire EV2 : Prepare Secure Element must have been executed, so that the Secure element has the required credentials. For relevant platforms, a KSDK package is available. Please import and execute the example MIFARE DESFire EV2 : Prepare Secure Element.
Bring Up Hardware. (Refer Development Platforms)
Connect RC663 to your microcontroller. (Refer mifarekdf-rc663)
Note : Order of execution se05x_Ev2PrepareCard, se05x_Ev2PrepareSE, se05x_Ev2ChangeKey.
5.10.5.2. About the Example¶
This project demonstrates the Mifare Desfire EV2 ChangeKeyEv2 using Se05x.
It uses the following APIs and data types:
5.10.5.3. Running the Demo¶
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo
If everything is setup correctly the output would be as follows:
App :INFO :PlugAndTrust_v03.03.01_20210923
sss :INFO :atr (Len=35)
01 A0 00 00 03 96 04 03 E8 00 FE 02 0B 03 E8 00
01 00 00 00 00 64 13 88 0A 00 65 53 45 30 35 31
00 00 00
sss :WARN :Communication channel is Plain.
sss :WARN :!!!Not recommended for production use.!!!
App :INFO :Sleeping for 10 seconds for debugger stabilization
App :INFO :UID after L3 Activation (Len=10)
08 58 5E F7 00 00 00 00 00 00
App :INFO :ATS after L4 Activation (Len=6)
06 75 77 81 02 80
App :INFO :Select the AFC Application Successful
App :INFO :attempting to authenticate with cardkey = 0 and Se0Obj ID = 2103308289
App :INFO :
CARD =====> SE050 16-byte Ek(RndB) =
(Len=16)
5D 3F 1D 55 C1 73 D5 DD E3 9B 87 4F 5E C2 11 4F
App :INFO :
CARD <====== SE050 E(Kx, RandA || RandB') =
(Len=32)
84 0A E2 DA 38 B2 2B AA 2F 46 AC 92 88 41 F6 70
2E 08 26 8B 1E 1B C2 72 46 8A 26 92 F8 12 5E 2B
App :INFO :
CARD ======> SE050 32-byte E(Kx, TI||RndA'||PDCap2||PCDcap2) =
(Len=32)
58 D3 B6 7C 49 C9 07 13 CF 32 21 F0 40 6D 73 1E
21 AC 41 66 80 1C E6 2F 3F C8 50 F4 AB 29 77 B2
App :INFO :
CARD <====== SE050 E(Kx, RandA || RandB') =
(Len=12)
00 00 00 00 00 00 00 00 00 00 00 00
App :INFO : EV2 First Authenticate Successful
App :INFO :
CARD =====> SE050 16-byte Ek(RndB) =
(Len=16)
CE F2 E7 6F 15 D7 A3 D9 44 C1 5F E0 22 36 38 11
App :INFO :
CARD <====== SE050 E(Kx, RandA || RandB') =
(Len=32)
AF 77 8E A1 C7 99 1B BB E7 44 B7 5E EA EF DE 0F
94 DC 8E 1C C2 1E 32 E0 3F D4 D1 35 2D BD 35 13
App :INFO :
CARD ======> SE050 32-byte E(Kx, TI||RndA'||PDCap2||PCDcap2) =
(Len=16)
AE A2 59 A7 53 98 52 CE 62 38 0A 33 F8 ED 32 72
App :INFO : EV2 Following Authenticate Successful
App :INFO :Authenticated with cardkey = 0 and Se0Obj ID = 2103308289
App :INFO :attempting to change cardkey = 2 from Old Se050ObjID= 2103308289 to new Se050ObjID= 2103308290
App :INFO : Change Key for card key 2 is Successful to Se050ObjID= 2103308290
App :INFO : Auth session is reset in software
App :INFO : Auth session is killed in SE
App :INFO :ex_sss Finished