An iOS app built with SwiftUI for production-line initialization of NTAG 424 DNA NFC tags. Supports reading UID, deriving per-card SDM keys, and writing NDEF URL templates for the Beamio SUN (Secure Unique NFC) verification flow.
- Read UID: Hold your device near an NTAG 424 DNA tag to read its UID
- One-tap Init: Complete production workflow
- Read UID
- Derive per-card SDM Key from Master Key + UID via KDF
- Write NDEF URL template (static part of SUN verification endpoint)
- Configurable parameters: Master Key, New Key0, SUN Base URL, etc.
- iOS 13.0+
- iPhone with NFC support (iPhone 7 or later)
- NTAG 424 DNA tags (e.g. Gototags NFC PVC Card - NTAG 424 DNA)
| Parameter | Description |
|---|---|
| K_master | 16-byte HEX, used to derive per-card SDM Key |
| New Key0 | 16-byte HEX, optional, for writing Key0x00 (admin) |
| SUN Base URL | Static part of NDEF URL template, e.g. https://api.beamio.app/nfc/sun |
- Open the app and fill in or confirm the default configuration
- Read UID: Tap "Read UID" and hold your device near the tag (e.g. Gototags NTAG 424 DNA card)
- Init Card: Tap "Init Card (One-tap)" and follow the prompts to hold near the tag twice:
- First tap: Read UID, derive Key, prepare NDEF
- Second tap: Write NDEF URL template
- 全新卡:留空「当前 Key0」,直接 Init
- 已预编码卡(Gototags 出厂卡等):填写「当前 Key0」(向厂商获取)后 Init,可覆盖为我们的 Key2/SDM/NDEF 配置
NDEF/
├── NDEFApp.swift # App entry point
├── ContentView.swift # Main UI
├── NDEFWriter.swift # NFC read/write, KDF derivation, NDEF write logic
└── Assets.xcassets # App assets
- CoreNFC:
NFCTagReaderSessionfor UID reading,NFCNDEFReaderSessionfor NDEF writing - KDF: Placeholder uses SHA256 (
BEAMIO_SDM|| UID || masterKey); replace with AES-CMAC for production - NDEF: Writes Well-Known URI records; URL template format is
{base}?e=&c=&m=(SDM encData/counter/cmac placeholders)
- Write Key0x00 (optional)
- Write Key0x02 = derived SDM Key
- Configure SDM (encData with UID + counter + cmac)
- Lock permissions
- Integrate NTAG 424 DNA EV2 full command set
The app requires NFCReaderUsageDescription for reading and writing NFC tags. A system permission prompt appears on first use.
CONET-Labs / Beamio