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
To submit a flag, log in.