← all challenges

Quadratic Residue

Level 5 · Master crackme 800 pts

🎯 Briefing

Given the prime p = 7919 and a residue a stored in the binary, find an x in [0, p) with x^2 ≡ a (mod p). Searching is pointless at this size; compute a modular square root with Tonelli–Shanks. Since p ≡ 3 (mod 4), the shortcut x = a^((p+1)/4) mod p also works. Either of the two roots x and p - x is accepted.

⬇️ Get the challenge

Download (linux) 5.6 MB · sha256 6f0e7f3939e0a156…

Download (windows) 4.2 MB · sha256 025ee2b0f604a67e…

Reverse it to recover the flag — ideally with ORRESS. Run unknown binaries in a VM.

💡 Hints (0/3 used)

Log in to use hints.

📝 Writeup

🔒 Solve this challenge to unlock the author's writeup.