react-native-nfc-manager icon indicating copy to clipboard operation
react-native-nfc-manager copied to clipboard

Password authentication - when password set from another app.

Open AkooMakoo opened this issue 3 years ago • 1 comments

Hello!

I managed to set a password on a NTAG213 by using the example code. The password that I set is: 1234abcd which converted to bytes: 18 52 171 205 And then stored on the tag.

To authenticate and write data, I use this code:

const password = [18, 52, 171, 205];
await NfcManager.requestTechnology([NfcTech.MifareIOS]);
await NfcManager.sendMifareCommandIOS([0x1b, ...password]);

And everything works a charm.

The problem is when I set the password from an external tool, the NFC Tools app or the NfcOpenReader app. The NFC tools app lets me enter any strings I want without limiting the length or checking the characters.

image

The NfcOpenReader app limiting to 4 bytes hex string:

image

On each app, I'm entering: 1234abcd as a password for the tag, but when I'm trying to authenticate with the code above the line:

await NfcManager.sendMifareCommandIOS([0x1b, ...password]);

Throws an error that says that the tag connection was lost.

image

Any suggestions on how I can solve that and support passwords defined by other tools?

AkooMakoo avatar Jun 28 '22 22:06 AkooMakoo

I managed to authenticate a password that was set with the NfcOpenReader app, but still no luck with the NFC tools app.

AkooMakoo avatar Jun 29 '22 00:06 AkooMakoo

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Sep 27 '22 02:09 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Oct 12 '22 02:10 github-actions[bot]

how can i set password less or more than 8 characters

amitsingheplanetsoft avatar Nov 21 '23 13:11 amitsingheplanetsoft