Skip to main content
Challenges Square modulus (n = p^2)
Cryptography Medium Special modulus Solves: 6

Square modulus (n = p^2)

Author: CyberSamSU
Points
35

In RSA, there must be n = p · q, that is, two different prime numbers. However, some programmers make a mistake and use the same prime number twice: n = p · p = p².

This is a fatal mistake. Because to factorize n nothing is needed — we simply take the square root: p = isqrt(n) and check that p · p == n.

The second tricky part is Euler's totient function. The formula φ(p·q) = (p−1)(q−1) does not work here. The correct formula is: φ(p²) = p² − p = p · (p−1). After that, d = e−1 mod φ(n) is found as usual.

The key and ciphertext are in the kalit.txt file. Decrypt the message — the decrypted bytes directly give the flag.

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

First solvers

1. Лазиз 04.10.2026
2. Mirjaxon Qaxxarov 27.10.2026
3. Odam 05.11.2026
4. arcanum 11.11.2026
5. Doston Allayarov 28.11.2026
6. AGENT X 28.11.2026