⚡ High-performance raw keystroke logger, biometric typing cadence telemetry, and .keybin dual-format streaming engine for Java.
FastKeylogger intercepts raw Windows keyboard events directly via FastKeyboard, extracts high-resolution behavioral dwell/flight-time dynamics and keystroke corrections, and compresses streams in real-time into binary .keybin logs via FastFileFormat & FastBinary.
import fastkeylogger.*;
import java.nio.file.Path;
import java.util.List;
public class Demo {
public static void main(String[] args) throws Exception {
Path logDir = Path.of("logs/keyboard");
TextReconstructor reconstructor = new TextReconstructor();
// 1. Live background capture
try (FastKeylogger logger = new FastKeylogger(logDir, 5000)) {
logger.addListener(reconstructor);
logger.addListener(event -> {
System.out.printf("Key '%c' dwell=%dms corr=%b\n",
event.character(), event.durationMs(), event.isCorrection());
});
logger.start();
Thread.sleep(4000);
logger.stop(); // Flushes to timestamped .keybin
}
// 2. High-speed FastFileFormat codec & reconstructed text
Path sessionFile = logDir.resolve("session.keybin");
List<TypingEvent> events = KeybinCodec.readFromFile(sessionFile);
System.out.println("Reconstructed text: " + reconstructor.getText());
}
}- ⌨️ Win32 Raw Input Interception — Sub-millisecond keystroke telemetry capturing raw scan codes and virtual keys via
FastKeyboard. - ⏱️ Biometric Cadence Dynamics — Precise dwell-time (key press duration) and flight-time (inter-key intervals) measurement.
- ⚡ FastFileFormat
.keybinCompression — Delta-timestamped VarInt event serialization (Payload ID0x0004). - 🔤 Real-Time Text Reconstruction — Backspace-aware text accumulator and state tracker (
TextReconstructor). - 📦 Zero Heavy Dependencies — Native-speed pure Java 17+ core backed by
FastCore,FastBinary, andFastFileFormat.
- 🛡️ Continuous Biometric Authentication — Verifying user identity via unique keystroke rhythm patterns and behavioral cadence.
- 🤖 AI Agent Telemetry & Imitation — Capturing fine-grained typing cadences, hesitation pauses, and self-corrections for autonomous agents.
- 📊 Ergonomics & Speed Analytics — Profiling real-world WPM, error rates, and burst typing velocities.
- 📑 Audit & Recovery Logging — Crash-resilient background typing preservation with microsecond precision.
FastKeylogger is profiled using JMH to guarantee maximum stream throughput and zero dropped input packets.
| Benchmark Operation | Score (ops/ms) | Event Throughput | Memory Overhead |
|---|---|---|---|
Binary Stream Decoding (.keybin) |
~58,800 ops/ms | > 58.8 Million events/sec | Zero-Copy Streaming |
Binary Stream Encoding (.keybin) |
~26,800 ops/ms | > 26.8 Million events/sec | Compact VarInt Delta Buffer |
Run the benchmarks locally: .\run-benchmark.bat
| Method / Class | Description |
|---|---|
new FastKeylogger(path, threshold) |
Creates a logger flushing every N records into timestamped .keybin files. |
logger.start() / logger.stop() |
Starts and stops native raw keyboard event recording. |
logger.addListener(listener) |
Subscribes to real-time typing events and dwell times. |
KeybinCodec.encode(events) |
Serializes event list into compressed FastFileFormat binary byte array. |
KeybinCodec.decode(bytes) |
Deserializes .keybin binary bytes back into List<TypingEvent>. |
new TextReconstructor() |
Observer that maintains live reconstructed buffer with correction handling. |
| Case | Java Example | Launcher | Description |
|---|---|---|---|
| Live Typing Streamer & Reconstructor | Demo.java | run-demo.bat |
4-second live raw recording, dwell time logging, .keybin compression, and text reconstruction. |
| JMH Microbenchmark Suite | Benchmark.java | run-benchmark.bat |
High-throughput encoding/decoding benchmarks for 1,000-event telemetry streams. |
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastKeylogger</artifactId>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastKeyboard</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastFileFormat</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastBinary</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastcore</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:FastKeylogger:0.1.2'
implementation 'com.github.andrestubbe:FastKeyboard:0.1.0'
implementation 'com.github.andrestubbe:FastFileFormat:0.1.0'
implementation 'com.github.andrestubbe:FastBinary:0.1.0'
implementation 'com.github.andrestubbe:fastcore:0.1.0'
}Download the latest JARs directly to add them to your classpath:
- ⌨️ FastKeylogger-0.1.2.jar (Typing Logger & Rhythm Engine)
- ⚡ FastKeyboard-0.1.0.jar (Native Win32 Raw Keyboard Input)
- 📄 FastFileFormat-0.1.0.jar (Dual Binary & Text File Format)
- ⚡ FastBinary-0.1.0.jar (VarInt & Binary Packing)
- ⚙️ fastcore-0.1.0.jar (Foundation Library)
- REFERENCE.md: Full API reference and method signatures.
- PHILOSOPHY.md: Architectural design principles and biometric rhythm telemetry.
- CHANGELOG.md: Release history and version notes.
- ROADMAP.md: Future milestones and planned features.
- COMPILE.md: Instructions for compiling from source.
| Platform | Status |
|---|---|
| Windows 10/11 (x64) | ✅ Fully Supported (Win32 Raw Input) |
| Linux | 🚧 Planned (evdev) |
| macOS | 🚧 Planned (CGEventTap) |
MIT License. See LICENSE file for details.
- FastKeyboard — Low-level raw keyboard event interceptor
- FastMouseLogger — Raw mouse event logger,
.mousebinstreaming & heatmaps - FastHotkey — High-speed global hotkey listener
- FastFileFormat — Universal dual-format binary & text document engine
- FastSharedMemory — Zero-copy inter-process shared memory for Java
Part of the FastJava Ecosystem — Making the JVM faster. Small package. Maximum speed. Zero bloat. 🚀📋