标签:import little with 查看 class via with open imp length
查看给的附件,就明白,这对公钥中,n过大,所以我们直接对c开e此方即可
aaa.py中是之前利用python写入的c
from aaa import *
import gmpy2
e = 65537
def dec(ctxt):
c = ctxt
eth_root = gmpy2.iroot(c, e)
if eth_root[1] != True:
print("not trivial RSA")
m = int(eth_root[0])
print(m)
msg = (m).to_bytes(m.bit_length() // 8 + 1, byteorder = ‘little‘)
return msg
with open("flag.enc", "rb") as f:
ctxt = f.read()
cc = int.from_bytes(ctxt, byteorder = ‘little‘)
print(dec(cc))
[b01lers2020]safety_in_numbers
标签:import little with 查看 class via with open imp length
原文地址:https://www.cnblogs.com/p201721410013/p/12650213.html