b = 2**128 print(b) import gmpy2 from Crypto.Util.number import *
flag = b'' f = bytes_to_long(flag) print(f.bit_length()) # 255 p = getPrime(512) g = getPrime(128) g = g #固定 temp = gmpy2.iroot(2 * p, 2)[0] print(temp.bit_length()) # 257
from Crypto.Util.number import * from secret import flag import gmpy2
assertlen(flag) == 47
f = bytes_to_long(flag) p = getPrime(512) g = getPrime(128) h = gmpy2.invert(f, p) * g % p
print('h =', h) print('p =', p)
""" h = 9848463356094730516607732957888686710609147955724620108704251779566910519170690198684628685762596232124613115691882688827918489297122319416081019121038443 p = 11403618200995593428747663693860532026261161211931726381922677499906885834766955987247477478421850280928508004160386000301268285541073474589048412962888947 """
import libnum h = 9848463356094730516607732957888686710609147955724620108704251779566910519170690198684628685762596232124613115691882688827918489297122319416081019121038443 p = 11403618200995593428747663693860532026261161211931726381922677499906885834766955987247477478421850280928508004160386000301268285541073474589048412962888947
b = 2^256 print(b) Ge = Matrix(ZZ,[[1,b*h], [0,b*p]]) print(Ge.LLL()) f,g = Ge.LLL()[0] f,g = abs(f),abs(g)