from Crypto.Util.number import *
import gmpy2
c = 122899291469021470029549130291481574095771255674082966638
n = 4290418064651218965804214795113724709341221467051724424273
e = 65537
factors = [14574373685302455767, 17136129397262704181, 17178964373573894299]
phi = 1
for x in factors:
phi *= (x-1)
d = gmpy2.invert(e, phi)
print long_to_bytes(pow(c, d, n))
PS C:\Users\kai> & python c:/Users/kai/Desktop/py/py/多因数.py
Traceback (most recent call last):
File "c:/Users/kai/Desktop/py/py/多因数.py", line 1, in <module>
from Crypto.Util.number import *
ImportError: No module named Crypto.Util.number
当初安装为 pip install crypto导致该问题,第三包有问题需要重新安装
卸载: pip uninstall crypto pycryptodome
重新安装: pip install pycryptodome -i https://pypi.tuna.tsinghua.edu.cn/simple
重新执行后,恢复正常
PS C:\Users\kai> & python c:/Users/kai/Desktop/py/py/多因数.py
flag{n0t_RSA}
PS C:\Users\kai>