[go: up one dir, main page]

Skip to content

An electronic safe-deposit box with 2FA, using resin.io and Authy.

Notifications You must be signed in to change notification settings

Zipitn/resin-safebox

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

resin-safebox

An electronic safe-deposit box with 2FA, using resin.io and Twilio's Authy.

This demo shows how to bring 2-factor authentication to the physical world using a Raspberry Pi. The software consists on a node.js server running on the Pi; we use resin's port forwarding to expose it to the web. The usage is simple: a user logs in using email and a numeric code, and in this way closes the lock. To open it, the user must input the code and a token sent by Authy via SMS (or using the Authy mobile app).

The lock itself is a solenoid, connected with a driver circuit to one of the Pi's GPIOs.

Deployment using resin.io

You'll need an account and an application created on Authy.

First, create an account at resin.io and create an application. For more information on these steps check out resin's Getting Started guide (if you're using a Pi 2, as we did, the guide is here.

Once you've created the app and have the Pi running with resin's OS, all you have to do is add the resin remote to this repository and:

git push resin master

This will push the repo and build a Docker image using the project's Dockerfile. Your device will automatically download and run the code.

On the resin.io Dashboard, go to the application's Environment Variables tab and set the following environment variables:

AUTHY_API_KEY = (your Authy API key from [http://authy.com])
IS_PI = true
GPIO = 17 (or whichever GPIO you prefer for the solenoid)

Hardware

We built the solenoid driver using a 2n2222 transistor, a few resistors, and a diode, all on a small protoboard. It's this little arachnid:

Circuit on protoboard

The schematic looks like this:

Circuit schematic

The solenoid itself is a 5V model like this one. You could of course use another one, but you might have to adapt the driver circuit or even use a separate power source.

Trying the UI on a PC

You can run this on your PC as any node.js program. Just install it using:

npm install

And run it with:

AUTHY_API_KEY=your-authy-api-key node index.js

About

An electronic safe-deposit box with 2FA, using resin.io and Authy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.7%
  • CSS 3.3%
  • HTML 1.9%
  • Shell 0.1%