Predictable Recovery
A recovery service exposes consecutive outputs and the recurrence used to generate them. Calculate whether its next security token remains secret.
Objective
- Evaluate one linear congruential generator step.
- Explain why deterministic public state is unsuitable for security tokens.
Before you begin
Open /challenge/hard/predictor and fetch the linked sequence as JSON.
Concepts
An LCG computes next = (a × current + c) mod m. Once its parameters and a current output are known, later outputs are reproducible.
A deterministic generator transforms its current state into new state and output. If a weak design exposes or makes its state easy to guess, future outputs may become predictable. Cryptographically secure generators also use deterministic operations, but require suitable entropy, construction, and state protection. Deterministic signing nonces use a separate standard design bound to the private key and message.
Suggested tools
- Python or calculator: Preserve full integer precision and use
%for modulus.
Tool practice
Rehearse the worked tool exercise before using challenge data.
Use Python integers and % for remainder. For a synthetic recurrence (5 * current + 3) % 16, current=2 gives 13 and the next step gives 4. Print both transitions. In the game, extract constants from the algorithm string; the response does not provide separate a, c, and m fields.
Investigation
Observe
Read a, c, and m from the returned algorithm string and record the two ordered outputs. Verify the second from the first before predicting another.
Form a hypothesis
Does applying the same recurrence once to the latest output yield an accepted recovery token?
Test carefully
Calculate locally and submit only the resulting decimal integer.
Progressive hints
Hint 1
Use the second output as current.
Hint 2
Evaluate multiplication and addition before % modulus.
Hint 3
Send the result as the token query parameter.
Troubleshooting and reset
Avoid floating-point calculators and thousands separators. The endpoint is stateless; recalculate rather than guessing.