Some projects like this are available on the internet.
BUT none are made for Arduino users. We are often just provided a simple .hex file or a main.c which you can't adapt and rebuild to your liking.
So I decided to create a new code from scratch in the Arduino IDE with some adapted libraries for the DigiStump.
SO! Let's explain.
Hardware Passwords: Beyond Software Convenience
Software-based password managers are great, but they can be vulnerable to keyloggers or local machine compromises. The Password USB Key enters the realm of "Hardware Security" by using a dedicated microcontroller to store and type your most sensitive credentials. By acting as a Virtual Keyboard (USB HID), this device is platform-independent—it works on Windows, Mac, Linux, or even an Android phone with an OTG cable—without requiring any special software on the host machine.
The principle is simple: when you plug the USB Key, it types a password as a virtual keyboard.
The Power of the DigiSpark (Attiny85)
While many similar projects exist as closed-source .hex files, this project is built entirely within the Arduino IDE for ultimate customization:
- DigiStump Library: The project leverages specialized libraries that allow the Attiny85 chip on the DigiSpark to emulate a native USB keyboard.
- EEPROM Vault: Passwords aren't just hard-coded; they are stored in the chip's Non-volatile Memory (EEPROM). This means the key keeps your data safe even when unplugged.
- Dual-Function Logic: A simple single-button interface allows for two modes:
- Tap: Auto-types the stored password into the active text field.
- Long Press (2s): Generates a brand-new, randomized sequence of alphanumeric characters and symbols, instantly updating the internal vault.
In my version, you have a little button on the board—push it for 2 seconds, and it generates an ultra-secure new password which is saved instantly in the EEPROM.
Visual Cues with RGB Feedback
To make the device "human-friendly," a small RGB LED provides status updates:
- Green Flash: Successful password entry or generation.
- Blue Pulsing: Waiting for user input or long-press confirmation.
- Red Warning: Errors in memory access or USB handshake failures.
DIY Security Build Tips
Since the device is plugged directly into expensive USB ports, build quality is critical:
- Pull-up Resistors: A 1k Ohm resistor is used to ensure the input signal doesn't "float," preventing accidental password keystrokes.
- Compact Form Factor: The beauty of the DigiSpark is its size. With a bit of careful soldering, the button and LED can be mounted directly to the board, creating a device no larger than a standard thumb drive.
You just need:
- 1 x DigiStump from Digispark (on Amazon or on the internet)
- 1 x 1k Ohms pull-up resistor
- 1 x smd button
- Optional 1 RGB LED
This project is the perfect introduction to Attiny85 programming and shows how makers can use low-cost microcontrollers to solve high-stakes security problems.