Table of Contents
LakeCTF 2025 - The Phantom Menace (Crypto)
by Ansh Agrawal on 11/28/2025
Challenge: The Phantom Menace
Category: Crypto
Flag: EPFL{y0u_w3r3_r1ght_m4a5t3r_th3_n3g0t14t410n5_w3r3_5h0rt_ot3zhe}
My initial read / first impressions
We are provided with chall.py and a JSON file containing keys. At first glance, this looks like a serious “Learning With Errors” (LWE) challenge. The code implements a cryptosystem very similar to Kyber, which is the current standard for post-quantum cryptography.
I checked the parameters immediately, hoping for a “Weak Parameter” attack (like a small n or modulus q):
# Parameters
q = 3329
n = 512
k = 4These are essentially the parameters for Kyber-512. In lattice cryptography, with a module rank of 4 creates a lattice dimension over 2000. This is massive. You cannot solve this using lattice reduction algorithms like LLL or BKZ; the search space is astronomically too large.
I thought I might have to look for a flaw in the random number generator or the polynomial multiplication logic, but the math looked standard.
The Vulnerability
The vulnerability wasn’t in the math—it was in the file handling.
The challenge is named