NFC - One Small Tap for Mankind

37fbf83b7d45711e41e774e29fed710e?s=47 Arnav Gupta
September 16, 2016

NFC - One Small Tap for Mankind

Exploring NFC and Bidirectional Communication using NFC

37fbf83b7d45711e41e774e29fed710e?s=128

Arnav Gupta

September 16, 2016
Tweet

Transcript

  1. 2.

    NFC Near field communications - a short range wireless standard

    using small antennae. (Produces modulated E or M waves). Developed on the basis of RFID devices. NFC brings 2-way communication and reading of unpowered ‘tags’ Used today for payments, identification, ticketing, social media checkins, hotel room checkins.
  2. 3.

    NFC : the history 2004 : Nokia, Philips and Sony

    form NFC Forum 2006 : Nokia 6131 - First ever NFC phone 2009 : NFC Forum releases peer-to-peer sharing protocols 2010 : First Android NFC phone - Nexus S 2011 : Google I/O - “How to NFC” 2012 : NFC Based payment solutions emerge. Google Wallet. 2013 : Visa, Mastercard start working on NFC solutions. 2014 : Apple Pay, Poynt, IBM 2-factor NFC Authentication
  3. 4.

    NFC : pros ➔ Pairing not required ➔ Versatile. Can

    be incorporated in many devices ➔ Minimal power usage ➔ Minimal user interaction ➔ Seamless procedure
  4. 5.

    NFC : cons ➔ Compatibility issues ➔ Low speed ➔

    Absence of security in HW layer ➔ Barebone communication channel (without flow or error control)
  5. 6.

    NFC on Android • Read NFC Tags or Cards •

    Use Mobile as Wallet (inbuilt Secure Element) • Beam data from one Mobile to another • Emulate a card (HCE) • Reader mode to read emulated card
  6. 7.
  7. 8.

    NFC on Android : Tag me out ! ACTION_NDEF_DISCOVERED Well

    defined NDEF data received. Easiest way to read tags (given they send a proper NDEF message on energizing them) ACTION_TECH_DISCOVERED Fall back from above. If no app has NDEF discovery filter, or the data from the tag is not in NDEF format ACTION_TAG_DISCOVERED Last resort. Gives only info that tag is discovered. No data available. Can be rarely used for meaningful application.
  8. 9.
  9. 10.

    <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="text/plain" /> </intent-filter> <intent-filter>

    <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> <!-- TAP TO GO TO URL --> <data android:scheme="http" android:host="developer.android.com" android:pathPrefix="/index.html" /> </intent-filter>
  10. 11.
  11. 12.

    NFC on Android : Beam of hope ★ Introduced in

    Android ICS 4.0 ★ Unidirectional data transfer (short bursts) from one device to another. ★ Needs both devices to have unlocked lockscreens and tapped together. ★ Using SNEP (Simple NDEF Exchange Protocol) ★ Communication initialised only after “Tap to Beam”
  12. 13.

    NFC on Android : Beam of hope ★ Vast functionality

    additions in 4.1 ★ Larger data (Images/Videos/Audio) transfer possible. ★ For larger data, actual sending takes place over Bluetooth. NFC is used for pairing. ★ Samsung S-Beam uses Wifi-direct instead
  13. 14.

    Android NFC : Host-based Card Emulation ★ A term coined

    by SimplyTapp in 2011 ★ First official implementation via collaboration of SimplyTapp with CyanogenMod ★ Added in Android officially in Kitkat 4.4 ★ Allows apps on an Android phone to emulate a NFC Tag (i.e. software emulation) without usage of Secure Element ★ Support from Visa and MasterCard poured in
  14. 15.
  15. 16.
  16. 17.
  17. 18.
  18. 19.

    Android NFC : Host-based Card Emulation ➔ Each packet is

    called “APDU”. ➔ APDU is 256byte or 64Kb in size - Check isExtendedLengthApduSupported() and getMaxTransceiveLength() ➔ Select AID : [Class | Instruction | Parameter 1 | Parameter 2] ➔ Get/Put AID : [Class | Instruction | Parameter 1 | Length | Data] ➔ Each emulated card is presented as an object of class IsoDep
  19. 20.

    Android NFC : Host-based Card Emulation READER CARD onTagDiscovered ←

    SELECT_AID → Card App with given AID started Confirm AID ← App starts, channel opened GET_DATA → Parse command payload, Use data as needed ← Send back appropriate data PUT_DATA → Parse command payload Receive OK status ← Modify data, send ACK/NAK back
  20. 21.

    Android NFC : Host-based Card Emulation Host based card emulation

    allows 2-way sustained communication between Android devices. Key to bi-directional data transfer is iteration over multiple GET_DATA, PUT_DATA calls, and sending information in packets. Communication will be half-duplex. With a practical speed limit of ~10Kbps
  21. 22.
  22. 23.

    Android NFC : Current Usages ❏ Payments/Commerce ❏ Enabling/pairing other

    connections ❏ Social networking ❏ Ticketing ❏ Identity and Access Tokens ❏ HealthCare ❏ Automation
  23. 24.

    Android NFC : Challenges & Limitations ❏ Nascent stage in

    industrial application ❏ libnfc lacks uniformity across vendors ❏ NXP chips not having extended APDU and HCE support. ❏ Lack of support for all tag data formats (NDEF, APDU) in standalone readers