from Crypto.Util.number import getPrime,bytes_to_long from secret import flag, p,a,b
flag=bytes_to_long(flag)
E = EllipticCurve(GF(p), [a, b]) G = E.gens()[0]
P=G*flag print('here is my 7 xs can u get my private key ?') #print(P[0]) for i inrange(7): PP=P+i*G print(PP[0])
''' here is my 7 xs can u get my private key ? 127222731808447286384197097524849730324280912084690383123034174156693907296321941583008138816149304043198829099586978152639 540150767459876746741544981524050320567261340627105743010550795668800394677819357272612801849680099119164471834128771848184 378426912752589864658307848293724051252472266429208255456184007500868515338668653822829851730193370970777687937350186024739 114528622155057967694026934367142168000739167063266001591280862125480038107282641048998814104241182719055831758176542012114 322400405850331256663554456242498354334347017862265389196757152850674454034744292814021471167045908645361119988919752367867 496047308313146975448000924265615728665813401349451895964344399497579232646901690982051726266819379622021083585061713111901 339613985780778130822549050414603776860269549419836797423421156347303558845214120048926926114443864057942273222884788713615 '''
deff(): defy2(x,A,B): return x^3+A*x+B F=[] for i inrange(5): f=xb*(Q[i+1]-Q[i])^2-y2(Q[i+1],A,B)-y2(Q[i],A,B)+(Q[i]+Q[i+1])*(Q[i+1]-Q[i])^2 f=f^2-4*y2(Q[i+1],A,B)*y2(Q[i],A,B) F.append(f) Ideals=Ideal(F) I = Ideals.groebner_basis()
res=[x.constant_coefficient() for x in I] return res P.<xb,A,B>=PolynomialRing(ZZ)
res = f() q = int(res[-1]) q = factor(q)[-1][0] P.<xb,A,B>=PolynomialRing(Zmod(q)) res = f() Gx,a,b=res a = -a b = -b E = EllipticCurve(GF(q), [a, b])