(project / Guide) RFID login

I wanted a simple way of quickly logging on to my computer without having to typing my password in and did not want to have no security either.

There are various products on the market that would solve this problem from fingerprint readers to proximity dongles but i decided to see what i could knock up with parts i mainly already had.

Looking in my micro stuff i had a RC522 RFID tag reader 3.3v :

Also an 3.3v arduino Leonardo clone aswell based on a sparkfun pro micro which also can act as a USB device such as a keyboard. This is useful as if a 5v arduino was used a level shifter would be required due to the RC522 not being 5v torrent.

How it works

When the chosen cards is presented the arduino will act as a keyboard and simply type the stored password in followed by a carriage return .

Wiring

As mentioned, both devices being the same voltage ,3.3v made wiring so easy !.

 RC522 (3.3v)  Arduino pro Micro
vcc 3.3v
RST pin 5
GND GND
MISO pin 14
MOSI pin 16
SCK pin 15
SDA pin 10
IRG NC

 

Code

I used the Arduino library for MFRC522 by Miguel Balboa , so you will need to add this library to arduino.
Please note this is only a very basic example and the password is stored in plain text in your arduino document ,  so this is very much proof of concept and has just been thrown together. It may also be a good idea after uploading to arduino to and save your arduino document with the password blank.

UPDATE!  Please also see RFID Login software Update ! for the latest software example .

 

 

How to use

1) First Set “#define enable_serial” = 1  to enable serial output.
2) Open a serial terminal with 9600 baud
3) Swipe a card and make a note of  UIDs .
4) Add recorded card UID to line 27.
5) Add login information to the keyboard section line 113 , modify the key squence for other OS’s and applications .

Case

I designed and 3D printed the smallest case i could round the arduino and RC522. I will post this up on Thingiverse soon.

wp-1460311853163.jpg

Complete, with the lid screwed on

Ok wires could be shorter !

Ok wires could be shorter haha  !

 

 

 

 

 

 

 

 

 

Future Improvements

1) Able to store multiple login information
2) Passwords stored encrypted
3) Add and modify data without using arduino IDE.
4) limit number of tries
5) Store the password on the Card itself

 

Conclusion

I have found this project really useful and use it all the time. One interesting problem that I had was when using windows 10 , I had to reconnect the USB cable every time the computer booted up but found a simple fix (add #include hid.h). The problem was due to the Arduino acting as keyboard (working ok on desktop using pro micro hid driver) but not as generic hid keyboard so not loading a hid keyboard driver .

COMMENTS

Telemin

Neat, but a word of warning is that this setup is trivially brute-forceable. There is no attempt rate limiting in the sketch so an attacker could quickly cycle through all possible card ids using any rfid-device that can masquerade as a tag, and get very quick access to your machine.

A preferable idea would be to store the password encrypted against the id of the tag, *and not store the correct id on chip*(this is important) so that if someone gets hold of a memory dump of the arduino it is harder to recover the plaintext password. This leads to the system attempting to log in whether or not the correct card is presented, but that is no bad thing as it acts as a form of attack rate limiting.

    Luke

    Telemin, i do completly agree with your points and would not suggest my example is used for anything other than a bit of fun at present. I think there’s a few improvements to be made and will try to atleast limit the number of tries. Also possibly could have the option to send the wrong password that could lock out the user account should the sktetch thought some attack was happening but this would only work if on the system at the time.

    Thanks for your comment
    Luke

Josh Siefer

Nevermind. I was eventually able to fix it. Like I mentioned before, it seems that extra characters were causing some sort of hang-up when compiling. After attempting multiple different methods, I finally got it to resolve. Thanks again for posting this!

    Luke

    Josh , Glad you were able to sort it ! .

    As pointed out in previous comments , the method i have chosen doesn’t limit the number of tries so be aware of this when making your project. I’m planning to to fix this when i have some time …

    Give me a shout if you have any more issues.

    Luke

Leave a Reply

Your email address will not be published. Required fields are marked *

*