I am investigating the possibilities to emulate a mifare desfire card to simplify QA of a large authentication system.
My current ideas are:
Arduino implementation
Android implementation
I want an easy way of doing this.
I can see that cyanogenmod has done some development on this specific card.
But I also read it might be incompatible with the Samsung S4 which is my primary device. I can get a hold of some nexus phones if that helps. However, there seems to be some problems with this to
Here someone thinks emulating might be possible.
Concerning the arduino alternative, this seems a little harder to do, if the android alternative can be done. Does anybody have any experience with emulating the RFID on Android.
And in that case what phone did you use, and what software/libs?
Related
I know, there has been a few ppl asking this question but that was around the Time when Andriod 4.4 was still around. I found something in this Thread but im not sure if anything has changed since then.
Nothing in Android has changed, it's still not possible to emulate a non standard Mifare card unless the firmware of a specific chipset has the feature and you can hack it to enable it.
It's probably got even worse as there are more chipset suppliers for NFC in Android now and most of these don't even support reading Mifare cards never mind emulating them.
The only thing that might have made it better is more support for USB on the Go, which would allow you to use a NXP external USB reader that has Mifare emulation capabilities (no hacking needed for this)
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.
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
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).
I´ve been reading a lot about NFC, card emulation and etc.... I found two very helpful posts about this issue:
Android and Symbian NFC mobile development questions and answers (FAQ)
http://forum.xda-developers.com/showthread.php?t=1281946
Reading them I realized that it is quite complicated to write an application to make a payment.
Since I just want to see "something" working I'd like to ask the more experienced people if using the patch provided at xda-developers forum (second link above) would be enough just to write an appication that would open some door ou register/authorize someone´s entrance at an event (provided that I have a NFC device to properly interact with my phone, of course).
Thank you all
Payment is mostly impossible since you don't have the keys for the JavaCard card manager, better forget about it. Additionally, to write a Visa, etc compatible payment applet, you
need access to their specs, which means signing NDAs, paying money, etc.
Apparently the Mifare chip has stock keys, so you can modify it. So if you have a reader, and a device (door, etc.) that uses Mifare cards, you might be able to get it work. The thread also mentions that you might be able to clone your transport card. But:
you need to build your own firmware and flash it on a rooted phone
you may need to port the patches to whatever is the current GB version (2.3.7) or use exactly the same (old) tag
You need to do a lot more reading :)
In my opinion, you shouldn't bother with trying the patches on XDA Developers, especially if you are considering using Android 4.0 ICS. Android 4.0 already has built-in functionality on the Nexus S and Galaxy Nexus phones to enable card emulation. Drawback: you need a rooted phone to make it all work (see e.g. How to obtain NFCEE_ADMIN permission on rooted phone? for an example of someone succeeding).
A perhaps simpler approach is using NFC peer-to-peer communication ("Android Beam") with an external reader. This can work with any Android NFC device using a simple app to push the necessary data to the reader. Provided the reader support peer-to-peer communication, this is far the easiest solution. It would require some development work on the reader side, though, see http://code.google.com/p/ismb-npp-java/wiki/NppFromPhoneToACR122 for an example of this approach.
I'm currently working on my diploma work. Part of the work includes development of JavaCard applet for regular SIM cards. First option is to use JavaCard2.X API and use APDU commands to communicate with the applet. This might be very tricky as I need to develop client-app for android (which will be communicate with this applet) and that is so far possible only trough special - not so user friendly - API called Seek-for-android. (if I'm wrong, please correct me)
However, I also came across JavaCard3 Connected Edition, which provides much more options - for example web applets. Using webapps, deployed on SIM card and accessing them through browser in mobile device would be very convenient (of course developing such applet would be much easier as well). Problem is, that I can't find any mentions of Javacard3 being used in real life, or even on real SIM cards. I can't even find any mentions of possible date of release of such cards. Actually, there is almost no information on this topic.
So, my question is - do you know anything useful about this platform? Anything about real-life usage? Which card supports Javacard3? Are there any developers smart-cards, which are "JC3 enabled"? Will there be SIM cards with this platform in the future?
Thanks a lot for answers!!!
At JavaOne 2012 Moscow representatives of the JavaCard Oracle team demonstrated a prototype device with support for Java 3 Connected Edition based on Portable Security Token ES.
It's 2018 when I am writing this and I think this question needs a new answer.
Java Card 3 Connected Edition is dead in the water. It requires a large amount of RAM, which is still expensive even in the latest editions of the chips. SRAM takes large amounts of memory, and high end chips often still contain 8-10KiB of RAM max.
Furthermore, it was generated with the idea that web-developers would easily connect with it. This doesn't seem to have happened and it is questionable if a security device should be programmed by web-devs at all.
The additional overhead of the TLS protocol adds a heavy overhead without apparent benefit. The TLS protocol also requires a weird connection with the browser / end user. The idea that you can enter a PIN or password on a chip generated web page certainly has failed.
The idea of adding hardware support for browsers in general has failed. Before there were Java applets running in the browser, and the browser largely depended on add-ons. This has all gone away and it is very unlikely to return.
So even if RAM (or FRAM, MRAM, XCross or whatever hybrid memory solution will exist) ever comes cheap on a secure smart card processor, it is unlikely that JC 3 Connected will again see the light of day. Meanwhile Java Card Classic is still going strong although it is far from sexy at the moment - the OTN forum on Java Card is as good as dead (although OTN and sexy themselves are so far apart that they might as well exist on different poles, I certainly prefer SO).
There is no card in the field with JavaCard 3 right now. Everything under development.
But I recommend you to have a look to JSR 177. If Android supports it you can communicate with your applet by normal APDU commands.
I'm a C/C++ programmer with good windows and linux development experience and I also know a bit of java too. Recently, a client asked me to develop an Android app for him, wich, will most likely run on a Samsung Galaxy S or Galaxy S II, with Android 2.3, that basicaly consists in connecting a standard smartcard reader on the USB port of the device and using it to access the smartcard.
I have programmed smartcards before, but I have no experience with android. So my questions are:
Is it possible to do what I need in this hardware and O.S.?
Will I have to write my own driver to interface with the USB?
Going into more detail, I need to at least be able to execute APDU commands with the cards.
Something like the PC/SC standard. Are there any solutions in this subject already implemented?
Any ideas of where to begin?
Thanks in advance.
Short answer: not really.
Long answer: you might need to use custom firmware (Android build) to do this. Here's a project that does this, although their focus is on using embedded chips not external readers. They have a PC/SC implementation for Android.
Android has USB host support since 3.1, not sure if that is sufficient to implement a reader driver, so you can talk to your card: http://developer.android.com/guide/topics/usb/host.html
Even if you do though, you will need to somehow bridge it to your PC/SC stack.
Please open source it if you implement it :)
Did you test to connect a external smartcard reader to connect to a android device. What where results?
Greetings,
Wouter