[LitCTF 2023]factordb (中级)
题目分数:415
题目标签: 现代密码RSAfactordb
题目描述:
能分解n不仅仅只有yafu哦,还有factordb!!!!
出题人:3tefanie丶zhouFlag格式 NSSCTF{}
附件:
e = 65537
n = 87924348264132406875276140514499937145050893665602592992418171647042491658461
c = 87677652386897749300638591365341016390128692783949277305987828177045932576708
解码:
import gmpy2
from Crypto.Util.number import long_to_bytes
e=65537
p=275127860351348928173285174381581152299
q=319576316814478949870590164193048041239
n = 87924348264132406875276140514499937145050893665602592992418171647042491658461
c = 87677652386897749300638591365341016390128692783949277305987828177045932576708
phi=(p-1)*(q-1)
d=gmpy2.invert(e,phi)
m = pow(c,d,n)
print(long_to_bytes(m))
# LitCTF{factordb!!!}