简体   繁体   English

Android NFC卡仿真/使用手机卡

[英]Android NFC card emulation / use phone as card

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. 由于安全原因,我已经读过Android上不支持卡仿真,但是可以通过Nexus S上的android 2.3.4 固件补丁实现。

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? 我的主要问题是,我是否真的需要卡片仿真来向阅读器发送定义的APDU并接收答案APDU或者是否有任何其他可能性通过滥用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. 感谢您回答有关卡片仿真的任何新见解。

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. 智能卡在NFC中使用的原因是因为NFC协议的构建方式使得无法提前知道正确的响应。 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). 为了使用手机模拟卡,您需要一个安全元件(手机上的智能卡芯片或手机中的SIM卡),并且您需要手机中的NFC芯片将卡仿真APDU路由到此安全元件(此可能是你所指的补丁正在做什么)。

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. 有一些方法可以在Android应用程序中进行卡片仿真,但我怀疑这需要大量修补,并且您将无法获得可预测的响应时间,因此您的读者可能不喜欢它。 Also this will prevent card emulation from working when your phone is off (battery delpleted for instance). 此外,当手机关机时(例如电池耗尽),这将阻止卡仿真工作。

It's possible in Android KitKat 4.4. 它可以在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 http://developer.android.com/guide/topics/connectivity/nfc/hce.html

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

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