Skip to content

Commit

Permalink
Merge remote-tracking branch 'ArrayBolt3/arraybolt3'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrelanos committed Nov 7, 2024
2 parents 55879cf + 9c57eba commit 3302108
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Install dependencies:

Fedora:

$ sudo dnf install make pkgconf-pkg-config libsodium libsodium-devel libevdev libevdev-devel
$ sudo dnf install gcc libevdev-devel libsodium-devel libubsan make pkgconf-pkg-config

Debian:

Expand Down Expand Up @@ -124,7 +124,7 @@ The full usage and options are:
Options:
-r filename: device file to read events from. Can specify multiple -r options.
-d delay: maximum delay (milliseconds) of released events. Default 100.
-s startup_timeout: time to wait (milliseconds) before startup. Default 100.
-s startup_timeout: time to wait (milliseconds) before startup. Default 500.
-k csv_string: csv list of rescue key names to exit kloak in case the
keyboard becomes unresponsive. Default is 'KEY_LEFTSHIFT,KEY_RIGHTSHIFT,KEY_ESC'.
-p: persistent mode (disable rescue key sequence)
Expand Down
2 changes: 1 addition & 1 deletion auto-generated-man-pages/kloak.8
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ delay: maximum delay (milliseconds) of released events\. Default 100\.
.IP "\[ci]" 4
\-s
.IP
startup_timeout: time to wait (milliseconds) before startup\. Default 100\.
startup_timeout: time to wait (milliseconds) before startup\. Default 500\.
.IP "\[ci]" 4
\-k
.IP
Expand Down
63 changes: 63 additions & 0 deletions kloak.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Name: kloak
Version: 0.3.6
Release: %autorelease
Summary: Keystroke-level online anonymization kernel

License: BSD-3-Clause
# vmonaco no longer maintains kloak, Whonix Project now actively maintains a fork.
# URL: https://github.com/vmonaco/%%{name}
URL: https://github.com/Whonix/%{name}
Source0: %{url}/archive/%{version}-1/%{name}-%{version}-1.tar.gz

BuildRequires: gcc
BuildRequires: libubsan
BuildRequires: make
BuildRequires: pkgconf-pkg-config
BuildRequires: pkgconfig(libevdev)
BuildRequires: pkgconfig(libsodium)
BuildRequires: pkgconfig(udev)
BuildRequires: systemd-rpm-macros
Requires: systemd-udev
%{?systemd_requires}

%description
A privacy tool that makes keystroke biometrics less effective. This is
accomplished by obfuscating the time intervals between key press and release
events, which are typically used for identification.

%prep
%autosetup -n %{name}-%{version}-1

%build
%make_build all

%install
%{__install} -Dm 0644 usr/lib/systemd/system/%{name}.service -t %{buildroot}%{_unitdir}
%{__install} -Dm 0644 lib/udev/rules.d/*.rules -t %{buildroot}%{_udevrulesdir}
%{__install} -Dm 0755 eventcap -t %{buildroot}%{_sbindir}
%{__install} -Dm 0755 %{name} -t %{buildroot}%{_sbindir}
%{__install} -Dm 0644 auto-generated-man-pages/*.8 -t %{buildroot}%{_mandir}/man8

%post
%systemd_post %{name}.service
%udev_rules_update

%preun
%systemd_preun %{name}.service

%postun
%systemd_postun_with_restart %{name}.service
%udev_rules_update

%files
%license COPYING LICENSE
%doc *.md
%{_unitdir}/%{name}.service
%{_udevrulesdir}/*-%{name}.rules
%{_sbindir}/eventcap
%{_sbindir}/%{name}
%{_mandir}/man8/eventcap.8*
%{_mandir}/man8/%{name}.8*

%changelog
%autochangelog
2 changes: 1 addition & 1 deletion man/kloak.8.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ kloak(8) -- anti keystroke deanonymization tool

* -s

startup_timeout: time to wait (milliseconds) before startup. Default 100.
startup_timeout: time to wait (milliseconds) before startup. Default 500.

* -k

Expand Down
4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define MAX_RESCUE_KEYS 10 // max number of rescue keys to exit in case of emergency
#define MIN_KEYBOARD_KEYS 20 // need at least this many keys to be a keyboard
#define POLL_TIMEOUT_MS 1 // timeout to check for new events
#define DEFAULT_MAX_DELAY_MS 20 // upper bound on event delay
#define DEFAULT_MAX_DELAY_MS 100 // upper bound on event delay
#define DEFAULT_STARTUP_DELAY_MS 500 // wait before grabbing the input device

#define panic(format, ...) do { fprintf(stderr, format "\n", ## __VA_ARGS__); fflush(stderr); cleanup(); exit(EXIT_FAILURE); } while (0)
Expand Down Expand Up @@ -414,7 +414,7 @@ void usage() {
fprintf(stderr, "Options:\n");
fprintf(stderr, " -r filename: device file to read events from. Can specify multiple -r options.\n");
fprintf(stderr, " -d delay: maximum delay (milliseconds) of released events. Default 100.\n");
fprintf(stderr, " -s startup_timeout: time to wait (milliseconds) before startup. Default 100.\n");
fprintf(stderr, " -s startup_timeout: time to wait (milliseconds) before startup. Default 500.\n");
fprintf(stderr, " -k csv_string: csv list of rescue key names to exit kloak in case the\n"
" keyboard becomes unresponsive. Default is 'KEY_LEFTSHIFT,KEY_RIGHTSHIFT,KEY_ESC'.\n");
fprintf(stderr, " -p: persistent mode (disable rescue key sequence)\n");
Expand Down

0 comments on commit 3302108

Please sign in to comment.