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

- 1 min- Return to index
- Exercise 2.1
- Exercise 2.2
- Exercise 2.3
- Exercise 2.4
- Exercise 2.5
- Exercise 2.6
- Exercise 2.7
- Exercise 2.8
- Exercise 2.9
- Exercise 2.10
- Exercise 2.11
- Exercise 2.12

## 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 is a keystream bit, is a chosen plaintext bit and is a ciphertext bit):