RSA Weak Exponent

A message was encrypted using RSA with a dangerously small public exponent (e=3). When the plaintext is short enough that m^e < n, no modular reduction occurs and the ciphertext is simply m^e. Take the e-th root to recover the plaintext.

AlgorithmRSA
Key Size2048-bit
Exponent (e)3
VulnerabilityCube Root

Challenge Data


        

Solution Approach

from gmpy2 import iroot
from Crypto.Util.number import long_to_bytes
import json

with open('rsa_challenge.json') as f:
    data = json.load(f)

c = int(data['c'])
e = data['e']  # 3

# Since m^3 < n, c = m^3 exactly
m, perfect = iroot(c, e)
assert perfect
print(long_to_bytes(int(m)).decode())

Submit Flag