Kerckhoffs’s principle: a cryptosystem must remain secure even if everything about the system, except the key, is public knowledge.
Since security depends only on the key, the key space must be large enough to make an exhaustive key search infeasible.
Stream Cipher
Models plaintext as a bit stream, combined with a random keystream via a reversible operation, bitwise XOR.
Both encryption and decryption must generate the identical keystream .
- No error propagation
A bit error in a transmitted ciphertext bit corrupts only the corresponding decrypted plaintext bit. - Efficient for real-time data (audio, video streaming) when the keystream generation algorithm is fast.
One-Time Pad
A keystream that is different for every message and as long as the message is perfectly secure.
Keystream Generator
Practical stream ciphers use a keystream generator: a short secret key expands into a stream of pseudorandom bits .
A secure keystream generator must satisfy:
- Long period
The period of the repetition of the sequence, where , must be large for all . - Pseudo-randomness
The sequence must pass statistical random number tests. - Unpredictability
Computationally infeasible to determine the full keystream from any part of it, of any length.
Attacking a Stream Cipher
Reusing a key produces related ciphertexts for different messages.
An attacker who captures ciphertext streams can construct a new ciphertext, without knowing the key, that decrypts predictably. This is an existential forgery attack.
Lorenz Cipher
A stream cipher, manufactured by C. Lorenz AG, that encrypts a Baudot-coded plaintext bit stream into 5 ciphertext bit streams.
Encryption XORs the 5-bit Baudot code with a 5-bit random sequence, generated by 12 shift registers in 3 groups:
- 5 registers, lengths 41, 31, 29, 26, 23.
- 5 registers, lengths 43, 47, 51, 53, 59.
- 2 registers, lengths 61, 37.
At each clock tick :
- for .
- , and the registers advance.
- advances every tick, and conditionally triggers to advance.
- conditionally triggers the registers to advance.
- Output .
Key space: