I Built a Flutter Package That Reads Credit Card Data via NFC — Here's How
An open-source Flutter plugin that extracts card numbers, cardholder names, transaction history and other publicly accessible EMV chip data via NFC.
重點摘要
Reads 20+ EMV fields (PAN, expiry, cardholder, ATC, transaction logs).
Simple integration: add dependency, request NFC permission, call startReading().
Only public chip data is accessible — PINs, CVVs and private keys remain protected.
emv_nfc_reader is an open-source Flutter plugin that lets an Android phone read publicly accessible EMV chip data from payment cards via NFC. The package returns a map with over 20 fields — including PAN, expiry, cardholder name, IBAN, application transaction counter and recent transaction entries — and exposes a simple API: add the dependency, grant NFC permission in AndroidManifest, and call startReading(). Under the hood it implements EMV steps: PPSE discovery, application selection with a carefully chosen TTQ (notably tricky for Visa), reading records via the AFL, and GET DATA commands for extra tags. The author stresses that EMV secure elements prevent extraction of PINs, CVVs or private keys, and outlines future plans such as iOS Core NFC support, card art detection, and offline balances for supported prepaid cards.
我建立了一个通过 NFC 读取信用卡数据的 Flutter 包 — 实作与原理
这个开源插件可以在 Android 手机感应实体晶片卡后,几秒钟内提取超过 20 项公开的 EMV 晶片数据,包括卡号、持卡人姓名与交易历史。
重點摘要
可读取 20+ EMV 字段(PAN、到期日、持卡人、ATC、交易日志等)。
集成简便:加入依赖、配置 NFC 权限、调用 startReading()。
只读取公开数据,无法获取 PIN、CVV 或私钥。
emv_nfc_reader 是一个开源的 Flutter 插件,允许在 Android 手机上通过 NFC 读取支付卡 EMV 芯片中的公开数据,返回一个包含二十多项字段的 Map(例如卡号、过期日、持卡人、IBAN、应用交易计数器与最近交易记录)。实现流程包含 PPSE 发现、应用选择与 GPO 握手(Visa 需要特别的 TTQ 字节组合)、根据 AFL 读取记录,再对特定标签发送 GET DATA 以获取额外信息。作者强调 EMV 的安全元件防止提取私钥或 PIN,并计划扩展 iOS Core NFC 支持、卡面识别与支持离线余额的预付卡功能。
我打造了一個能透過 NFC 讀取信用卡資料的 Flutter 套件 —— 實作說明
這個開源套件可在 Android 手機感應實體晶片卡後,幾秒內擷取超過 20 項公開的 EMV 晶片資料,例如卡號、到期日與交易紀錄。
重點摘要
擷取 20 多項 EMV 欄位(PAN、到期日、持卡人、ATC、交易紀錄等)。
整合簡單:加入相依套件、設定 NFC 權限、呼叫 startReading()。
僅讀取公開資料,晶片私鑰、PIN 與 CVV 無法被提取。
emv_nfc_reader 是一個開源的 Flutter 外掛,能讓 Android 手機透過 NFC 快速讀取支付卡 EMV 晶片上的公開資料,回傳包含卡號、到期日、持卡人、IBAN、交易計數器與最近交易等逾二十個欄位的 Map。實作上遵循 EMV 流程:先以 PPSE 發現應用,再選擇應用並用 GPO 設定交易參數(Visa 需特定 TTQ 位元組),接著依 AFL 讀取記錄,最後以 GET DATA 取得額外標籤。作者強調晶片的 Secure Element 無法洩露私密金鑰或 PIN,並計畫新增 iOS Core NFC 支援、卡面識別與預付卡離線餘額等功能。