title: What MiFare Cards Can You Emulate On Android Phones
body: <p><strong>Please Help!</strong></p>
  
  <p>I was hoping someone could help me understand the whole idea behind Host Card Emulation on Android. </p>
  
  <p>I am working on a project at University where the idea was to provide access to RFID enabled access gates via NFC on smartphone. I have been researching for the last 2 weeks and there is a lot of information out there and Im struggling to make sense of it. Here is my understanding so far.</p>
  
  <p>RFID has three categories:</p>
  
  <ol>
  <li>Low Frequency: 125kHz</li>
  <li>High Frequency:13.56MHz</li>
  <li>Ultra High Frequency: 860 to 960MHz </li>
  </ol>
  
  <p>NFC technology in smartphones communicates at a frequency 13.56Mhz.</p>
  
  <p>For an RFID reader and NFC smartphone to communicate with each other two conditions have to be met:</p>
  
  <ol>
  <li>They must communicate at the same frequency (13.56MHz)</li>
  <li>They must comply with the same Protocols</li>
  </ol>
  
  <p>There is a whole bunch of protocols out there and right now NFC Forum are trying to drive the standardization of a select few protocols namely:</p>
  
  <ol>
  <li>ISO/14443 Type A and B Parts 1-4</li>
  <li>ISO/IEC 18092</li>
  <li>JIS X6319-4</li>
  </ol>
  
  <p>Now what I want to do is Emulate a Mifare card on an Android device. There are 4 families of Mifare cards/chips all of which communicate at 13.56MHz so we can tick that off:</p>
  
  <p><strong>Classic Family</strong></p>
  
  <ol>
  <li>MiFare Classic: <strong>ISO/14443-A 1-3 compliant</strong></li>
  <li>MiFare Classic: EV1: <strong>ISO/14443 1-3 compliant</strong> </li>
  </ol>
  
  <p><strong>DESFire Family</strong></p>
  
  <ol start="3">
  <li>MiFare DESFire EV 1: <strong>ISO/14443-A 1-4 compliant</strong></li>
  <li>MiFare DESFire EV 2: <strong>ISO/14443-A 1-4 compliant</strong> </li>
  </ol>
  
  <p><strong>Ultralight Family</strong></p>
  
  <ol start="5">
  <li><p>Ultralight C: <strong>ISO/14443-A 1-3 compliant</strong> </p></li>
  <li><p>Ultralight EV 1: <strong>ISO/14443-A 1-3 compliant</strong> </p></li>
  <li><p>Ultralight Nano: <strong>ISO/14443-A 1-3 compliant</strong> </p></li>
  </ol>
  
  <p><strong>Plus Family</strong> </p>
  
  <ol>
  <li>Plus: <strong>ISO/14443-A compliant</strong> </li>
  <li>Plus SE:  <strong>ISO/14443-3A compliant</strong></li>
  </ol>
  
  <p><strong>Lastly!</strong></p>
  
  <p>The NFC chip in android phones versions 4.4 and above supports ISO/14443 parts 1 to 4. i.e the chip is compliant with <strong>all four parts</strong>. Some of the Mifare families above are only compliant up to parts 3???</p>
  
  <p>The link below shows the NFC protocol stack I am looking at. At the top of the stack it says ISO/7816-4 which I don't really understand:
  <a href="https://developer.android.com/guide/topics/connectivity/nfc/hce.html" rel="noreferrer">https://developer.android.com/guide/topics/connectivity/nfc/hce.html</a></p>
  
  <p>From what I understand through research I would only be able to emulate the DESfire family because:</p>
  
  <p>These cards are compliant with ISO/14443 Parts 1 to 4 i.e. (all 4 parts of the protocol) so:</p>
  
  <ol>
  <li>Part 1: Physical Hardware of card <strong>is the same</strong> as the phones</li>
  <li>Part 2: Radio Frequency of the card <strong>is the same</strong> as the phones</li>
  <li>Part 3: Activation and Anti-Collision procedure of card <strong>is the same</strong> as the phones</li>
  <li>Part 4: Transport layer protocol of the card <strong>is the same</strong> as the phones</li>
  </ol>
  
  <p><strong>My question:</strong></p>
  
  <p>Is it possible to emulate any of these cards using Androids Host Card Emulation? For HCE to work this is what I think. I might be wrong:</p>
  
  <p>The Mifare card that the phone is trying to emulate has to comply with all 4 parts of the ISO/14443 1 to 4 <strong>just the same as the phone</strong>. So because the phone has the same architecture as the card(because the card is <strong>compliant with all 4 parts</strong>) it can pretty much pretend to a reader that its a card.</p>
  
  <p>Now that the phone is pretending to be a card the next step is to get the RFID reader communicate with the phone! And this is the exact same procedure:</p>
  
  <ol>
  <li>The RFID reader needs to communicate at 13.56MHz</li>
  <li>The reader has to comply with all 4 parts of ISO/14443 parts 1 to 4</li>
  </ol>
  
  <p>Aside:
  The company that provides my university with smart cards to access the library actually provide MiFare Classic EV1 4k cards and the reader in the gates communicate with it. Does this mean the reader is only compliant to parts 1 to 3?</p>
  
  <p><strong>I really just want to know if it's at all possible to get an android phone to emulate any of these cards and communicate with a reader? And what exactly do I need to do to make this happen. I only need to be able to do it with one of these cards to have a project/starting point</strong></p>
  
  <p>So for MiFare cards that are only compliant with parts 1 to 3, is there any way I can make it work at a software level?</p>
  
  <p>If it is not possible to do this then can I at least read data from passive RFID tag with an android phone that I can then do something with i.e. if I wrote an application that took the data from the tag and done something with it.</p>
  
  <p>I also read something that stated only android phones with NXP hardware can read MiFare classic cards and now most new android phones use Broadcom chips incase that sparks any thought.</p>
  
  <p>Any clarification would be really appreciated.</p>