import random from Crypto.Util.number import * flag = b'********************************' m = bytes_to_long(flag)
rr = matrix(ZZ,[random_vector(ZZ,256,0,2) for _ inrange(256)]) mm = matrix(GF(2),[list(bin(m)[2:].rjust(256,'0'))]*256) cc = mm+rr ii = vector(ZZ,input("Undoubtedly, this is a backdoor left for you: ").split(",")) dd = rr*ii
from Crypto.Util.number import * r0 = "" dd0 = 57899155721916261937717848836826880284444156537796259966393107788286965549457 ii = [pow(2, i) for i inrange(256)] for each in ii[::-1]: if dd0 >= each: r0 += '1' dd0 -= each else: r0 += '0'
import signal import os import sys import random flag = "************************"
deftimeout(*args): sys.exit(0)
q = 11769445852166501942131444325164359907623906505859865854871085543754710159882777389890225783970170353153967463136054852998337865848469266919651006863215539 p = 23538891704333003884262888650328719815247813011719731709742171087509420319765554779780451567940340706307934926272109705996675731696938533839302013726431079 g = 2 assert q*2+1 == p
x = random.getrandbits(48) y = pow(g, pow(g, x, q), p) print(y) print(x) try: _x = int(input('> ')) if x == _x: print(flag) else: print("Error...") except: exit(0)
for i in tqdm(range(2**24)): l = pow(y, pow(g, -i, q), p) j = rr.get(l) if j isNone: continue x=j * 2**24 + i break print(x) io.sendline(str(x)) print(io.recvline())