简体   繁体   English

如何使用Raspberry Pi RFID芯片模拟Apple Pay终端?

[英]How to emulate an Apple Pay terminal using a Raspberry Pi RFID chip?

So I recently bought the Mifare RFID RC522 chip for my Raspberry Pi B+ off Amazon and have since been unsuccessfully looking for a way to make my iPhone 6 think it was an Apple Pay terminal. 因此,我最近在亚马逊附近为Raspberry Pi B +购买了Mifare RFID RC522芯片,此后一直在寻找使我的iPhone 6认为它是Apple Pay终端的方法失败。

Does anybody know of a way of letting the RFID act as an Apple Pay terminal, so that my credit cards pop up on the iPhone as soon as it gets close to the NFC reader, similar to this video ? 是否有人知道让RFID充当Apple Pay终端的方式,以便我的信用卡在iPhone靠近NFC读卡器时立即弹出,类似于此视频吗?

In order to simulate a contactless credit card terminal to the iPhone (with Apple Pay), you would need to speak the EMV protocol (get the specifications from EMVCo ). 为了模拟iPhone(使用Apple Pay)与iPhone的非接触式信用卡终端,您需要说出EMV协议(从EMVCo获取规范)。

  1. You would first send a SELECT PPSE command to read the directory of available payment card applications: 首先,您将发送SELECT PPSE命令以读取可用支付卡应用程序的目录:

     00 A4 0400 0E 325041592E5359532E4444463031 00 00 A4 0400 0E 325041592E5359532E4444463031 00 
  2. You would get a directory that looks something like this in response: 您将得到一个类似于以下内容的目录:

     6F23840E325041592E5359532E4444463031A511BF0C0E610C4F07A0000000031010870101 9000 6F23840E325041592E5359532E4444463031A511BF0C0E610C4F07A0000000031010870101 9000 

    Using a BER-TLV parser you would decode this to: 使用BER-TLV解析器,您可以将其解码为:

    \n6F [35]: File Control Information (FCI) Template 6F [35]:文件控制信息(FCI)模板\n    84 [14]: Dedicated File (DF) Name 84 [14]:专用文件(DF)名称\n        325041592E5359532E4444463031 325041592E5359532E4444463031\n    A5 [17]: Proprietary Information Encoded In BER-TLV A5 [17]:以BER-TLV编码的专有信息\n        BF0C [14]: File Control Information (FCI) Issuer Discretionary Data BF0C [14]:文件控制信息(FCI)发行方酌情数据\n            61 [12]: Application Template 61 [12]:应用程序模板\n                4F [7]: Application Identifier (AID / DF name) 4F [7]:应用程序标识符(AID / DF名称)\n                    A0000000031010 A0000000031010\n                87 [1]: Application Priority Indicator 87 [1]:应用优先级指标\n                    01 01\n

    The interesting part is the Application template (tag 0x61). 有趣的部分是应用程序模板(标签0x61)。 This contains the AID of the payment application (within tag 0x47): 它包含付款应用程序的AID(在标签0x47内):

     A0000000031010 A0000000031010 
  3. You can then send a SELECT (by AID/DF name) command for the payment application: 然后,您可以为付款应用程序发送SELECT(按AID / DF名称)命令:

     00 A4 0400 07 A0000000031010 00 00 A4 0400 07 A0000000031010 00 

This should typically be enough to trigger the UI component of Apple Pay. 通常,这足以触发Apple Pay的UI组件。

In order to send these APDU commands to the iPhone usng the MFRC522, you would need a library that performs anticollision and activation (up to the ISO/IEC 14443-4 layer) of the contactless card emulated by the iPhone and that handles wrapping the APDUs into frames of the ISO/IEC 14443-4 transport protocol. 为了使用MFRC522将这些APDU命令发送到iPhone,您需要一个库,该库执行iPhone模拟的非接触卡的防冲突和激活(直到ISO / IEC 14443-4层),并处理包装APDU成ISO / IEC 14443-4传输协议的框架。

You can achieve this with a simple NFC card reader. 您可以使用简单的NFC读卡器实现此目的。 Every time you present your phone the credit card pops up and you can send information to the reader. 每次出示手机时,信用卡都会弹出,您可以将信息发送给阅读器。 Because of its security properties it will be a new UID every time you present your phone to the reader. 由于其安全性,每次您向阅读器展示手机时,它将成为一个新的UID。

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

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