Cryptography problem:Calculate the values of A and B corresponding to an LCG that generated the sequence mod 19 starting with the numbers (3,10,11).

28 Views Asked by At

enter image description here

I don't know if this is the right place to ask this question (although the question is purely mathematical), but let's go anyway. I'm a little confused, from what I understand in the image formula $$ \frac {S_2-S_3} {S_1-S_2} $$ but in the case where the sequence is given by (3,10,11) we would have got $$ \frac {S_2-S_3} {S_1-S_2} = \frac {10-11} {3-10} \pmod {19} = \frac{1}{7} \pmod{19} $$

but that can't happen, right?

I also saw a notation like $$ (S_2-S_3) ({S_1-S_2}) ^ {-1} \pmod{19} $$ in that case we would have $$ (10-11) ({3-10})^{-1} \pmod{19} =({-7})^{-1} \pmod{19}= 8 \pmod{19} $$ where $(-7)^{-1}$ is the modular multiplicative inverse, so A = 19-8 = 14.

$$ B= S_2 - S_1(S_2-S_3) ({S_1-S_2}) ^ {- 1} mod 19 = 10-3(S_2-S_3) ({S_1-S_2})^{- 1} mod 19= 10-3( -1(-7)^{-1})= -23 mod 19= 4$$

But using the formula

$$S_{i+1}= (A*S_i + B) mod 19$$

we have

$$S_2= (11*3+4) mod 19 = 18 $$ what is wrong.

I think I didn't quite understand something.

Thanks in advance for any assistance.