Description
Yet another completely unrealistic RSA challenge.
Attachments
https://imaginaryctf.org/f/0XmFE#challenge.py
Writeup
Use resultants to find a multiple of p, then gcd to factor n.
PR = PolynomialRing(QQ, "x, y, z")
x, y, z = PR.gens()
f1 = x**e - c1
f2 = y**e - c2
f3 = z**e - c3
f4 = x + y + z
g = ZZ(f1.resultant(f4, x).resultant(f2, y).resultant(f3, z))
p = gcd(g, n)
q = n // p
phi = (p - 1) * (q - 1)
d = inverse_mod(e, phi)
m = pow(c, d, n)
flag = long_to_bytes(m)
print(flag)
Flag
ictf{https://youtu.be/iLYVqdekt6s}