Projects

KeySentinel

A working prototype that encrypts USB keyboard input before passive hardware keyloggers can capture readable keystrokes.

Arduino Leonardo and USB Host Shield used in the KeySentinel prototype
Arduino Leonardo with a USB Host Shield.
Type
Graduation research project
Role
Research, hardware and software development
Platform
Arduino and Windows
Status
Working prototype, 2025

The problem

Protection before the operating system.

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.

One protected input path.

The prototype combines an Arduino-based hardware layer with a C++ Windows application and synchronized time-derived keys.

  1. Capture USB keyboard and host shield

    The host shield receives the physical keyboard input.

  2. Protect Arduino encryption

    Printable characters are transformed with a time-based XOR key.

  3. Restore Windows application

    The input hook decrypts the character and reintroduces it with SendInput.

Hardware layer

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.

  • Arduino Leonardo
  • USB Host Shield 2.0
  • Arduino Keyboard and SPI libraries

Software layer

A multithreaded C++ application uses a low-level Windows keyboard hook, synchronized key generation, and simulated input to restore the original keystrokes.

  • C++ and the Windows API
  • SetWindowsHookEx and SendInput
  • Serial time synchronization

Measured results

Security without noticeable typing delay.

0.27 ms
Average Arduino processing and transmission
1.9 ms
Windows decryption and input simulation
2.17 ms
Approximate total measured latency

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.

Research limits

Formal cryptanalysis was not performed. The simplified XOR design targets passive commercial hardware keyloggers, not advanced adversaries, and stronger lightweight encryption remains future work.

Explore the prototype.

Browse the Arduino firmware, Windows application, licence, and repository notes on GitHub.

Open GitHub