3

I'm searching for a way to send specific commands from my phone to a reader. I have already read that card emulation is not supported on android due to securtiy reasons, but it is possible via a firmware patch for android 2.3.4 on the Nexus S.

My main question is, do I really need card emulation to send defined APDUs to the reader and to recieve the answer APDUs or is there any other posibility maybe by misusing android Beam?
If I need to use card emulation are there any new insights? The last posts, few posts I found are nearly one year old...

As adiditional information in the end I will not have any control over the reader.

Thanks for answering and on any new insights on card emulation.

Community
  • 1
  • 1
Jay
  • 281
  • 1
  • 4
  • 13
  • What kind of commands? ISO 7816-4 APDU commands? And please update the title, this looks sloppy. – Maarten Bodewes Jun 27 '12 at 20:44
  • yes exactly, ISO 7816-4 APdU commands are meant – Jay Jun 27 '12 at 22:19
  • It still reads "Anroid" :), I'll fix. – Maarten Bodewes Jun 27 '12 at 22:35
  • 1
    Uh, you cannot send APDU's from a card to a reader. The reader always acts as the initiator. Either the mobile acts as a reader, sending Command APDU's and receiving Response APDU's, or it acts as a card, receiving Command APDU's and sending response APDU's. – Maarten Bodewes Jun 27 '12 at 22:38
  • I'm sorry for the late answer. OK so I need to emulate a card on the phone. my goal is for example when I know the correcte response that the card will normally send to use my phone as a card and so answer the requstes from the reader correctly with the phone. Therefor it says android in the title because I want to use a Nexus S running android for this purpose – Jay Jun 29 '12 at 21:18

2 Answers2

0

What you are trying to achieve is somewhat candid. The reason smart cards are being used in NFC is because the NFC protocol is built in such a way that it is not possible to know the correct response in advance. There is always a secret involved, and you can't just guess it. Otherwise there would be a major security flaw in all the systems using contactless smartcards (building access control,

You can't just spy on the protocol, save the exchanges, and replicate them in some software, on most applications this will fail. There will be some random value at some stage, and some crypto computation to perform.

In order to emulate a card with the phone, you need a secure element (smartcard chip on the phone or the SIM card in your phone), and you need the NFC chip in your phone to route card emulation APDUs to this secure element (this is probably what the patch you are referring to is doing).

There are ways to do card emulation in an Android application, but I suspect this will require substantial patching, and you will not have predictible response time, so your reader might not like it. Also this will prevent card emulation from working when your phone is off (battery delpleted for instance).

Toluene
  • 751
  • 3
  • 9
  • I unchecked your answer because it is outdated and future readers can find the now relevant answer easier, hope this is ok for you. – Jay Nov 21 '13 at 20:25
  • Being more specifi would help. Also please note that the anwer dates back from 6 years ago and that many things are changed inbetween. Oh, well, whatever. – Toluene Mar 28 '19 at 13:36
0

It's possible in Android KitKat 4.4. Check out this link, more information will be added soon I belive.

http://developer.android.com/guide/topics/connectivity/nfc/hce.html

timbillstrom
  • 1,176
  • 16
  • 33
  • Thanks, I've seens it. The Problem is that eg the Nexus5 does not support Mifare Clasic (I know, not really part of the question) and I've tried the 4.4 custom rom Slimkat on the Galaxy Nexus, there the feature FEATURE_NFC_HOST_CARD_EMULATION is not supported. I did not investigate if this is a chip or software issue. – Jay Nov 21 '13 at 20:21
  • Did you try on the old Nexus smartphone or the latest Nexus 5? @Jay – timbillstrom Dec 18 '13 at 09:35