2
votes

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.

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?

2

2 Answers

2
votes

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).

  1. You would first send a SELECT PPSE command to read the directory of available payment card applications:

    00 A4 0400 0E 325041592E5359532E4444463031 00
  2. You would get a directory that looks something like this in response:

    6F23840E325041592E5359532E4444463031A511BF0C0E610C4F07A0000000031010870101 9000

    Using a BER-TLV parser you would decode this to:

    6F [35]: File Control Information (FCI) Template
        84 [14]: Dedicated File (DF) Name
            325041592E5359532E4444463031
        A5 [17]: Proprietary Information Encoded In BER-TLV
            BF0C [14]: File Control Information (FCI) Issuer Discretionary Data
                61 [12]: Application Template
                    4F [7]: Application Identifier (AID / DF name)
                        A0000000031010
                    87 [1]: Application Priority Indicator
                        01
    

    The interesting part is the Application template (tag 0x61). This contains the AID of the payment application (within tag 0x47):

    A0000000031010
  3. You can then send a SELECT (by AID/DF name) command for the payment application:

    00 A4 0400 07 A0000000031010 00

This should typically be enough to trigger the UI component of Apple Pay.

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.

0
votes

You can achieve this with a simple NFC card reader. 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.