Prevent NFC tag cloning?

Hey guys. I am working on a NFC project, where i need to ensure that tags are unique, as to link them with certain persons. Therefore i need to ensure that people dont clone each others NFC tags, and use each others names. But i don't know how to go about this.

I am using this NFC card reader.

So how would i go about ensuring that people don't clone nfc tags? :slight_smile:

Short answer: you cannot.

However, cloning cards would be too much effort for most people.

Assuming you would use MiFare Classic cards, normally you can expect the UID to be unique, as these are read-only on regular MiFare classic cards.

There are special cards available however, which have a writable UID.
See for instance http://www.proxmark.org/forum/viewtopic.php?id=1829
In normal applications, I think it is questionable if people would go through this effort.

If you will, to make this as guaranteed as possible with this kind of technique, you could try the following:

  • Write to Sector 0, block 0, wiping the UID;
  • If this succeeds, you have a cloned card, and as a side advantage, the card is disabled :wink:
  • If this fails, you can read the UID and check against your data.

A bit cumbersome, and you are still missing a check for the first generation writable cards, which can only be written to with a dedicated writer (see link above).

Regards Dennis

Hello Dennis, and thank you very much for your help! i will try out your technique! :smiley: