กลับไปหน้ารวมไฟล์
password-usb-key-05e45e-en.md

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.

As example (and my first source)

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:
    1. Tap: Auto-types the stored password into the active text field.
    2. 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.

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x DigiStump Drivers"
  - "1x Arduino IDE"
author: "Mushux95"
category: "Security"
components:
  - "1x DigiSpark (Attiny85 Development Board)"
  - "1x Pushbutton switch (12mm or SMD)"
  - "1x RGB LED (Common Cathode)"
  - "1x 1k Ohm Resistor (Pull-up)"
  - "1x Soldering iron"
description: "A compact, DigiSpark-powered hardware key that acts as a virtual keyboard to auto-type and store secure passwords."
difficulty: "Easy"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX18C4Dx0tHJvFNCiFhA9hLsw9t07LAK1X0777TaCyC8oPYaGF06Cszg9pYYEpmXAoHSC6VAgY9ptHw=="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/password-usb-key-05e45e_cover.jpg"
lang: "en"
likes: 1
passwordHash: "2396cb4e2db05c591747283879943dd81e2f83fef407e85da72e74bad7e4744e"
price: 299
seoDescription: "Secure your digital life with a DIY Password USB Key. Use a DigiSpark Attiny85 to store and auto-type ultra-secure passwords natively within Arduino."
tags:
  - "hid"
  - "embedded-security"
  - "digispark"
  - "passwords"
title: "Password USB Key"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/kpNSycoUCZM"
views: 17402