I need to crack this linear congruential generator.
I have
$$X_{n+1}=a⋅X_n +b \pmod m$$
I know: $m=31,X_3=30,X_4=19,X_5=26$
How can I find $a,b$ and $X_0$?
I have got already the following equations:
$$26=a \cdot 19+b \pmod{31}$$
$$19=a \cdot 30+b \pmod{31}$$
substruct 2 equations to get
$$7= -11 \cdot a \pmod{31}$$ $$7= 20 \cdot a \pmod{31}$$
the inverse of 20 is 14 in $\bmod 31$, $20 \cdot 14 = 1 \pmod{31}$.
$$7 \cdot 14= 14 \cdot 20 \cdot a \pmod{31}$$
$$7 \cdot 14= a \pmod{31}$$