CryptographyLevel 4★★★★☆140 pts

Cryptanalysis - Recovering an LCG's Hidden Parameters

Mission

A service generated both session tokens and an encryption keystream from a linear congruential generator x_{k+1} = (a*x_k + c) mod m whose parameters a, c and m are secret. Recover a, c and m from the 10 consecutive outputs in tokens.txt, then decrypt secret.enc.hex, which was encrypted with a keystream made of the following outputs as 8-byte blocks, and extract the flag.

#cryptography#lcg#prng#state-recovery