make usb password generator for

7,234

make usb password generator for
make usb password generator for

The device utilizes the USB boot HID keyboard protocol. When connected, it can detect changes in the keyboard LED states (caps lock, num lock, scroll lock), which the firmware uses to initiate new password generation (indicated by four LED toggle messages, corresponding to four caps lock presses). The randomness for the generated password is derived from the timing of the LED state changes. The ATtiny85 timer remains active, and each time an additional state change occurs, the lower six bits in TCNT0 are utilized to add one character to the password. For generating a new 10-character password (the default setting), a total of four plus ten caps lock presses are required, with the generated password stored in EEPROM.

The device operates by leveraging the USB Human Interface Device (HID) protocol, specifically designed for keyboard functionality. Upon connection to a USB host, the device enters a state where it can monitor the status of the keyboard LEDs. These LEDs serve as indicators for the caps lock, num lock, and scroll lock states. The firmware is programmed to interpret changes in these states as triggers for the password generation process.

The password generation mechanism is innovative, utilizing the timing of LED state changes to introduce an element of randomness. The ATtiny85 microcontroller, which is at the core of this device, continuously runs a timer. This timer is crucial for detecting the precise moments when the LED states change. Each detected change allows the device to utilize the lower six bits of the TCNT0 register, which is part of the timer's counter, to incrementally build the password.

In practical terms, to generate a new password, the user must perform a series of actions involving the caps lock key. Specifically, the user must toggle the caps lock state four times to initiate the process, followed by ten additional toggles to complete the password. This results in a total of fourteen caps lock presses, which the firmware translates into a new 10-character password. The randomness of the password is enhanced by the varying timings of the LED state changes, ensuring that each generated password is unique.

Once the password is generated, it is stored in the EEPROM of the ATtiny85, allowing for persistent storage and retrieval. This feature is particularly beneficial in applications where secure password generation is essential, providing users with a reliable method for creating complex passwords without the need for manual input. The combination of USB HID functionality, LED state monitoring, and EEPROM storage makes this device a versatile tool for password management and security.The device implements the USB boot HID keyboard protocol so once plugged in, the device can receive keyboard LED state changes (caps lock, num lock, scroll lock), which are used in the firmware to trigger new password generation (four LED toggle messages, i. e. four caps lock presses). Randomness for the generated password is also taken from LED st ate change timings - ATtiny85 timer is left running and every time an additional state change happens, lower 6 bits in TCNT0 are used to add one character to the password - so for a new 10-character password (default setting), a total of 4+10 caps lock presses generate a new password, which is stored in EEPROM. 🔗 External reference