Skip to main content
Challenges Common modulus attack
Cryptography Hard RSA attacks Solves: 7

Common modulus attack

Author: CyberSamSU
Points
75

An organization gave two departments the same modulus n, but made the public exponents different: e1 and e2. The management sent the same order to both departments, resulting in a single message being encrypted twice — with different e.

This is the classic common modulus vulnerability. If gcd(e1, e2) = 1, the extended Euclidean algorithm gives such integers a, b that a·e1 + b·e2 = 1. Then:

c1^a * c2^b  =  (m^e1)^a * (m^e2)^b  =  m^(a*e1 + b*e2)  =  m^1  =  m   (mod n)

The tricky part: one of a or b will necessarily be negative. For a negative exponent, first take the modular inverse of the ciphertext: pow(c, -1, n), then raise it to the positive power.

The data is in the xabar.txt file: n, e1, e2, c1, c2. Read the message without finding the private key — the decrypted bytes directly give the flag.

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

First solvers

1. W.o.X 17.09.2026
2. Лазиз 04.10.2026
3. testrejim 09.10.2026
4. Mirjaxon Qaxxarov 27.10.2026
5. Odam 04.11.2026
6. arcanum 11.11.2026
7. Doston Allayarov 28.11.2026