5.10.3. MIFARE DESFire EV2 : se05x_Ev2GetCardUID¶
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.3.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.
Examples se05x_Ev2ChangeKey and se05x_Ev2DivChngKey should not have been executed
Note : Order of execution se05x_Ev2PrepareCard, se05x_Ev2PrepareSE, se05x_Ev2GetCardUID.
Bring Up Hardware. (Refer Development Platforms)
Connect RC663 to your microcontroller. (Refer mifarekdf-rc663)
5.10.3.2. About the Example¶
This project is an example demonstrating the Mifare Desfire EV2 authentication using Se05x. After authentication it gets the UID from the desfire EV2 card.
It uses the following APIs and data types:
5.10.3.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 51 80 4D 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 = 2103308288
App :INFO :
CARD =====> SE050 16-byte Ek(RndB) =
(Len=16)
1A 20 7F FF 64 5E F7 49 D7 40 A5 72 72 82 CB 24
App :INFO :
CARD <====== SE050 E(Kx, RandA || RandB') =
(Len=32)
41 BF 63 61 3D 1B 8C DC 24 EC 9B 69 B2 E5 97 A0
6D D8 8B 62 8D 21 38 B5 64 D6 AD C3 50 CF BF E0
App :INFO :
CARD ======> SE050 32-byte E(Kx, TI||RndA'||PDCap2||PCDcap2) =
(Len=32)
58 E6 33 4C 97 E0 ED 4E 4E 5F 18 4D CE BA D8 E5
33 5A A4 22 98 32 C8 D9 7D C7 8B 42 0B 47 48 73
App :INFO :
CARD <====== SE050 E(Kx, RandA || RandB') =
(Len=12)
00 00 00 00 00 00 00 00 00 00 00 00
App :INFO :Dumped Session Key is (Len=16)
83 82 BC 32 A5 63 AB 35 2E E0 16 65 B5 48 9D 38
App :INFO :Dumped Session Mac is (Len=16)
7E 34 5E 3D AA 83 F0 FD AD C6 38 FB 05 04 ED 13
App :INFO :Dumped TI is (Len=4)
AB 97 3B 6C
App :INFO :pDataParams->wCmdCtr=0
App :INFO : EV2 First Authenticate Successful
App :INFO :CARD UID is as below (Len=7)
04 41 65 7A 6E 4D 80
App :INFO : Auth session is reset in software
App :INFO : Auth session is killed in SE
App :INFO :ex_sss Finished