Search space is much bigger than SEND + MORE = MONEY, can Picat do this ?
https://blog.securityevaluators.com/hacking-the-javascript-lottery-80cc437e3b7f?gi=4413eba2960a
Recover initial state with last bit of 128 xorshift128+ calls:
You still only have 128 bits information, but no need to worry about carry
Here is the equations of first 2 calls
state0 = {x, y}
state0 last bit
= last_bit(x + y) = last_bit(x ^ y) -- no carry for last bit
= x0 ^ y0
After 1 xorshift128+ :
state1 = {y, (x ^ x<<23) ^ y ^ ((x ^ x<<23)>>18) ^ (y>>5)}
state1 last bit
= last_bit(y ^ (x ^ x<<23) ^ y ^ ((x ^ x<<23)>>18) ^ (y>>5))
= last_bit(x ^ (x>>18) ^ (y>>5))
= x0 ^ x18 ^ y5
...
--> 128 equations, 128 unknowns (bits of {x, y})
--> each equation cut down possible states by 50% (last bit is 0 or 1)
--> one unique {x, y} remain after solving all 128 equations
Although each equation reduce the search space in half, it does not help at all
We just don't know which half is correct, so it provide no real shortcut.
It is the same as saying each bit is either 0 or 1, which give no useful information.
--> z3 solver is unable to solve xorshift state from 128 last bits.
With 3 math.random(), however, z3 solved it in less than half second.
Since last bit is a LSFR of degree 128, here is the proof: