Reply To: MIFARE Classic and SAM AV2 Authentication

Forum MIFARE SmartCard IC`s MIFARE Classic and SAM AV2 Authentication Reply To: MIFARE Classic and SAM AV2 Authentication

Re: MIFARE Classic and SAM AV2 Authentication

12. April 2018 at 12:11
Hi,

Thank you for the support. I understand what you say. But the 0x6000 command does not work. I need to add CLA, INS, P1, P2, Lc, "Data", and Le (if any Le). For example to read the MF Classic UID the APDU is: FFCA000000
+------+------+------+------+------+
| CLA | INS | P1 | P2 | Lc |
+------+------+------+------+------+
| 0xFF | 0xCA | 0x00 | 0x00 | 0x00 |
+------+------+------+------+------+

Now to authenticate what would the APDU cmd be?
+------+------+------+------+------+--------------------------+----+
| CLA | INS | P1 | P2 | Lc | Data | Le |
+------+------+------+------+------+--------------------------+----+
| 0xFF | 0x86 | 0x00 | 0x00 | 0x05 | 0x01 0x00 0x00 0x60 0x00 | -- |
+------+------+------+------+------+--------------------------+----+

Now this does not work using my Pegoda reader and TestWinscard.exe (using APDU commands)! And its true, because the last byte (0x00) in Data, indicates the key positioning in the reader! - but I did not load any key in the reader memory, because I want to use the SAM.

If I use the "MIFAREdiscover" thats Ok, I have a solution, but that does not solve my problem. I need to work with APDU cmds.

Example Logs:
[10.04.2018 12:05:30] Info: phalMfc_Authenticate --------ENTRY-------- bBlockNo=3C, bKeyType=0A, wKeyNumber=003C, wKeyVersion=0000, pUid=xxxxxxxx
[10.04.2018 12:05:30] Info: Send To Card = 603C [How should I build this in CLA INS P1 P2 Lc Data Le]
[10.04.2018 12:05:30] Info: Recv From Card = 0A7D1949 , SUCCESS [to get this Rn 32 bits]
[10.04.2018 12:05:30] Info: SentFrmHost = 80...
[10.04.2018 12:05:30] Info: Send To SAM = 80...
[10.04.2018 12:05:30] Info: Recv From SAM = ...90AF, SUCCESS
...
...
[10.04.2018 12:05:30] Info: Recv From SAM = 9000, SUCCESS
[10.04.2018 12:05:30] Info: GivenToHost = 9000
[10.04.2018 12:05:30] Info: phalMfc_Authenticate --------LEAVE-------- [STATUS = SUCCESS]

Kind regards,
Adnan
+ 0  |  - 0