Run, Developer, Run!

2FA Device from Scrap

2FA Device from Scrap Thumbnail

2FA Device from Scrap

2FA Device from Scrap

Let me tell you about a gadget that I'm especially proud of. It's not elegant or inventive in any way, but I really like it, because it was built from scrap parts, extremely simple and does its job well.

The requirement was to create 2FA device, so multiple persons could use it. One of the possible solutions could be to use an old smartphone, but you know about security of old smartphones right?

Hardware

  1. Raspberry Pi (the first one), some case and SD card
  2. Old credit card, because it holds screws well, and is easy to shape using a stationery knife
  3. NumPad Keyboard because it has arrows , necessary to scroll through Bash history and Enter key. (Sometimes you need to connect a full keyboard to do maintenance)
  4. RTC module to keep time while Raspberry is off
  5. Some random 1.8 20x8 display. Can't remember where it came from, but it was less than 5 bucks on eBay
  6. Lots of duct tape

Software

2FA keys are really simple. This article explains the approach. Basically, the device runs minimal Linux with oathtool installed. Bash shell is shown, and all you do is scroll through oathtool --base32 --totp "$(cat keyfile.key)" history using , arrows. New keys are copied using USB. The device is secure because it will be never connected to the internet.

For some reason miniwi.flf figlet font is not working in tty, so I've created simple script to draw fonts especialy designed for 20x8 screens:

   ▐ ██ ██ ▌▐ ██ ██
   ▐  ▐  ▐ ▌▐ ▌  ▌ 
   ▐ ██ ██ ██ ██ ██
   ▐ ▌   ▐  ▐  ▐ ▌▐
   ▐ ██ ██  ▐ ██ ██

↑ This should look like image bellow if your fonts are not messed up:

Font for 20x8 screens


Contact

Search

 

Follow

Me on Twitter, Mastodon and Github

We have RSS!

© 20xx

Hosted on Cloudflare Pages, which is awesome!