USB traffic testing
Wireshark USB traffic analysis showed readable keystrokes without KeySentinel. With the prototype active, the captured stream contained encrypted characters with no clear relationship to the original text.
A working prototype that encrypts USB keyboard input before passive hardware keyloggers can capture readable keystrokes.
The problem
Physical keyloggers can capture keyboard traffic before software security controls have a chance to inspect it.
KeySentinel explores an active defence rather than relying only on physical inspection. A hardware layer intercepts and encrypts printable keystrokes, while a Windows application restores the intended input for the operating system.
The prototype combines an Arduino-based hardware layer with a C++ Windows application and synchronized time-derived keys.
The host shield receives the physical keyboard input.
Printable characters are transformed with a time-based XOR key.
The input hook decrypts the character and reintroduces it with SendInput.
An Arduino Leonardo receives keystrokes through a USB Host Shield, performs the encryption, and behaves as a standard USB HID keyboard when connected to the computer.
A multithreaded C++ application uses a low-level Windows keyboard hook, synchronized key generation, and simulated input to restore the original keystrokes.
Measured results
Wireshark USB traffic analysis showed readable keystrokes without KeySentinel. With the prototype active, the captured stream contained encrypted characters with no clear relationship to the original text.
Formal cryptanalysis was not performed. The simplified XOR design targets passive commercial hardware keyloggers, not advanced adversaries, and stronger lightweight encryption remains future work.
Browse the Arduino firmware, Windows application, licence, and repository notes on GitHub.