Easy NFC Life with Host-based Card Emulation
summary
Shows how to build a real Host-based Card Emulation (HCE) NFC card on Android by implementing HostApduService, registering AID filters, and testing with PC/SC readers (Sony PaSoRi, ACS) using OpenSC to send APDUs. Describes creating TLV/APDU encoder/decoder and an asynchronous response pattern (return null then push response), reports a practical bug where some readers break on responses larger than 255 bytes (ATR issue) and notes Pixel/watch differences between Type A/B, and recommends on-device authentication (fingerprint) plus signature challenges to prevent cloning.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 0:41Smart card basics and types
- 3:34Java Card constraints today
- 5:42NFC basics and Android
- 6:46Host-based card emulation
- 7:07HCE mechanism and benefits
- 9:40HCE use cases and steps
- 11:28HCE app implementation
- 12:30NFC reader testing
- 14:59APDU commands and responses
- 16:26APDU processing details
- 20:23APDU status words and errors
- 21:49Instruction sets and use
- 23:14APDU encoder/decoder
- 24:38Read binary implementation
- 26:06File structure and access
- 27:58TLV format explained
- 30:15TLV encoder/decoder
- 30:58HCE response issues
- 34:10NFC security and cloning
- 36:37Reader compatibility issues
- 38:24HCE future outlook
related talks
25mHands-On with Host Card Emulation
32mWorking with NFC and smart cards
45mAndroid as the Basis for Implementing a Mobile Passport
32mMaking contactless transaction with CardSession
18mNFCGate: Opening the Door for NFC Security Research with a Smartphone-Based Toolkit
48mProgramming and using NFC cryptographic cards
43mRelaying EMV Contactless Transactions Using Off-The-Shelf Android Devices
34mJourney to the Heart of Contactless Payment
