Reputation: 6126
I have a CRT-603-CZ1 smart card reader and I want to read 16 bytes of block 4 of a classic 1k Mifare contactless card. The authentication keys are the defualt values (i.e 0xFFFFFFFFFFFF
). So I must send 3 commands to the reader as below :
(The corresponding APDU commands are mentioned in the above manual.)
In order to send above APDU commands, I used OpenSCTool and you can see the result in the following:
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Failed to connect to card: Card is invalid or cannot be handled
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Sending: FF 82 00 00 06 FF FF FF FF FF FF
Received (SW1=0x90, SW2=0x00)
Sending: FF 86 00 00 05 01 00 04 60 00
Received (SW1=0x90, SW2=0x00)
Sending: FF B0 00 04 10
Received (SW1=0x90, SW2=0x00):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Failed to connect to card: Card is invalid or cannot be handled
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Sending: FF 82 00 00 06 FF FF FF FF FF FF
Received (SW1=0x90, SW2=0x00)
Sending: FF 86 00 00 05 01 00 04 60 00
Received (SW1=0x90, SW2=0x00)
Sending: FF B0 00 04 10
Received (SW1=0x90, SW2=0x00):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Failed to connect to card: Card is invalid or cannot be handled
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Sending: FF 82 00 00 06 FF FF FF FF FF FF
Received (SW1=0x90, SW2=0x00)
Sending: FF 86 00 00 05 01 00 04 60 00
Received (SW1=0x69, SW2=0x83)
Sending: FF B0 00 04 10
Received (SW1=0x69, SW2=0x82)
OpenSCTool:>
As you see above, I tried these there commands more than one time. but I didn't receive the same response.
0x9000
,0x9000
and 0x9000
as the status words.0x9000
, 0x6983
and 0x6982
as the APDU response status words.Note that I don't change anything about the reader or card during repeating above command. Everything is fixed.
What's wrong?
Update:
Note that this reader has a tool that it works fine for the same APDU commands. Look:
These are contents of log section:
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
As you see, all the response for different tries are equal.
So
Update 2:
I wrote a Python program using PySCard library to send above three commands in a row for 5 times. And all the five series have successful equal result (i.e 0x9000
for all 5*3 =15 commands). So it seems that there is problem with OpenSCTool.but I don't know what is the problem and why it respond like this.
Upvotes: 2
Views: 876