I've found very little information on this topic after much googling. The only partial answer I found was by Microsoft: Microsoft_AES_Technical_Factsheet

By adding random data to each message, each message is unique even if the same letters are typed over and over. This prevents frequency analysis from finding identical messages to track.

which makes sense but leaves me wanting to know:

A) How random data can be added to the messages without causing noise in the signal, and

B) How other manufacturers prevent frequency analysis. I could find nothing regarding Logitech, for example.

Is it simply an industry standard to 'just add noise', therefore it can be safely assumed to be implemented?

  • This sounds like a convoluted way to describe block modes. Look into how ECB and CBC differ. – forest Jan 17 at 6:58

Assuming that a block cipher is used as the standard AES or a lightweight block cipher as Prince. The lightweight is highly probable to reduce the power consumption. Block ciphers need mode of operations.

  • In ECB mode: E(m1) = E(m2) if and only if m1=m2. So when you press a key k and later when you press it again then the encryptions will be same. When you typing a regular text then by knowing of your language the observer can infer the presses keys as in permutation cipher and see you data. Interestingly, in this mode, even the connected PC doesn't need to the decryption, they can use it as it is.

  • In CBC mode: a random IV is generated for each encryption then the encryption is performed as c=E(m xor IV). Since the IV is generated randomly for each encryption then the encryptions of each letter will be different every time. In this way, the randomization can prevent the frequency attack.

It is also possible to randomize by padding. That is, if the block-size of the block cipher is 8-byte then you can generate random 7-byte and append it to the binary value of the keystroke, here it is assumed that the keyboard can only send 256 different values, then the encryption. The random padding size can be adjusted according to the device.

  • Is it known that wireless keyboards pad each single key press to fill a block of x bits, then use either ECB or CBC mode to encrypt them? These block modes are easier to visualize for stationary data.. they don't fully explain how wireless keyboards accomplish encryption. – tripolon Jan 17 at 8:55
  • One way or another you have to pad to fill one block. To distinguish ECB with random padding to any padding CBC, look at the transmitted data. CBC mode requires two blocks. – kelalaka Jan 17 at 8:59
  • ITYM E(m1)=E(m2) iff m1=m2 – dave_thompson_085 Jan 18 at 3:44
  • Ok, after further reading I now understand how the random data can be added during the encryption process and how it avoids repeating. It's safe to assume from Microsoft's factsheet that they use a non-ECB block cipher mode. Since the use of ECB would reduce AES-128 to the same level as a substitution cipher, I hope it is also safe to assume that no other manufacturers of modern equipment would be irresponsible enough to use it over CBC or another mode. I would still like to find more specific information to support that assumption, however. – tripolon Jan 18 at 4:53
  • @tripolon Microsoft uses more than CBC. They also put, at least, timestamps to prevent the replay attacks. – kelalaka Jan 18 at 9:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.