Skip to content

Repository files navigation

Hardware-Enforced Password Manager (Bare-Metal Rust)

A highly secure, zero-allocation (#![no_std]), asynchronous hardware password manager built for the ESP32-S3 microcontroller using the Embassy framework.

This project operates as a composite USB device, acting simultaneously as a USB HID Keyboard (to automatically inject passwords into your host PC) and a USB CDC-ACM Serial Interface (to manage internal data via a command-line tool).

Features

  • Zero Heap Allocation (no_std): Maximum memory safety and deterministic behavior using static abstractions and heapless data structures.
  • True Hardware Randomness (TRNG): Passwords are generated directly on-chip leveraging the ESP32-S3's physical silicon thermal noise generator.
  • On-Chip Encrypted Storage: Utilizes a highly reliable, wear-leveled, crash-safe littlefs2 file system mapped directly onto the microcontroller's flash.
  • Dynamic UI (TFT Display): A smooth physical user interface built with embedded-graphics and embedded-menu. While embedded-menu is heavily designed for static structures in no_std environments, this project implements a custom architecture to safely enable fully dynamic menu rendering and runtime updates without requiring a global allocator.
  • Dual-Interface USB Stack: Implements a single-cable composite USB stack for effortless automation and management.

Hardware Requirements

  • Microcontroller: ESP32-S3 (with native USB OTG support)
  • Display: ST7789 TFT Display (SPI-driven)
  • Controls: 1x Physical Boot/User Button (GPIO0)

Host-Side Command-Line Interface (CLI)

While the password manager functions as a completely standalone USB HID device for credential injection, managing the internal flash storage (saving, generating, or deleting passwords) requires serial communication.

To keep concerns separated, the automation tool is hosted in its own dedicated repository:

👉 Hardware Password Manager CLI

The CLI automatically handles OS-level serial frame synchronization, transmission timeouts, and ensures your commands are processed safely without choking the hardware's internal packet buffers.

Usage Commands

Once you have the CLI tool, you can communicate with the device using the following command structure:

# Save a custom credential pair to flash
cargo run -- save <service_name> <password>

# Generate a cryptographically secure password via on-chip TRNG and save it
cargo run -- generate <service_name> [optional_length]

# Completely wipe a credential from the LittleFS system
cargo run -- delete <service_name>

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages