srdnlen CTF 2022 | wtfrsa

#srdnlen_CTF_2022

e: 18959
p: 8853107629856302430942645802685600792214004993921099904332911487775152756152460899671437787731654521568200225685173143721860070387195312109191089843558621
q: 12263776399134581413994039043220106353464473125114825391625856240762676598269365363349978019785253746863903410731653514543481130557521535535237879154364911

ct: 64521812048352846958817059534278142356568238192123182336017359260377716295619478728140210232152018155950695896362673540987021049139829121799099909484852120051863107269165139203886417085008081775352265576110683356959797391197297615443422020648048621511483229468510937180464189390129089235915976695524813058244

non-coprime exponent RSA

sage の素因数分解アルゴリズムにヒントを与えるをやったあとにnth-rootをやった

e = 18959
p = 8853107629856302430942645802685600792214004993921099904332911487775152756152460899671437787731654521568200225685173143721860070387195312109191089843558621
q = 12263776399134581413994039043220106353464473125114825391625856240762676598269365363349978019785253746863903410731653514543481130557521535535237879154364911

ct= 64521812048352846958817059534278142356568238192123182336017359260377716295619478728140210232152018155950695896362673540987021049139829121799099909484852120051863107269165139203886417085008081775352265576110683356959797391197297615443422020648048621511483229468510937180464189390129089235915976695524813058244


pari(f"addprimes({p})")
rs = mod(ct, p*q).nth_root(e, all=True)

for r in rs:
    print(int(r).to_bytes(200, "big"))