I am reading an intro book about cryptography and the author tries to explain why using pseudo random number generators is vulnerable.
Given PRNG equation;
\begin{align} S_0 &= \text{seed}\\ S_{i+1} &\equiv A\cdot S_i + B \mod m, i = 0,1,\ldots \end{align}
where we choose $m$ to be 100 bits long and $S_i,A,B \in \{0,1,\ldots,m−1\}.$ Since this is a stream cipher, we can encrypt
$$y_i \equiv x_i + s_i \mod 2$$
Further in the text:
But Oscar can easily launch an attack. Assume he knows the first 300 bits of plaintext (this is only 300/8=37.5 byte), e.g., file header information, or he guesses part of the plaintext. Since he certainly knows the ciphertext, he can now compute the first 300 bits of key stream as: (Equation 1) $s_i \equiv y_i + x_i \mod m, \; i=1,2,\ldots,300$
There are several things about the paragraph above that I don't understand.
- Firstly, by what mechanism could Oscar gain the first 300 bits of plaintext? It makes little sense for Alice (the person who tries to securely communicate with Bob) to send encrypted and plain text together.
- Is there a situation this happens?
- How exactly could Oscar predict the word and location of cyphertext?
Secondly, I don't understand how Equation 1 was derived?
I appreciate any help.