from decimal import * import math import random import struct from flag import flag
assert (len(flag) == 48) msg1 = flag[:24] msg2 = flag[24:] primes = [2] for i inrange(3, 90): f = True for j in primes: if i * i < j: break if i % j == 0: f = False break if f: primes.append(i)
getcontext().prec = 100#设置有效数字 keys = [] for i inrange(len(msg1)): keys.append(Decimal(primes[i]).ln())
sum_ = Decimal(0.0) for i, c inenumerate(msg1): sum_ += c * Decimal(keys[i])
ct = math.floor(sum_ * 2 ** 256) print(ct)
sum_ = Decimal(0.0) for i, c inenumerate(msg2): sum_ += c * Decimal(keys[i])
from decimal import * import math primes = [2] for i inrange(3, 90): f = True for j in primes: if i * i < j: break if i % j == 0: f = False break if f: primes.append(i) getcontext().prec = 100 keys = [] for i inrange(24): keys.append(math.floor(Decimal(primes[i]).ln()*2**256)) c1 = 597952043660446249020184773232983974017780255881942379044454676980646417087515453 c2 = 425985475047781336789963300910446852783032712598571885345660550546372063410589918
L = matrix([[0for _ inrange(25)] for _ inrange (25)]) for i inrange(24): L[i,-1] = keys[i] L[i,i] = 1 L[-1,-1] = -c1
for i in L.LLL()[0][:-1]: print(chr(i),end='') L[-1,-1] = -c2 for i in L.LLL()[0][:-1]: print(chr(i),end='')