Secure NFC/RFID chips - Page 1
Forum section: electronics / projects

author: rodrigo_vda
author_rank: Newbie
timestamp: October 13, 2020, 12:54:07 pm
content: I'm currently trying to develop a prototype for something RFID related. I can't share all the details, but the underlying need that I have is this:-A RFID tag has some information stored (small identifier number), there can be multiple tags with the same information, no need to differentiate them (but could do if it proved useful). However assuming anyone can have access to any of this tags, they shouldn't be able to clone them (so brute-force protection and similar protection is a necessity)-Only my designed device should be able to access the tags contents. In other words, The data is securely protected. However any attacker could have access to this reader device.I am aware that perfect security is impossible, but I'm just trying to make it as hard as possible for anyone to "clone" the product and get away with it.The first iteration of the prototype was quite easy, just use a cheapMifare ntag213, Arduino with RC522, write and read unprotected/unencrypted data.My next step is to make the information in the tag secure. First attempt is to use the built-in "password" protection from the tag. I don't want to use a Master key because if one tag is spoofed then they can arbitrarily go into any other tag or even create their own, so my idea to increase security:Have some information public and accessible without password. The reader reads it, "shuffles" it in a controlled way, calculates a hash, and uses a portion of the hash as the password. This way each tag will have a different password, even if the information in it is the same.This however doesn't prevent tag cloning, if an attacker gets access to a tags contents, it can clone it, so how hard is it to brute force a random password?Passwords are 32-bit, so there are 2^32 possibilities.A connection to a tag can be as short as 9ms, so the time required to try all possible passwords:2^32*0.009/3600= 10 737 hours (equivalent to 447 days). The mean time to get a password is 223 days.This seems secure enough, but if my product is successful, I would like to improve this security. Not only that, when I look up "mifare hacking" I find that there are more vulnerabilities. For instance, according tothis paperanyone that can sniff the RF communication will be able to get any password (because of course, the password communicaton is unencrypted).So I look for other RFID chips.This all has led me to a rabbit hole where I'm bombarded with a lot of information. I've readthis articlethat lists the "current" (as of May 2019) security status of different access card technologies.However there are some ambiguous information. For instance, it says that MIFARE Ultralight C (Datasheet) supports 3DES cryptography but it doesnt specify wether the encription is made at the storage, transmission or both.I come here so I can get some advice on your suggestions, what tags are good, what tags are too expensive, how easy it is to find/implement,etc. It is most likely someone here has already dealt with this situation so maybe I can get some help!

author: girishv
author_rank: Regular Contributor
timestamp: October 13, 2020, 01:54:29 pm
content: Consider using NXP DESFire. You can use the entry level, 256B tag.AES128 encryption across the board protects the tag from cloning, man in the middle attacks and much more. Also supports 3DES/2DES encryption for any legacy requirements. Furthermore, you can partition the tag (commonly known as applications) and each application can be protected with separate AES128 keys.You can use key diversification to protect the master key. Checkout Mifare SAM for protecting the master key out in the field.DESFire tags are not very cheap. I remember paying about 50cents @ 10K volume.Feel free if you have more questions. I will try to answer as long as they don't violate the NDA.

author: rodrigo_vda
author_rank: Newbie
timestamp: October 13, 2020, 03:22:47 pm
content: Quote from: girishv on October 13, 2020, 01:54:29 pmThank you very ,uch! I'm currently giving it a look.Hereit saysNot recommended for new designs. For new designs please use replacement productMIFARE DESFire Light..Will it be any harder to go straight into that alternative? This seems like they are discontinuing that product.Quote from: girishv on October 13, 2020, 01:54:29 pmThat's not a bad price, the range of prices I got in my head are:It's completely fine up to 1-2€/tag, I could probably do even with 5€/tag, but that would be stretching it for the final product.Again, thanks a lot for you time, I've been weeks into this research and your comment is really useful

author: girishv
author_rank: Regular Contributor
timestamp: October 13, 2020, 03:37:17 pm
content: You can use DESFire EV3. You can consider using DESFire EV1 / EV2 as they meet your requirements.I believe you may get DESFire EV1 or EV2 tags at attractive price compared to DESFire EV3.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 13, 2020, 05:34:39 pm
content: Instead of using a basic NFC tag, you could consider using a general-purpose NFC chip coupled to some MCU and implement your own secure protocol. Good luck too, as you said, good security is nothing trivial.One chip I have used is the AMS as3953. Fantastic IC IMO and relatively easy to use. You can use it for implementing a standard tag, but you can also use to transfer any data from/to the reader.

author: electrolust
author_rank: Unknown
timestamp: October 13, 2020, 07:58:48 pm
content: Quote from: rodrigo_vda on October 13, 2020, 12:54:07 pmNot possible. Tags are clonable. You want a solution like DESfire, as others noted.QuoteI'm glad you said this! If you are actually trying to build a secureproduct, you need to hire someone that already knows how to do this. There are very many pitfalls beyond tag cloning. From what you've said so far though ... carry on!!

author: rodrigo_vda
author_rank: Newbie
timestamp: October 13, 2020, 09:02:55 pm
content: Quote from: electrolust on October 13, 2020, 07:58:48 pmYeah my goal here is to develop a mostly secure v1.0. Secure enough to get it commecialized and test the market for the product. If it suceeds, my goal is to reinvest the money into hiring an expert so they can upgrade the security in a hypothetical v2.It's just like this: if my product gets big, I don't want any hacker wannabe to be able to clone it. think of "amiibos". They can get away with people cloning their stuff because most people won't bother and they have a powerful legal team that could pursue any attempt to comercialize clones in a big scale. I just want people to not be able to trivially clone my stuff, and by the point a skilled enough hacker has laid eyes on the product, the market already knows the name of the "original" product and possibly there's already a second more secure version.Sometimes I feel a little too paranoid but for something like this I tend to dream big (but expect small), and in the case that it actually becomes big, something like this could completely ruin the party!