Can we make NFC NDEF card password protect after writing that card in react native

1.2k Views Asked by At

I'm using react-native-nfc-manager package for reading and writing NFC card from my app, i want to write my card from my app no other app can change data. I have gone through multiple apps from playstore one of which is NFC tools in that there is feature of password protect, and that feature i didn't able to get in react-native-nfc-manager. Can anyone please let me know, how should i apply password protect NFC feature in react native or any other way without making card readonly

1

There are 1 best solutions below

3
Andrew On

The exact details of how to password protect writing this card are at https://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf Section 8.8

A summary is below:-

  1. Write the password to the correct memory address for the NTag215 (page 85h for the 215 chip)

  2. Write the Pack to the correct memory address (first 2 bytes of page 86h)

  3. Write to the AUTH0 memory area to set the first page to be protected by the password, usually you protect from page zero 00h (Last byte of page 83h)

To write to a password protected Card you first need to send the PWD_AUTH command before and other commands to write.

So configuring and using password protection on these NFC cards requires you to send (Transceive) low level commands to the card, these cards are NfcA based so react-native-nfc-manager has an NfcAHandler to transceive to them.

In react-native-nfc-manager Demo App is shows how to transceive custom commands.

The write page custom command begins with A2h.

The password auth custom command begins with 1Bh

I've not tried this with react-native but it should all be possible by combining the low level NfcA methods of react-native-nfc-manager with the detail in the cards datasheet on how to password protect that card.