Card emulation using NFC software

After reading a lot of questions, I decided to post this. I read that the Android version of Android does not support the API for emulating cards. In addition, we cannot write our own applications to protect elements embedded in nfc controllers due to keys controlled by google / samsung.

I need to imitate the map (mifare or desfire, etc.). The option that I see is executing using software. I have an ACR122U reader, and I tested that the NFC P2P mode works fine with the Nexus-S that I have.

1) I came across a site that said that the NFC nxus controller (pn532) can emulate a mifare 4k card. If so, can I write / read apdu commands for this emulated card? (Perhaps if I use a modified rum like a cyanogenmod)

2) Can I write an Android application that reads the apdu commands sent from the reader and generates the corresponding answers (if not completely, then only to some extent). To do this, I searched that we needed to fix connections with cynagenmod. Has anyone tried to emulate a card using this method?

I see that this is possible, because we have products from access control companies offering mobile applications through which you can open doors, for example. http://www.assaabloy.com/en/com/Products/seos-mobile-access/

+6
source share
3 answers

Some facts that may help in your quest:

  • The NFC controller in the Nexus S (and Galaxy Nexus, Nexus 7 and many other Android devices) is PN544
  • Emulation of the card can be performed either by a secure element connected to the NFC controller or by a host device (in this case, an Android device). Nexus S has a secure element that can be used for this (used in Google Wallet). Emulating a card from the host device is not a feature of the PN544 NFC controller, although some claim that they managed to get it to work.
  • You can enable card emulation with a secure element by rooting your device and following the instructions of fooobar.com/questions/438365 / ... (I have not tried this with 4.x JB, but I assume that it still works).
  • MIFARE Classic card emulation can be performed by a secure element in Nexus S, but not with a host device. DESFire card emulation is not supported by a secure element in Nexus S.
  • I researched a similar door lock product, which itself used card emulation to communicate with an NFC mobile device, using card reader / writer mode to communicate with access control cards.

IMO, the two simplest parameters are: use of P2P connection (Android Beam) or use of card emulation in the reader device (if it is supported). All other options require things like rooted devices and custom ROMs that are not reliable for the future and cannot be translated into a real product.

+3
source

Card emulation through software is now available with Android 4.4. http://developer.android.com/guide/topics/connectivity/nfc/hce.html

+2
source

2) Emulation of cards using software, of course, should be possible, but not shown in the current Android APIs. You will have to delve deeper into libnfc-nxp (and possibly below). It can be tricky. This feature is offered for Inside Secure chips, as shown in their reference OpenNFC implementation. The only question is whether a CLF firmware change is required. If not, then you can crack it into a software image.

However, warnings that you are missing the following functions: - security (Android application is not as secure as a smart card) - fast and predictable response time (well, it depends on how you code it) - card emulation when the phone is off.

I believe SEOS is based on ISO14443-4, not Mifare. This means that you need a safe element to run it.

1) I'm not too sure about this, I believe that it will still be hardware (for example, it depends on the built-in secure element, such as NXP SmartMX.

Another alternative is to start developing a secure element. The easiest way is to get some test SIM cards that support SWP / HCI. There is a free developer kit called IzyNFC that you can use for javacard, as well as GSMA and AFSCM technical documents for a third-party Android application.

0
source

Source: https://habr.com/ru/post/947768/


All Articles