Dual USB personality
ZeroKeyUSB operates as a composite USB device exposing two interfaces simultaneously:- HID Keyboard – types usernames and passwords exactly like a physical keyboard.
- CDC Serial channel – a lightweight text-based protocol used for backups, diagnostics, and time synchronization.
Keyboard output engine
The firmware uses a compact US-QWERTY layout hardcoded in flash memory.Each ASCII character is mapped to its corresponding USB HID keycode.
Future versions may add alternative layouts (ES, FR, DE…), but the current firmware always emulates US-QWERTY.
Typing sequence
When you select a credential, ZeroKeyUSB performs a scripted output:- Types the username.
- Sends a
Tab
key. - Types the password.
- Finishes with
{ENTER}
if the field includes that token.
TOTP codes are displayed on the OLED screen but are not auto-typed.
Serial command set
The serial channel communicates over 115200 bps using simple ASCII commands, one per line.All commands are processed only after successful PIN unlock.
Command | Direction | Description |
---|---|---|
PING | Host → Device | Returns OK for connection testing. |
REQTIME | Device → Host | Requests current Unix time; host replies SETTIME 1706227200 . |
SETTIME <epoch> | Host → Device | Stores the given Unix epoch (binary, unencrypted). |
EXPORT | Host → Device | Sends all credentials in plain CSV format for local backup. |
IMPORT | Host → Device | Restores a backup created on the same device and PIN (fails silently if PIN mismatch). |
FACTORY_RESET | Host → Device | Arms a secure wipe; requires 5-second long-press confirmation on the device. |
Time synchronization
TOTP codes require accurate timing.When the device shows
REQTIME
, send the current Unix time once:
REQTIME # displayed on screen
SETTIME 1706227200
The firmware stores the epoch as an 8-byte binary value (not encrypted).Elapsed time is tracked in software using the SAMD21’s
millis()
counter — no hardware RTC is used.If drift exceeds roughly ±90 s, the device will request time again.
Backup workflow
- Unlock the device and open Menu → Backup → Export.
- Start the local web manager or CLI; it listens to the serial stream.
- The device outputs all credentials in plain text CSV format (site, user, password, optional TOTP flag).
- To restore, choose Import and send the same file back.
The firmware verifies basic integrity and overwrites existing entries.
⚠️ Backups are not encrypted. Handle them carefully and store them offline, as they contain readable credentials.
Safe factory reset
ExecutingFACTORY_RESET
wipes:
- All credential pages
- PIN signature and failed-attempt counter
- Initialization vector (a new IV is generated on next boot)
Hold to confirm: 5…0
) ensures this cannot be triggered accidentally by software alone.
There is no hidden debugging interface on the serial channel.
All available commands are documented here, and any action affecting stored data requires physical confirmation on the device.
All available commands are documented here, and any action affecting stored data requires physical confirmation on the device.