Cyberleague 2025
Baby LCG
Crypto | Pre-CTF
I just started learning about LCG!
Unfortunately, it seems that LCG is quite weak, given how there are so many papers showing how easily you can crack LCG parameters.
Findings from the given source file:
An AES-CBC encrypted ciphertext with its IV
The modulus and three terms (19th, 38th, and 57th) from a Linear Congruential Generator (LCG)
The 1st term of the LCG serves as the AES encryption key
The solution approach is to reverse the given LCG numbers to get the initial term for the decryption key. Here is a good read on LCG Attack : https://msm.lt/posts/cracking-rngs-lcgs/
The LCG generator is defined by the recurrence relation:
What makes this challenge unique is that instead of consecutive terms, we're given values at fixed intervals of 19. However, this property can still be exploited to recover the initial seed.
For any LCG sequence, we can express terms with fixed intervals using the same coefficient structure. Consider the following relations:
Notice that despite the gaps between terms, the coefficient patterns remain consistent at equal intervals. We can apply this principle to our given terms , and to determine the coefficients needed to calculate the initial term .
Here is the solution script:
ββ$ CYBERLEAGUE{LCG_W1th_N0n-C0n53cu71v3_0u7pu7_15_57111_W34k!}
Last updated