Q: Card simulation on Android NFC mobile phone
Modify the last description
1. Q: Can I simulate a card on an androidnfc mobile phone?
A: It is technically feasible. However, for general developers, it only seems technically feasible :(
2. Q: How to implement it?
A: There are two methods: one is hardware-based, called the virtual card mode (virual card mode), and the other is software-based, it is called host card mode ).
In the virtual card mode, you need to provide the security module se. The NFC chip serves as the front-end of non-contact communication. It will receive commands from external readers and forward them to the se, and then the SE will reply.
External reader <---> NFC chip <---> Se.
In host card mode, you do not need to provide the se function. Instead, you can use an application running on your mobile phone to complete the se function.
External reader <---> NFC chip <---> application on the host
3. Q: What is Se? Is it on a mobile phone?
A: SE can be understood as a CPU card, generally a CPU card with a Java Vm, that is, a Java card. Mobile phones with NFC chips generally carry Se (or exceptions). For example, the pn65n of Google Nexus phones is the pn544 chip and smartmx security module. In addition, se can also be a special SIM card or SD card.
4. Q: How do I implement hardware-based card simulation?
A: First, develop a program running in SE, that is, a Java Applet, which is responsible for interpreting, processing, and Replying the commands received from the NFC chip. Then, you need to develop a Host application, which can download the applet to Se and activate it. Of course, if it is a complete mobile payment system, it should also include background applications, TSM, etc.
5. Q: How does se communicate with the host? How can I download a program to se?
A: depending on the se hardware, the hardware interfaces of the SE and the host are also different. For the built-in se, it is generally the nfcwi interface, while SIM and SD card may be the SWP interface. The application interface protocol is the ISO7816-4, that is, the CPU card APDU command. Anyone familiar with the CPU card knows that the card cannot be written without a key. Therefore, the accesskey of Se is required. Unfortunately, these keys are stored in mobile phone manufacturers (with built-in Se), such as Samsung, HTC, or mobile carriers (with SIM ), or in the hands of Security Module providers (SD card situations) such as banks, developers generally do not have these permissions.
6. Q: to what extent can I do without a key based on hardware?
A: At present, read-only access to se should be possible. For example, after installing Google Wallet, the Google Wallet applet will be created in se. we can select the applet through the program and send some query commands. That's all...
7. Q: How to implement software-based card simulation?
A: currently, the official Android version is not supported. You can use a third-party Rom to implement software-based card simulation, such as cyanogenmod.
8. Q: What cards can be simulated by card simulation?
A: It depends on the restrictions of both software and hardware. Generally, the virtual card simulation mainly depends on the hardware. Generally, the card type A/B is supported. For the card of the proprietary protocol, it depends on whether the chip manufacturer supports the card. For example, NXP chips can easily simulate M1 and ultralight, but not necessarily supported by other chips. Host card simulation generally only supports cards above the ISO14443-4.
9. Q: Is there any problem with software-based card simulation?
A: security is a major security issue. Security is always the most important for mobile payment applications, and the operating environment on mobile phones is insecure.
10. Q: in general, is it possible for general developers to implement card simulation and commercialization on Android NFC mobile phones?
A: In summary, the host card mode has serious security problems. In addition, if the current official Android version does not support the host card mode, it is impossible for users to flash the machine to support an application. Therefore, the host card model can only be studied technically, without the possibility of commercial applications. For the virtual card model, se is in the hands of mobile phone manufacturers, mobile operators, banks, and other industry giants. According to the current trend, general application developers can cooperate with these giants to obtain part of SE's right to use, generally, an application security domain is created to load its own virtual card. Small and medium-sized application developers can also consider releasing their own se Based on SD or external modules, but the cost of self-issuance is very high, and end users generally do not agree.