We sent the same announcement to three servers for redundancy. Each server has its own RSA key. Intercept all three — maybe you can piece something together.
Initial Analysis
The challenge provides an output.txt containing an exponent , three moduli (), and three ciphertexts (). By examining the data, we notice:
- Low Exponent: is very small.
- Identical Ciphertexts: . This means the raw message was not padded differently for each server.
- Magnitude of : The ciphertext is significantly smaller than any of the moduli .
In RSA, the encryption process is . Usually, is much larger than . However, if , then the modulo operation has no effect, and .
Solution
Since and , the message can be recovered simply by calculating the integer cube root of :
Implementation
Using Python and the gmpy2 library, we can solve for :
import gmpy2from binascii import unhexlify
# Intercepted ciphertextc = 475436441896018898725156479190091126537849994697426945980826369000641892902004477923335055269088235139492237640527487698088281484953901383579636883543216552932099156009006828723690550706326538736801225046068870773990108130474408522838234755277972911893744937243892927414355347438993698991261629557719442242861719577879055371620865465785392597257968132649494474946507819896785671106833645551504301840437212737125
# Calculate the cubic rootm, exact = gmpy2.iroot(c, 3)
if exact: # Convert integer to hex, then to ASCII flag = unhexlify(hex(m)[2:]).decode() print(f"Flag: {flag}")Note: This challenge is a simplified version of Håstad’s Broadcast Attack. While Håstad’s attack typically uses the Chinese Remainder Theorem (CRT) to solve for when , the small size of the message relative to the key size here allowed for a direct cubic root calculation.
Flag
kashiCTF{h4st4d_s4ys_sm4ll_3xp0n3nts_k1ll_RSA_br04dc4sts}