# Understanding Cryptography by Christof Paar and Jan Pelzl - Chapter 2 Solutions - Ex2.3

- 1 min

## Exercise 2.3

Assume an OTP-like encryption with a short key of 128 bit. This key is then being used periodically to encrypt large volumes of data. Describe how an attack works that breaks this scheme.

### Solution

This solution is verified as correct by the official Solutions for Odd-Numbered Questions manual.

The main issue is that the key repeats every 128 bits. As such, the attacker may be able to exploit patterns in the underlying plaintext to recover the key. If a chosen plaintext attack is available then the attacker may be able to recover the entire key and then decrypt the rest of the message unhindered. In mathematical terms, the attack looks as follows (where $s_i$ is a keystream bit, $x_i$ is a chosen plaintext bit and $y_i$ is a ciphertext bit):