YouTube player

Are incorrect passwords driving you insane? Do you tire of constantly having to type in your 20 character password? In this project we use an Adafruit NFC shield to detect an NFC tag and an Arduino Leonardo to unencrypt the NFC tag and type in your password.

Capture2

This project requires about $75 worth of parts and only about half a day to build.

 

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Project Steps

Modify the Shield

Cut header pins to fit the Arduino’s pins. Then insert the sections into the pins of the Arduino.

Place the shield on top of the header pins and solder it in place.

The board comes with a jumper between IRQ and pin #2. However, pin #2 is used for I2C on the Arduino Leonardo, so use a hobby knife to cut the jumper between pin #2 and IRQ. Use a multimeter to test continuity.

Finally solder a wire from IRQ to pin #6.

Install Libraries

For the software side of things, we need to start off by installing the required libraries.

First we need to download the Adafruit NFC library.
Then unzip the folder and copy the Adafruit-PN532-master folder into your Arduino’s library folder and rename it NFC.

Next download the AES library.
Unzip the folder and copy the AESLib-master into Arduino’s library folder and rename it AES.

Detect the NFC Card Number

Open this code and upload it to your Arduino Leonardo.

Then open the serial monitor and set it to 9600 baud rate.

Wave the NFC tag over the shield. The serial monitor should then say something like Card Detected #1392502292
although instead of #1392502292 there will be your card’s number.

Write that number down and repeat this process for however many more cards you want to assign a password to.

Encrypt the NFC Cards

Download this code and open it in the Arduino IDE.

Find the line that says:
if(tagID == 123456789) {

Replace 123456789 with the card number you wrote down earlier.

Find the line that says:
int32_t passwordLength = 11;
Change 11 to the length of the password you want the card to type.

Find this line:
//char password[] = "secretpass!";
//printEncryptedPasswordByKey(password, passwordLength, key);

Uncomment out the two lines.

Change “secretpass!” to the password you want the card to type.

Now upload the code to the Arduino, open the serial monitor, and set it to 9600 baud rate. Now swipe the card over the shield.

Copy the encrypted password that looks like this just with different numbers.
char chunks[1][16] ={{69,231,233,4,229,39,188,190,57,88,6,94,118,197,215,18}
};

Finally delete your password in the code and uncomment out the following lines:
//char password[] = "";
//printEncryptedPasswordByKey(password, passwordLength, key);

Re-upload the code to the Arduino, and you are ready to go. Now whenever you swipe your card, your password will be typed.