{"id":13441523,"url":"https://github.com/ggerganov/kbd-audio","last_synced_at":"2025-05-14T08:07:43.581Z","repository":{"id":39105330,"uuid":"146330145","full_name":"ggerganov/kbd-audio","owner":"ggerganov","description":"🎤⌨️ Acoustic keyboard eavesdropping","archived":false,"fork":false,"pushed_at":"2023-01-15T07:48:08.000Z","size":13031,"stargazers_count":8745,"open_issues_count":12,"forks_count":601,"subscribers_count":135,"default_branch":"master","last_synced_at":"2025-04-13T04:55:44.224Z","etag":null,"topics":["acoustic","eavesdrop","microphone-audio-capture"],"latest_commit_sha":null,"homepage":"https://ggerganov.github.io/keytap","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ggerganov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-27T17:19:02.000Z","updated_at":"2025-04-12T09:01:27.000Z","dependencies_parsed_at":"2023-02-09T21:30:54.251Z","dependency_job_id":null,"html_url":"https://github.com/ggerganov/kbd-audio","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggerganov%2Fkbd-audio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggerganov%2Fkbd-audio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggerganov%2Fkbd-audio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggerganov%2Fkbd-audio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ggerganov","download_url":"https://codeload.github.com/ggerganov/kbd-audio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101557,"owners_count":22014908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acoustic","eavesdrop","microphone-audio-capture"],"created_at":"2024-07-31T03:01:35.052Z","updated_at":"2025-05-14T08:07:38.565Z","avatar_url":"https://github.com/ggerganov.png","language":"C++","funding_links":[],"categories":["C++","Install from Source","C++ (225)","Tools"],"sub_categories":["Podcasting","Satellite"],"readme":"kbd-audio\n=====\n[![Actions Status](https://github.com/ggerganov/kbd-audio/workflows/CI/badge.svg)](https://github.com/ggerganov/kbd-audio/actions)\n\nThis is a collection of command-line and GUI tools for capturing and analyzing audio data.\n\n### Keytap\n\nThe most interesting tool is called **keytap** - it can guess pressed keyboard keys only by analyzing the audio captured from the computer's microphone.\n\nCheck this blog post for more details:\n\n[Keytap: description and some random thoughts](https://ggerganov.github.io/jekyll/update/2018/11/30/keytap-description-and-thoughts.html)\n\n[Video: short demo of Keytap in action](https://www.youtube.com/watch?v=2OjzI9m7W10)\n\n[Try it online:](https://ggerganov.github.io/keytap)\n\n\u003ca href=\"https://ggerganov.github.io/keytap\" target=\"_blank\"\u003e\u003cimg src=\"https://i.imgur.com/FXa60Pr.gif\" style=\"display: inline-block; overflow: hidden; width: 99%;\"\u003e\u003c/img\u003e\u003c/a\u003e\n\n### Keytap2\n\nThe **keytap2** tool is another interesting tool for recovering text from audio. It does not require training data - instead it uses statistical information about the frequencies of the letters and n-grams in the English language.\n\nA more detailed description of the tool is available here: [Keytap2 discussion](https://github.com/ggerganov/kbd-audio/discussions/31)\n\n[Video: short demo of Keytap2 in action](https://www.youtube.com/watch?v=jNtw17S6SR0)\n\n[CTF: can you guess the text being typed?](https://ggerganov.github.io/keytap-challenge/)\n\n[Try it online:](https://keytap2.ggerganov.com)\n\n\u003ca href=\"https://keytap2.ggerganov.com\" target=\"_blank\"\u003e\u003cimg src=\"https://i.imgur.com/nPlLEDN.jpg\" style=\"display: inline-block; overflow: hidden; width: 99%;\"\u003e\u003c/img\u003e\u003c/a\u003e\n\n### Keytap3\n\nThis version introduces significant algorithm improvements and better n-gram statistics compared to keytap2. The attack is now fully\nautomated and does not require any manual intervation during the text recovery process.\n\n[Video: short demo of using Keytap3](https://youtu.be/5aphvxpSt3o)\n\n[Video: another example of using Keytap3](https://youtu.be/kCOrxrR-4ak)\n\n[GUI for Keytap3](https://keytap3-gui.ggerganov.com)\n\n[Check if your keyboard is vulnerable to Keytap:](https://keytap3.ggerganov.com)\n\n\u003ca href=\"https://keytap3.ggerganov.com\" target=\"_blank\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/1991296/166096331-ab26f7f8-08e0-48d6-abd7-57017ebf1866.JPEG\" style=\"display: inline-block; overflow: hidden; width: 99%;\"\u003e\u003c/img\u003e\u003c/a\u003e\n\n### What people say about Keytap\n\n*\"This works incredibly well.\\\nI hope you realize what you've created (and made available to every person in the world).\"* -- ffpip\n\n*\"I just tried it and it works incredibly well. It kind of makes me want to stop using a mechanical keyboard.\"* -- Karawebnetwork\n\n*\"This attack and Van Eck phreaking are why Edward Snowden, while typing passwords and other sensitive information, would pull a blanket over himself and his laptop.\"* -- aarchi\n\n*\"This is what mechanical keyboard users deserve\"* -- super guy\n\n*\"fuck..\"* -- Lluis Franco\n\n## Build instructions\n\nDependencies:\n\n - **SDL2** - used to capture audio and to open GUI windows [libsdl](https://www.libsdl.org)\n\n       [Ubuntu]\n       $ sudo apt install libsdl2-dev\n\n       [Mac OS with brew]\n       $ brew install sdl2\n\n       [MSYS2]\n       $ pacman -S git cmake make mingw-w64-x86_64-dlfcn mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2\n\n - **FFTW3** *(optional)* - some of the helper tools perform Fourier transformations [fftw](http://www.fftw.org)\n\n**Linux, FreeBSD, Mac OS, Windows (MSYS2 + MinGW)**\n\n    git clone https://github.com/ggerganov/kbd-audio\n    cd kbd-audio\n    git submodule update --init\n    mkdir build \u0026\u0026 cd build\n    cmake ..\n    make\n\n## Tools\n\nShort summary of the available tools. If the status of the tool is not **stable**, expect problems and non-optimal results.\n\n| Name                | Type    | Status      |\n| ---                 | ---     | ---         |\n| **record**          | text    | **stable**  |\n| **record-full**     | text    | **stable**  |\n| **play**            | text    | **stable**  |\n| **play-full**       | text    | **stable**  |\n| **view-gui**        | gui     | **stable**  |\n| **view-full-gui**   | gui     | **stable**  |\n| **key-detector**    | text    | **stable**  |\n| **keytap**          | text    | **stable**  |\n| **keytap-gui**      | gui     | **stable**  |\n| **keytap2-gui**     | gui     | **stable**  |\n| **keytap3**         | text    | **stable**  |\n| **keytap3-gui**     | gui     | **stable**  |\n| -                   | *extra* | -           |\n| **guess-qp**        | text    | experiment  |\n| **guess-qp2**       | text    | experiment  |\n| **keytap3-multi**   | text    | experiment  |\n| **scale**           | text    | experiment  |\n| **subreak**         | text    | experiment  |\n| **key-average-gui** | gui     | experiment  |\n| **keytap2**         | text    | experiment  |\n\n## Tool details\n\n* **record-full**\n\n  Record audio to a raw binary file on disk\n\n      ./record-full output.kbd [-cN]\n\n  ---\n\n* **play-full**\n\n  Playback a recording captured via the **record-full** tool\n\n      ./play-full input.kbd [-pN]\n\n  ---\n\n* **record**\n\n  Record audio only while typing. Useful for collecting training data for **keytap**\n\n      ./record output.kbd [-cN] [-CN]\n\n  ---\n\n* **play**\n\n  Playback a recording created via the **record** tool\n\n      ./play input.kbd [-pN]\n\n  ---\n\n* **keytap**\n\n  Detect pressed keys via microphone audio capture in real-time. Uses training data captured via the **record** tool.\n\n      ./keytap input0.kbd [input1.kbd] [input2.kbd] ... [-cN] [-CN] [-pF] [-tF]\n\n  ---\n\n* **keytap-gui**\n\n  Detect pressed keys via microphone audio capture in real-time. Uses training data captured via the **record** tool. GUI version.\n\n      ./keytap-gui input0.kbd [input1.kbd] [input2.kbd] ... [-cN] [-CN]\n\n  Online demo: https://keytap.ggerganov.com\n\n  ---\n\n* **keytap2-gui** record.kbd n-gram-dir [-pN] [-cN] [-CN]\n\n  Detect pressed keys via microphone audio capture. Uses statistical information (n-gram frequencies) about the language. **No training data is required**. The *'record.kbd'* input file has to be generated via the **record-full** tool and contains the audio data that will be analyzed. The *'n-gram-dir'* folder file has to contain n-gram probability files for the corresponding language.\n\n      ./keytap2-gui record.kbd ../data\n\n  Online demo: https://keytap2.ggerganov.com\n\n  ---\n\n* **keytap3**\n\n  Fully automated recovery of unknown text from audio recordings.\n\n      ./keytap3 input.kbd ../data [-cN] [-CN] [-pF] [-tF] [-FN] [-fN]\n\n  Online demo: https://keytap3.ggerganov.com\n\n  ---\n\n* **keytap3-gui**\n\n  GUI version of the **keytap3** tool.\n\n      ./keytap3-gui input.kbd ../data [-cN] [-CN] [-pF] [-tF] [-FN] [-fN]\n\n  Online demo: https://keytap3-gui.ggerganov.com\n\n  ---\n\n* **view-full-gui**\n\n  Visualize waveforms recorded with the **record-full** tool. Can also playback the audio data.\n\n      ./view-full-gui input.kbd [-pN]\n\n  \u003ca href=\"https://i.imgur.com/scjTaXw.png\" target=\"_blank\"\u003e![view-full-gui](https://i.imgur.com/scjTaXw.png)\u003c/a\u003e\n\n  ---\n\n* **view-gui**\n\n  Visualize training data recorded with the **record** tool. Can also playback the audio data.\n\n      ./view-gui input.kbd [-pN]\n\n  \u003ca href=\"https://i.imgur.com/2binGaZ.png\" target=\"_blank\"\u003e![view-full-gui](https://i.imgur.com/2binGaZ.png)\u003c/a\u003e\n\n  ---\n\n## Feedback\n\nAny feedback about the performance of the tools is highly appreciated. Please drop a comment [here](https://github.com/ggerganov/kbd-audio/issues/3).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggerganov%2Fkbd-audio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fggerganov%2Fkbd-audio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggerganov%2Fkbd-audio/lists"}