简体   繁体   English

DESFire EV1卡仿真

[英]DESFire EV1 card emulation

I need to emulate a DESFire EV1 card on an Android device. 我需要在Android设备上模拟DESFire EV1卡。 However, I'm confused on how to use the Mifare SDK (lite or advanced) with the HCE. 但是,我对如何在HCE中使用Mifare SDK(精简版或高级版)感到困惑。

Is that even possible? 那有可能吗? I need to start the project and I had a lot of researches about how the data are stored and ciphered in the DESFire cards but I ended up with the fact that I need to use Mifare SDK on HCE. 我需要启动该项目,并且对DESFire卡中的数据存储和加密方式进行了大量研究,但最后我需要在HCE上使用Mifare SDK。

First of all, you cannot use the MIFARE SDK to emulate cards. 首先,您不能使用MIFARE SDK来仿真卡。 The MIFARE SDK provides reader-side functionality only. MIFARE SDK仅提供读者端功能。

Second, you cannot emulate the whole functionality of MIFARE DESFire (EV1) cards using Android HCE. 其次,您无法使用Android HCE模拟MIFARE DESFire(EV1)卡的全部功能。 However, you can emulate parts of the MIFARE DESFire protocols (more specifically, you can only emulate ISO/IEC 7816-4 framing (either ISO command set or wrapped native command set) and only if preceded by an ISO SELECT by AID command). 但是,您可以模拟MIFARE DESFire协议的一部分(更具体地说,您只能模拟ISO / IEC 7816-4框架(ISO命令集或包装的本机命令集),并且仅在ISO SELECT by AID命令之前)。 If that's sufficient depends on the requirements of the reader side of your system. 是否足够取决于系统读者侧的要求。

  • If your reader only supports the DESFire native command set: You cannot emulate a corresponding card using Android HCE. 如果您的阅读器仅支持DESFire本机命令集:您不能使用Android HCE仿真相应的卡。
  • If your reader uses the wrapped native command set but does not start the communication with an ISO SELECT (by AID) command: You cannot emulate a corresponding card using Android HCE. 如果您的阅读器使用包装的本机命令集,但未使用ISO SELECT(通过AID)命令启动通信:您无法使用Android HCE仿真相应的卡。
  • If your reader uses the wrapped native command set and starts the communication with an ISO SELECT (by AID) command (the AID of MIFARE DESFire is D2760000850100 ): You can register your HCE service for the DESFire AID and will be able to receive all wrapped native commands after this AID has been selected. 如果您的读者使用包装的本机命令集,并通过ISO SELECT(通过AID)命令开始通信(MIFARE DESFire的AID为D2760000850100 ):您可以为DESFire AID注册HCE服务,并且将能够接收所有包装的选择此AID之后的本机命令。
  • If your reader uses the ISO command set but the first command is not an ISO SELECT (by AID) command: You cannot emulate a corresponding card using Android HCE. 如果您的阅读器使用ISO命令集,但第一个命令不是ISO SELECT(通过AID)命令:您不能使用Android HCE仿真相应的卡。
  • If your reader uses the ISO command set and starts the communication with an ISO SELECT (by AID) command (either for the MIFARE DESFire AID or (with DESFire EV1) for the ISO AID of one of the DESFire applications): You can register your HCE service for the DESFire AID (or the AID of the specific application) and will be able to receive all ISO commands after this AID has been selected. 如果您的读者使用ISO命令集并通过ISO SELECT(通过AID)命令开始通信(对于MIFARE DESFire AID或(对于DESFire EV1)对于DESFire应用程序之一的ISO AID,则可以进行通信:您可以注册您的DESFire AID(或特定应用程序的AID)的HCE服务,并且在选择此AID之后将能够接收所有ISO命令。

Note that there may be licensing issues if you emulate MIFARE DESFire cards. 请注意,如果您模拟MIFARE DESFire卡,则可能会出现许可问题。

MIFARE Classic cannot be emulated in HCE because it works directly on top of ISO 14443-3. 无法在HCE中模拟MIFARE Classic,因为它可以直接在ISO 14443-3之上运行。 HCE emulates the higher layer, ISO 14443-4. HCE模拟更高的层ISO 14443-4。 But that's the layer where MIFARE DESFire is implemented, so yes it can be done. 但这就是实现MIFARE DESFire的层,因此可以完成。 I have not done it myself but I know at least one company that has made it work, and probably there are several. 我自己还没有做过,但我知道至少有一家使它成功了,并且可能有几家。

I think Mifare SDK is : 我认为Mifare SDK是:

http://www.mifare.net/en/products/mifare-sdk/ http://www.mifare.net/zh/products/mifare-sdk/

If yes then with a simple search "Mifare SDK HCE", I found : http://www.mifare.net/en/micommunity/forum/mifare-and-nfc-reader-ics/can-nfc-phones-operate-rfid-tag-mifare-classic/ And in this thread, Mifare guy said: 如果是,则通过简单搜索“ Mifare SDK HCE”,我发现: http : //www.mifare.net/en/micommunity/forum/mifare-and-nfc-reader-ics/can-nfc-phones-operate- rfid-tag-mifare-classic /在这个线程中,Mifare的家伙说:

Unfortunately the MIFARE SDK does not support HCE. 不幸的是,MIFARE SDK不支持HCE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM