I'm trying to understand whether this requires a "decoder ring" recording ahead of time (in the case of the former—okay, on this keyboard an A sounds like this, a B sounds like this...), or whether you'd be able to pull this off with no prep work because an A always sounds like an A and a B always sounds like a B.
Each combination of room, mic, keyboard, and letter is going to have a unique sound signature. But, you don’t need prep work.
If you can just record enough keystrokes, it’s possible to figure out what sounds go with what letters. This is the “substitution cipher” the other comment mentioned.
For example, the sound that comes every 2-10 letters or so but rarely twice is spacebar. The one that sometimes comes between two spaces is I. It’s obviously more advanced, but just to give you an idea.
A convenient theory but not a fact.
Thank you. A lot of people don’t get these are two different things. I’m not going for perfect, I’m going for “oh I get it.”
It would be trickier however if looking at raw keystrokes, as one has to consider several confounding factors:
* The caret can be moved both by keystrokes and mouse * You don't know what is being typed. If someone is typing people's names all day, or writing software then the analysis of letter/key frequency will be shifted
Not impossible, but makes the process harder.
It's an interesting problem you'd probably try to solve with Markov chains back in the day, but now you'd just throw machine learning at.
Anyway, I assume the answers aren't known because it would be an ethics/privacy nightmare to run these kinds of experiments on anyone but yourself.
Also many keyboards are very quiet clicks these days. And what if I’m playing music?
I imagine a surreptitiously planted keystroke logger is far simpler. Or perhaps camera(s).
Perhaps a speaker in the keyboard that emits a random click-sound to mask the real sound could be helpful here. But it might confuse the typist when it emits the spacebar sound after you typed a regular letter...
This obviously assume the screen is not simultaneously snooped, which is feasible..
The sample from that link seems to be the former:
https://github.com/shoyo/acoustic-keylogger/blob/master/data...
Doesn't really tell me anything about how realistic this attack is.
It may be hard to do a non-terrible DIY laser microphone that would allow to achieve this while targeting a non-laptop surface.
After you have the recording the biggest challenge is a problem solving one, you need to isolate the waveform for every keystroke, convert it to something that can be compared with other waveforms (and cluster them) and then solve the resultant substitution cipher (waveform -> key identity). If the keyboard was used for any length of time, you can assume the entry of common words and phrases occurred at some point and the solution to the cipher is trivial.
If you have the resources to collect the data, it should be possible to train a transformer model to convert an audio recording to the output of sound signatures belonging to key strokes of a keyboard or multiple keyboards. The trick would be to not try to train it to do the entire problem which will almost certainly fail or not generalize.
[1] <https://github.com/shoyo/acoustic-keylogger>