- Round: 40 (2023/11)
- Category: Crypto
- Points: 100
- Solves: 8
The flag is hidden somewhere in the 1337th universe.
Same idea as this question , but you don't really need to factor the resultant as computing polynomial gcd is enough.
x = polygen(ZZ)
f = x**13 + 37
g = (x + 42) ** 13 + 42
v = abs(ZZ(f.resultant(g)))
print(v)
R = Zmod(v)
ff = f.change_ring(R)
gg = g.change_ring(R)
while gg:
ff, gg = gg, ff % gg
x = ZZ(-ff[0] / ff[1])
print(x)
print(gcd(f(x), g(x)))