GithubHelp home page GithubHelp logo

mwittig / ntag203rollingcodeauth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thexperiments/ntag203rollingcodeauth

0.0 2.0 0.0 8 KB

An arduino sketch for authenticating ntag203/mifare ultralight tags with really random "rolling" codes instead of only using UID

Arduino 100.00%

ntag203rollingcodeauth's Introduction

ntag203RollingCodeAuth

An arduino sketch for authenticating ntag203/mifare ultralight tags with really random "rolling" codes instead of only using UID with an MFRC522 rfid reader.

One can use this as a door lock for example.

Simply connect the learn pin to ground and the scanned tag will be stored as an authenticated tag.

You can also connect a speaker to the speaker pin and you will get a low beep on access denied and a high beep on access granted.

#How it works: ##Learning:

  • The arduino will write a random (using the best "real" random generator for arduino I could find) 4byte number to the tag and will save the UUID and this random number in EEPROM. ##Authenticating
  • Read the tag
  • Check if UUID in "database"
  • Read the 4byte secret which previously was stored and compare it to the one stored for this UUID in the EEPROM
  • Write a new random secret to the tag and only after a sucessfull write trigger access granted function

#Note! This is not by any means secure! There is no encryption at all. The only security is that the random value gets changed everytime the tag is used to authenticate.

  • Thus an attacker who would copy your rfid key would need to emulate the uuid and copy the secret from the memory.
  • The attacker would need to use the door before you do it the next time because the stolen code will only be valid until you use your tag again.
  • You would notice the security-breach because your tag would not authenticate any more as the new key from the attackers authentication is now stored in the "database"

However I have seen countles Arduino projects use only the UUID for authentication which I think this solution here is far superior to. I especially like it because it works with the NFC Ring (http://nfcring.com/)

#Todo

  • Better learning (support of onlearning specific tags)
  • Rewrite ugly hacky code.
  • Create a really secure version with more advanced smartcard.

ntag203rollingcodeauth's People

Contributors

thexperiments avatar

Watchers

James Cloos avatar Marcus Wittig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.