Authentication Mifare身份验证
假设我想通过Mifare Classic的身份验证 我如何知道要发送到卡的APDU的确切类型 示例。 此代码:Authentication Mifare身份验证,authentication,smartcard,rfid,mifare,Authentication,Smartcard,Rfid,Mifare,假设我想通过Mifare Classic的身份验证 我如何知道要发送到卡的APDU的确切类型 示例。 此代码: bcla = 0xFF; bins = 0x86; bp1 = 0x0; bp2 = 0x0; // currentBlock len = 0x5; sendBuffer[0] = bcla; sendBuffer[1] = bins; sendBuffer[2] = bp1; sendBuffer[3] = bp2; sendBuffer[4] = len; sendBuff
bcla = 0xFF;
bins = 0x86;
bp1 = 0x0;
bp2 = 0x0; // currentBlock
len = 0x5;
sendBuffer[0] = bcla;
sendBuffer[1] = bins;
sendBuffer[2] = bp1;
sendBuffer[3] = bp2;
sendBuffer[4] = len;
sendBuffer[5] = 0x1; // Version
sendBuffer[6] = 0x0; // Address MSB
sendBuffer[7] = currentBlock;
if(keyradioButton->Checked==true) // Address LSB
sendBuffer[8] = 0x60; // Key Type A
else if(keynumberradioButton->Checked ==true)
sendBuffer[8] = 0x61; // Key Type B
sendBuffer[9] = keynumber; // Key Number
sendbufferlen = 0xA;
receivebufferlen = 255;
//Invoke the Transmit command
retval = SCardTransmit(hCard, // A reference value returned from the SCardConnect function.
&sioreq,
sendBuffer, // Send buffer
sendbufferlen, // Send buffer length
&rioreq,
receiveBuffer, // Receive butter
&receivebufferlen); // Length of received buffer
是一个尝试验证Mifare Classic的示例程序。
我的问题基本上是,我如何知道什么样的APDU发送到卡?e、 例如,我如何知道发送缓冲区中应该包含什么?阅读此内容。在这里,您可以找到与Mifare卡通信的APDU结构…在Mifare Classic 1K标记中,有16个扇区,每个扇区包含4个块,每个块包含16个字节
有关更多详细信息,请阅读。很抱歉英语不好很抱歉,我不能理解这个问题……你能描述一下这个问题吗。@vikky:嘿,vikky,请看editMIFARE Classic本身不使用APDUs。APDU的使用是读卡器的扩展:在内部,它将APDU转换为实际的MIFARE Classic命令。为了澄清这个问题,我建议您添加您正在使用的读卡器的品牌和类型using@NFCguy:听到Classic不使用APDU,我很惊讶。你能给我看一些解释这一点的文件吗?还有您提到的,读者将APDU翻译成经典命令?我想了解更多。@NFCguy:是的,我看过了。事实上,我没有提到完整的APDU命令,例如,我将其用于身份验证。文档只是说,例如,60h是用于使用密钥A进行身份验证的命令。其他类型的Mifare卡(如Plus等)也是这样吗?他们不接受APDU的?谢谢vikky。密钥似乎也存储在读卡器上?是的,在进行身份验证之前,您必须将密钥加载到读卡器中。谢谢。再看看NFC的反应,当他说Mifare Classic不使用APDU时,我很惊讶。。。。
byte[] authenticationByte = new byte[10];
authenticationByte = new byte[] { (byte) 0xFF, (byte) 0x86, (byte) 0x00,
(byte) 0x00, (byte) 0x05, (byte) 0x00,(byte) 0x00, (byte) 0x04,
(byte) 0x60,(byte) 0x00 };