Mifare身份验证 [英] Mifare authentication

查看:150
本文介绍了Mifare身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我想通过Mifare Classic进行身份验证.

Say I want to authenticate to Mifare Classic.

我怎么知道要发送到卡的APDU的确切类型?

How do I know the exact kind of APDU to send to the card?

示例.

此代码:

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?例如,我怎么知道sendBuffer应该是什么?

is a sample program which tries to authenticate to Mifare Classic. My question is basically, how do I know what kind of APDU to send to the card? e.g., how do I know what should be in the sendBuffer?

推荐答案

阅读此文章.在这里,您将找到与Mifare卡通信的APDU结构...

Read this Article.Here you will find the APDU structure to communicate with Mifare card...

这篇关于Mifare身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆