Skip to main content
Challenges Legendre symbol
Cryptography Medium Legendre symbol Solves: 5

Legendre symbol

Author: CyberSamSU
Points
45

For a large prime number, "enumerating all squares" is impossible. Instead, the Legendre symbol is used. It takes three values: 1 — a is a quadratic residue, -1 — it is not a residue, 0 — a is divisible by p.

Euler's criterion calculates the symbol with a single exponentiation: (a|p) ≡ a^((p-1)/2) (mod p). The result is 1 or p-1 (i.e. -1).

If p ≡ 3 (mod 4), finding the square root is also easy: x = a^((p+1)/4) mod p. And the second root is p - x. The given p satisfies exactly this condition.

The attached parametrlar.txt file contains p and three candidates. Only one is a quadratic residue. Find its larger square root, take the last 16 digits of its decimal representation, and assemble the flag: BAYROQ{M4TH_legendre_<16 ta raqam>}

Attached files
parametrlar.txt Log in to download
SHA-256 checksums
parametrlar.txt: 89d74af6d254ebcad2ab06cfa107e1e89c1935dd35694f97d07810ce37927749
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −4 pts Log in
Hint 2 −9 pts Log in
Hint 3 −13 pts Log in
To submit a flag, log in.

First solvers

1. W.o.X 17.09.2026
2. Лазиз 04.10.2026
3. Mirjaxon Qaxxarov 26.10.2026
4. Odam 05.11.2026
5. arcanum 11.11.2026