Obfuscate keyboard strokes
When typing on the keyboard the pattern of your input may be as unique as your fingerprint. Whonix uses a keyboard de-anonymization tool by default that hides your keyboard-strokes. This tool is called Kloak and is short for “Keystroke-level Online Anonymization Kernel”.
The purpose of this is to obfuscate the time interval between key press and release events, thus making it harder to identify your individual typing-pattern.
This article details the specifics of how your keyboard strokes may be used to identify a user https://www.whonix.org/wiki/Keystroke_Deanonymization
“Users can be uniquely fingerprinted based on:
- Typing speed.
- Exactly when each key is located and pressed (seek time), how long it is held down before release (hold time), and when the next key is pressed (flight time).
- How long the breaks/pauses are in typing.
- How many errors are made and the most common errors produced.
- How errors are corrected during the drafting of material.
- The type of local keyboard that is being used.
- Whether they are likely right or left-handed.
- Rapidity of letter sequencing indicating the user’s likely native language.
- Keyboard Layout as the placement of the keys on the keyboard leads to different key seek times and typing mistakes.”
Kloak has a github repository at https://github.com/vmonaco/kloak which can be used to build a binary for your linux distribution.
To build on Debian install these tools:
sudo apt install devscripts
Clone the repository and build the code:
git clone git@github.com:vmonaco/kloak.git
cd kloak
sudo mk-build-deps --remove --install
make all
Test the build by starting as root. This is because it reads and writes to device files:
sudo ./kloak
If you want it to run as a service, do the following:
sudo mkdir /usr/local/bin/kloak
sudo cp kloak /usr/local/bin
sudo vi /etc/systemd/system/kloak.service
This is my configuration:
[Unit]
Description=kloak
After=network.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/kloak
[Install]
WantedBy=multi-user.target
Reload the daemons and start the service:
systemctl daemon-reload
systemctl enable kloak.service
Created symlink ‘/etc/systemd/system/multi-user.target.wants/kloak.service’ → ‘/etc/systemd/system/kloak.service’.
systemctl start kloak.service
└─$ systemctl status kloak.service ● kloak.service - kloak Loaded: loaded (/etc/systemd/system/kloak.service; enabled; preset: disabled) Active: active (running) since Fri 2025-02-07 14:05:24 CET; 26s ago Invocation: 803e7700ed2f4ab1a8247300b6582081 Main PID: 3850758 (kloak) Tasks: 1 (limit: 14135) Memory: 1.3M (peak: 2.5M) CPU: 528ms CGroup: /system.slice/kloak.service └─3850758 /usr/local/bin/kloak
Feb 07 14:05:24 kali systemd[1]: Started kloak.service - kloak.