朝花夕拾(三)HZNUCTF 2023
[HZNUCTF 2023 preliminary]cpdd
简单摩斯密码,换为.-之后用在线网站解。
cipher = 'cccc,ppcc,pc,ccp,pcpc,p,ccpc,ppppcpp,pccppppcppccccc,pppccpcccppcccp,pcpcpcppccpcpcc,ppcccpccccpcccp,pppccpcccppcccp,pccppppccppcccp,pcpcpccppccpccc,pppcppcpcpcpppc,ppcpppcppppcpcc,pcpcppccccccccc,pppcpcpcccpppcc,pccccpppcccpppcc,pcppcppppcccppc,pppppcp'.replace(',',' ')
table = str.maketrans('cp','.-')
print(cipher.translate(table))
[HZNUCTF 2023 preliminary]easyDSA
简单的二元copper,推导过程看代码就行。
from Crypto.Util.number import *
import itertools
def small_roots(f, bounds, m=1, d=None):
if not d:
d = f.degree()
R = f.base_ring()
N = R.cardinality()
f /= f.coefficients().pop(0)
f = f.change_ring(ZZ)
G = Sequence([], f.parent())
for i in range(m+1):
base = N^(m-i) * f^i
for shifts in itertools.product(range(d), repeat=f.nvariables()):
g = base * prod(map(power, f.variables(), shifts))
G.append(g)
B, monomials = G.coefficient_matrix()
monomials = vector(monomials)
factors = [monomial(*bounds) for monomial in monomials]
for i, factor in enumerate(factors):
B.rescale_col(i, factor)
B = B.dense_matrix().LLL()
B = B.change_ring(QQ)
for i, factor in enumerate(factors):
B.rescale_col(i, 1/factor)
H = Sequence([], f.parent().change_ring(QQ))
for h in filter(None, B*monomials):
H.append(h)
I = H.ideal()
if I.dimension() == -1:
H.pop()
elif I.dimension() == 0:
roots = []
for root in I.variety(ring=ZZ):
root = tuple(R(root[var]) for var in f.variables())
roots.append(root)
return roots
return []
(r1, s1) = (43665657147136977892760835332544097729763754398125679419859037123212964274095, 11372107439153704547599978617809027960018057676066118055075660375442954789009)
(r2, s2) = (29184887007213204285288676779168140587575609668559831035949650649308618592275, 5011738292572181542092375902756977363590922060964162373234404450451520414798)
p = 31961141251107494919420190534228520246958409864267239760354623819192809291490262139213317490432416411403367763443527530375117617196123131270496004125231254335150221348901335274505489844222882171272650010562960614279185073793274638651086760235178963210965828168433516820007716846876686795459738332444629111764967204355463398049697867061034126529189537688874999118692225915790053920062142349951686250122300061810240375783724631961234942175580462986265098353263395579346466921241016500821787793395554444982717141449909744838267161237273856377774256250949274635575801148994817767751541256849860886577256992383324866941911
q = 69375998045163628324086568160767337544901252262545889505892695427466730978301
g = 23095306638137759877487469277470910487928442296144598697677211337473146684728707820084075779044942034329888686699655576145455963231144004571165817481066424910959951439014314776050521403558035997997820617824839889597136772108383034876458141163933312284054415480674388788905935457149956424898637134087874179010376667509489926236214865373552518669840236207944772752416668193786003948717604980584661094548997197117467440864460714843246250800575997370964173558788145639802963655916833143883799542309432910222224223561677245110195809587171802538978009246887077924173034608600837785506594525481696000424121705524449481831586
y = 30195133393879069638917191223585579396119430591488890396938821804398771785068454607425044458865556053274470709839502680269466948174813926392729790863065933078609827279352860810689776644132512095691760326095517755483748554008211568781998662554432781285208646921699265866446498342049913829592480268053599307065979016922204438675164034767731708343084371572648019835171087671868322447023378942812010740490724160077164191297435291229504616686997442254543493394641023587237077429236872101951650325361004443988267286616139798736713430746804524113024341440435623834197278500144543476528466395780355874841379098027115073850819
h = 19905280947443115569469777697852124038269468456842113763109865796452965095134
P.<k1,x0> = PolynomialRing(Zmod(q))
f = (s2*(k1^2+x0) - h) * inverse(r2,q) - (s1*k1-h)*inverse(r1,q)
k1_,x0_ = small_roots(f,[2^64,2^20],m=2)[0]
print(k1_,x0_)
d = ZZ((s1*k1_ - h) *inverse(r1,q) % q)
print(long_to_bytes(d))
[HZNUCTF 2023 preliminary]噫~
rust写的一个简单古典密码。
from gmpy2 import *
f = open('output.txt','r').read()
a = 37
b = 52
for i in range(1,len(f)):
c_ = ord(f[i-1])
b += c_ % 127
o = (ord(f[i]) - b) * invert(a,127) % 127
print(chr(o),end='')
[HZNUCTF 2023 preliminary]side-channel
from Crypto.Util.number import *
e = 16059123945822694365158124950198825543484999519589187888337200553255798544440036832262284563838976515808578129291536616599557509264533073851159103105883072060720056631597958188429575916683604682603283361472163393387285175934398999920713460521688171388856936854606011599111757398384341169379550343011380822651520763942589923801782398753464143234709393484148664365254994860713155476167800961464275898199226390381810969888945023697984476906037653190402170336314921539242675073226168525550913706593532778562652428903475444637793556112819371434228940595513275038805389841060879447191510666943970447241850404552926199602519
n = 23676198353119272891587164142576908690376901293686314942784353146059194045274633032364567515126717515053410457120247729623176193595913335169727137670521232494953911307651873224240918425478358455021118904693825635883056533658237193708645648054998837744523526377375370015128407346231287149043212742478188696880965471297198589414377055357200554254450863749395859378259685909927883404933139662201392110242455689394258060803403855280967030411722557398887495577523627779690177862295719147486918280447692742391730411876509056043404048460252304050528824186627531118009773552255554195757232387432726685926648422550200240296689
c = 0x6a415f728907e12e2af16275da3de93f29640272116b61e36963241eabe10d63b40ace499ed4b5228acc331ff43eabae8c2ffc3ad563397dc9f67e1156000501ca74dddcb540b4de9ef5ddfd1cfc30ff012ea6542bc41c59e694e227d0f2b0e6f3e242df0e1484b02715afefe7ade7375bdd39f9230b705b63efa6d1b11e68caacb5e0dbd83c8204d2cb029722b1cf5ab148a5be7bab10519c0e2f12db9195fa6e2a974f2d6c16aa0cae44d8090c821ee3a344c0756e23cc6d1932155a334648a4a06285b80d4961c3652dba963107cb10e8b7dee5ebd677529486c8b54d230cd65e015767d23b9c79ed2d1a5a068e907b285a4ad65e4b0c2de727252a85f480
with open('./data.txt') as f:
data =f.read().split(',')
data = [eval(i) for i in data]
print('point number:', len(data))
start_point = 0 # 开始分析的点
mid = 50 # 采样点间隔
fence = 228 # 高低电平分界线
bin_array = []
for point_index in range(start_point, len(data), mid):
if data[point_index] > fence:
bin_array.append(1)
else:
bin_array.append(0)
bin_array2 = []
flag1 = 0
flag2 = 0
for x in bin_array:
if x:
if flag1:
flag2 = 1
else:
flag1 = 1
else:
if flag2:
bin_array2.append(1)
else:
bin_array2.append(0)
flag1 = 0
flag2 = 0
def power_mod(a, b, c):
ans = 1
a %= c
while b > 0:
if b % 2 == 1:
ans = (ans * a) % c
b //= 2
a = (a * a) % c
return ans
# d_bin = bin_array2[::-1]
d_bin = bin_array2
d = "".join(str(x) for x in d_bin)
print(d)
d_int = int(d,2)
print(d_int)
print(long_to_bytes(power_mod(c,d_int,n)))
[HZNUCTF 2023 preliminary]你的背包~
rust写的带模背包,但是维度很高,不过发现模数p是固定的,可以参考春秋杯notKnapsack的打法。exp基本照搬就可以,不贴了。
[HZNUCTF 2023 final]一步到喂
就考了个佩尔方程。
from Crypto.Util.number import *
from sage.all import *
p = 9850212100620338486478343799784951721581757936621772924971218807300819701941457605399099898870264241518769370682330612103782092302148525012450902351701339
q = 10749429992014823019923966246896511618886613763258781706004694804949547801668777655988055847885755337127548775758133804022361510427909703124161450470578543
c = 66847321508502017574023222490247591875197038421108556106531660421662626233521063441647157067220450229816184622038471812597874582613385516838920632450015292570673816423432903604941781889308906893966588610214614726388822851471695742453496232748358301888465563812947038856742838097152549971517159475947566599664
a = 1293023064232431070902426583269468463
b = 105279230912868770223946474836383391725923
def solve_pell(N,numTry):
cf = continued_fraction(sqrt(N))
for i in range(numTry):
denom = cf.denominator(i)
numer = cf.numerator(i)
if numer^2 - N * denom^2 == 1:
return numer, denom
return None, None
N = b//a
x,y = solve_pell(N,2000)
print(x,y)
phi = (p-1)*(q-1)
d = inverse(x,phi)
print(long_to_bytes(int(pow(c,d,p*q))))
[HZNUCTF 2023 final]checkin
费马小定理推导一下分解n,然后Cipolla算法解e为2的若干次方的情况。这里记一下板子:
from Crypto.Util.number import *
from tqdm import *
from sympy.ntheory.modular import crt
n = 22114546923564420607945063747927422619774890007937503484905798897563036431278699718161460968350749338680452479484253816646632515078192048118109272532310403715802657061990320170724360874028667484527150185159662403573637809180151665727445208585725264186578429094937215068881079399747998551453944363665401263
c = 7274219309267176700435453490636404568410293850833252412471984274955007037941820465929958008672185817002749418809077052781794306899476543760452010370102811167685901654480233874375880047900499814304539829706786470978714629827690730256369200773772396109793338097451559255985268375731804819829315168807228186
h = 1463929459818798711929811606552273520156490689917243949474579232718301828387871678397965433435537694532920957475947201372279363554005600100100224291888130
hint = 5610276127312766429915480651516095336201056367031530733662980757514427535721885723009367286870294772595629284861923351543396909892645845139050780691701736
e = 1 << 24000
print(e)
q = (hint + 2022*2024)//2024
p = n//q
assert p * q == n
def square_root_of_quadratic_residue(n, modulo):
"""Square root of quadratic residue
Solve the square root of quadratic residue using Cipolla's algorithm with Legendre symbol
Returns:
int -- if n is a quadratic residue,
return x, such that x^{2} = n (mod modulo)
otherwise, return -1
"""
if modulo == 2:
return 1
if n % modulo == 0:
return 0
Legendre = lambda n: pow(n, modulo - 1 >> 1, modulo)
if Legendre(n) == modulo - 1:
return -1
t = 0
while Legendre(t ** 2 - n) != modulo - 1:
t += 1
w = (t ** 2 - n) % modulo
return (generate_quadratic_field(w, modulo)(t, 1) ** (modulo + 1 >> 1)).x
def generate_quadratic_field(d, modulo=0):
"""Generate quadratic field number class
Returns:
class -- quadratic field number class
"""
#assert (isinstance(modulo, int) and modulo >= 0)
class QuadraticFieldNumber:
def __init__(self, x, y):
self.x = x % modulo
self.y = y % modulo
def __mul__(self, another):
x = self.x * another.x + d * self.y * another.y
y = self.x * another.y + self.y * another.x
return self.__class__(x, y)
def __pow__(self, exponent):
result = self.__class__(1, 0)
if exponent:
temporary = self.__class__(self.x, self.y)
while exponent:
if exponent & 1:
result *= temporary
temporary *= temporary
exponent >>= 1
return result
def __str__(self):
return '({}, {} \\sqrt({}))'.format(self.x, self.y, d)
return QuadraticFieldNumber
res1 = [c]
total = []
res2 = c
for i in tqdm(range(24000)):
tmp, res1 = res1, []
for ct in tmp:
mm = square_root_of_quadratic_residue(ct,p)
if mm not in total:
total.append(mm)
else: continue
if p-mm not in total:
total.append(p-mm)
else: continue
if mm == 1 or mm == p - 1 or mm == -1: continue
res1 += [mm,p-mm]
res1 = list(set(res1))
res1 = res1[-2:]
res2 = c
for i in tqdm(range(24000)):
res2 = pow(res2, (q + 1) // 4, q)
res2 = [res2, p - res2]
for i in res1:
for j in res2:
m = crt([p,q],[i,j])[0]
m = long_to_bytes(int(m))
if b'HZNU' in m:
print(m)
exit()
[HZNUCTF 2023 final]nothing
参考无趣的浅,格子都一样,这里顺便替他把格子改为1的那种形式,试了试bkz,果然秒出。
from Crypto.Util.number import *
sigs = ['0299f768be70f857f72b2f51ff1ea9c6a4150fc327d833f309cc4785e24e02e3da6eb00040d332a485055d5e4e1f100f11b5af7193fa0f563558198234493961', '56d69878a81b614df64df2dcba2ebafbedab1bbda6fc08fd284c513caff0d8c212989c49412bd07c45d28fa08f5d18db620ccb92a044c67dc0791b3b011674cb', '30d04db3ad528f895fb6693a5e04485cf66ebe05cc52af8816716540f19b72f2a2197e783c620a385a16cb8997721499cc4aa768616ca15d2db0f9fca8fd4cdb', '8da002a89caf9202d049992908261b71711b0961755374f3e0e7ce75808804e1f5c2e6cc16e98717af044a07094e48c4f99ddc3fbd980e5dce5bd383cab5933a', 'eb4ad94b8473ebe0f574ca9fd15a9e58feb26fc7b9a009c4659f018506e4c008f1ddb3a18fae3edbc7764e2f9fce69bac710aceff99b23d5d438242d36be9d69', '309bc1d88c74fffada98cc9894686d128498c2442d19d884a2567377aa3cd48fe3d965e3c8aa08b8b76ffd0e767b4c0021616df8dc841558b1a5a0c70bccbead', 'bff192d180050f161d739e73d5cb8885a5e2f14a218242d7fe7c1ac41ab6cb2a0b3beb1382280a08485657b1a0f739e87dad40173f7e2540049cbf1ec0a447e7', 'ab5b182c463193088e05d93d434b6bc85520b786c6d6d1bcb5e64d456611f94beb7851d9b8c9b0ef90c3b998e1513c6300a02e0116eb494bc08afb47a20f452d', '1dabd46bd2d6140d44a30755e704874c680d7c0dcfec873f552ae59e7507e287c5f78dd3a3c06a4cecd793dac7308943d4c8a7c67bcad9b3413429ccbab194d2', 'f963717351045558d74a1a9412a4077216472fd4e8bc9a9ca58bef7d04bdb242e7c01c322250482a2389a2e78b26d0576c1268a5d8075b2a64948629e40a8b4b', '7b5a09b1e6c56b045833bf29d270c4a9bf4b1bfc247bffb2a61593f42d041166c5a930a8859aa4d1974df71eac43b4901bd7850965620fbce4cfc14990e9ec3d', '9633edc09d43d120c14afda218ecc55c8dfe1ba300811179d64b18f8b42eb8864a31252329c2cc3b19a4c0aa617fc14904c10c0f8ec5733c5d495ccf337e00d3', 'f2cfe285bbff01789cd891c3aca036af4fb54fb9a65e76184c6cf5543772725b6c7d7db615457662da09136d8318028f2cb5b47296390d3c4381f9e9f75fb05c', 'cf6780d28db3611cbc7aa9f161f2a709fbbd29983be59ccb97631549ac2a929fe4924a4cd923c2e48db95d7bc4fac45bf537d6f13b3d8348f7b94ecc11c03854', '50323cfc4beda4f2542c9e509bb043ecc6aa8a898915db8e907843bb56a080d8a52929340fb56b5de43f956dd1173120b88c5c8718297d7d633469c5dc0f8ed9', 'b143d8f36fc56cfb0467dd54af9ce8bffdac3bb5b8aa1df7290a7f4ff632f834fb38917b1f02a82f50a9e7663ba8ec26357fded3ea7870bb463ac219b7a04cf9', '8a5450ca4d771dd63e974de33fcaedad6e53f94fb92d251dfba62c7121d27d6294d986325880d46cee0250a4a56558bb2fd7aa619bb0309b4c65b3cf11f6d4aa', '3ae81196d24fc740348dba4e03a5bc45a75d9fe41f52160870631b0ab3a71f9c63aa4cc247e2f285cf4803c564413283694fc3a75a673aa4f54374f1460e7421', 'a409b15c00793d88435bc31f538d318b69f66bb029c13a5ce298ede2db788cfa5dc39473f13417bdde338e509e85781cdfe54168d26a03fb35438b917506c24c', '0d12d48fdbce87d9584c1355f9fc3610db77e8df7514bd80479fa12fc960da39865d745ec49e266ac0ac3a7ce330c7cf406c9d124feefd8cc927e68f64155a0f', '3dd63eb496f64e61ca687c3daf437bc31f0b563b51bd4eded71d6eeb56d25089c4e2b09250984271d7a69540c4b39d70127ea38e3c126c35baa94aae92281a08', '38c9571625b7da8aaef69e21a1d225082e4772a0cf5d3c23f3e783c529adef1469588302e91a8c44511f037b5b3aeffa60dab7ff1b5900ec35431a9f846baa74', 'a8b7adda8626a880394b7c47142558ff113c8d7f7c69dfc562a5ad7a3ffd6692f2d7a4f4ef19404c5a4a1f80817a2f7fd0e6fa277418610ef2d2d6b97346b2e7', 'a86a30d05909d45683c0745102c095459582d8273e7f69d0f42b11511ec53a498ce6a5572698efaf632f4da2435b512ae97908d00052194f89ed1921c5a5e9da', '1c3371ed8aa9f914f71276eee3fd25cbd87780a68ef724ed28842bc83e0d02ef5867c3264563197c27bb1e5ec2ffd634e32b720c4f6d5725300350b8d5cca2d5', 'f064b874158ff296e07f75def08c63884fcca93fa2bc018c607736614bcab3e2f692d9b52ed106b8abf68eb564ba999c5fa094967f10630014f2c583e4db107b', 'e5e37d9857e638cc41af7bf75280108b2f86f64617e21057e246102262b0eebb20307f7f359375761bbd366b7e9c1c9914623f200098e713730b6160d09bd0cb', 'bc18436538ab7bcf1789fcbe58f860c5ee9c779a6ea465531febb6f50b57e71b74d2ea9e664739225c0979e8ff77f189c50f5872f5c5a4c042d21b49f3e995f1', 'b45968deda83d9f42a255d627b53a01c5e665b39d67d7516f4a7ad703be810df3fae0374a1ef30f1da8ac87e5b86694882c1cd14cf69dd56b3689b84160aeb5a', '7aa8380c566d543582b462355dc82deb8812d01513f0c4d779af11bf06b003cad9a0e79316b6fe587cc45d47b1c43ed8924b6e397a4294ec6f8aef3d93403dab', 'e8e27863fbf8bee56c1c6338646445d6167c0dfde67c8f3d9f6fb47a8aebbb5766e7c6357b9ff5a2ea60e66ec87fe39750d19e4479cfce3f6826ff3a0a9cd570', '1e811334bf425f4b43d4a7a72923cda3b0de937bffb79e28b77bf01a3ae71195015144ab4579ba35486d83bb7412da260710349c7219403c66666dedac3c0583', '128433bb842d8cafba6e3d5c46eb3a220100f402da2298198d842742afebad7829cbe85629d3d833581aaa60e8c9431316eab3dd0ed541a766b96ce37b30bc2a', '0b48699327e0aa9918c11eefe095e739468f363e7c5476d0d12d84de8321deeaed2c0fd2e106925b8848935e91ab23e12b70c09239376122e0d36b84b455b2fd', '7ef2e62c79c62cc8ea9389f624c614c7b5a0086b50e7e0fdec5130567af4793ef785bde90fbc6e54f6b5e5ead5c77d05d4c96eaf828a0829412c653257ac6229', '468e2aa659e9b35b97d5bac24f417bab88ffd9a4242cc8692206ac316bed0faca9de2eab82571ff2914afae01212d96215bf2227040385b289fb9ebd140b06da', '4b81db768fc5e8c120ead0153430d75c45df0393f933bf71da457c4c6755ec69e3d0f99e216cf2afc216436877bd1f148d952adb41b28f610579ce5503b17549', '58e9e0f30175ef2b88ea4ee9053a440bbcb7e3d16d94ace741fa719c3815bf176f2ce06e7f6e10f54efac521bfec84af91b4ca1b04c1dcb8e7d03e32ea38596a', '45e85224c9e50d36cf1b9062bf13a7764b11b73b8ae717f246d66c85ca4f0c31088b37a04f83ec3763d3fbb466acdc6ea683f36e9073fdbb22cf319dd58e9024', '927fa98f6a9e9de8173235bed1ff048eeacbe9b3e46bc8885435283d1c61e2a074703f4e8dd1191f5dedc2089738f2af1c89936e44d72ababa7c3a4f9359cd43', '2afe144b238287f4adce58daa21311cd0f0ae26487db8e256678606ab4e4e400a25ce747bb7c416e7eb7f5a97c280da450a69fe32a246846176f4d910de748ba', '6759b6a2cf566d1ebc2748dd318222722c00b2fba287cbb6e1da7d356d65c3d31fa0d9757dcdc1953b515fd6e190ba16180666506b6bf3a438ddc75815a86e57', 'd539f75eb9f7d30dac3987cc959e5c169b33b027f021e29479c8167d982ef36a7557fcf54cf31e6108f2c9df9d507eea90ff4fc49239e80b47c7d7605d6e5534', '25da3affe6289855a864ed7811e147f4bc8520a1f3c62791b0f3059265e9d2bb184522fa7411c532a68febfaaa50cb100b264abb349eec7302849f52cb265e09', '4fcb0ad6726e9035f5cc5c45d5a8830e09e493661f58a520dc2bba46f65052757037b356c410f26289293c7071b4b775fa12b1f2fae0ead76d8ca02123b3808f', '64acde0ca5323a8a259d012b44dc423592573f9401d4648434447103c49a267b73f3a3947decc7d236265bb4391ec4bd94e425d8d5041ce563cebf044b67ba38', 'd725c7c0a04b674beb0b089aa3bc7c97c2044e6304254795c7c61b07c55eaeb7eb6d737047e2b45ae4cd96843448aebeb194c4e834b3c9664fca726be0c5d890', 'bf6210ced2953b98f9b82f58c84f37a4206aedb2a85f52f9ce019b64d8425e63f60e09dbda36a0160fd9d35bbaffa8de04b15e1aea243603068de034ed9d2ea3', 'c9e4647355c337b78edaa909c95c1d619a121afc7c34ec7557a5b09d6b182430db152568b256c7315578bab5cde92278a378f0de495ff857078aabbee3ab3690', 'a869f86697738e6bbdd0748f6bf701d489a32719f89adb4cc7996fc4bb540fd3e1a4e5af001ca81e76a1cea03113778f9f16c3627b8185a2db6c6ffca8a177f4', '29076654d718d92d0a52942c18ca5b9f6891dc1cde7f12fed60ac9d67c5ed1689a9696f6db786f89e9b7a0499f97574365035ee37f8b7d444a2460f7774f00dd', '85c902a3c3e39e6e233ba1699b472b70489a44564cb5987893afdf956350be736d3b0478c5df62e9e0f6397d361ca1ae04d5e3b8557f7ca0c1d1ad3c82b973f4', '826f5436ab916daa63990daa4153aa848ccf90230eecd8b86a1de836656685752e39f8b41561bb07c39c9e40056e92dbb474ef432bf0f1617a460a7a90c51dee', 'd4dba42e273affc76b7d1fff4f91cc37b7a23869bd75583cdb70a3ffdc5c58bcc71c32f591721b59e2358542af0be90f8137e4cbbc042e25b76e7f1380a65812', 'c4edd8ab085d0ee366856a48cb83b09dfada84e99b2d9b2a4f909986bc78cf4abd63e2ae893e0535362b27475f292ece70a6c070bc6a927cd924ad013b311caa', '44c51530b472a040413e18ce80239a240fe3c312c7625b98cbbe74f3aafa1c60f1489b689478b7954c815f8cec382e796b7344cd8f3628ae7b776231cf4f5384', '23c81e80ce0350f7b95075f03d2381a1aea6d13cddf111ea8110891e2e7086ecc69f43e66393b62ed5ee2ad6e74bf0c91239c5bad6044cea2812002ef0b876ea', '4ca1353f26ad12589100ebc5d44801816741a77ebfb19e0f2b9be97407f7ae10e192bb6b9d34914a637cd1fa5c49b362bfeaab697d758e5de3d7e0637c973727', '44bd1dd24b438b95d4085ceba4203b74ecbf0baa6008bce817f4399c3e3d733d7a087ed26a85504cb75adc2656a5822779be0806be2032a56f2ae3cfee9e4aa1', '608737b1aa1574a61351c972b4599a598190e1ef0282330c667805a8587707cc0b26903360472e19b53a60925e67249bc87dc0b907b51a5213685455bc8c3df4', '08e0e133ffbc775f9a8b08e7409fbf9e5fa83dfc0adbefb8408f28f043e6c57dc8128cd0d159f27d24631b3df54f0ed26c177ab908cdeb081fb0503a3bf76a62', 'fa55166ae9de2a6ca9c1cc66097821fa3d277956196c540f6e64aa4d75f887d9610521dcdfd2a2a579edf720353feec8067848a62edcb71d262724175d04929f', '896941de4316b1a784a8519ee4c31fdb63602aa529a1285cf81429c87c79d4d8828c5971194f884db7d675f4f64d42dfbe6c8b8f273e980122757d4ee09e91e9', '8c1d5b553d6457648c5fb390e10f402492336bf1752ab89ea67dc8d20840b0a8f6db5d8fbb18a6e8a56e62b220888720975df86c270c879708923c0ce5fc6fee', '264a9ad4f673b591e24d127be855934b3cc35bce89dbc53e2f068418b0a941b59d62d406ff816c182795f98a1d5f62fb160c7d03eea09a36ce615fae3c898050', 'ad5012241bbf11ec772ad0d00b77b2ed9f6789cf8a67ff3575e5226b0b1c6c6d097e5fa05fd48ab40659b2712c1f721cc80b206d10d6c56a8f0f1281db254552', '42fd2268e0a01f33768f55d10b11410641648a1e627e43d1e7ac5e066446a2f07c5ff22ba0749f150f41dd01cc90230f6fd3bd3e205a826702f68db1f530dadf', '67115049d6fb02b7399e73296d0533865b36adfc481a1e420d4ed384ceda596751bbea39709edcf9718489bab95faa1a21e89c00311d4d5a0d7bc84f514f26ed', 'f341ba3ec6df033dcaf0d3a8778ccbdce9408426fce2e97dfef529514f4f331caf384fb0828c3bd39aa1e379a8af3e39d838b350b7d8605751f34ca4024409f8', 'fa4c46c9a107ac1346ffa3cb8b30a9162bce792665d674400f4383c5f683fb062e3b13afe1382bd655308f1514db83e3e369cdfff72338b97493abebabbfb719', '9101346e190dd0e8f3fff68e9023f55aa657d71710e80380ebfb3bf4a093d3ef44f3097e5983049304b1048233e9b399fe512d2856893ee201ddd030ea8e06a8', '4e9c6150d09367c92a617477cfe98818d39db8e5f32311e9c67d17a5a02c20d1c4d884f98f60aa6be3bdf4dbd6b48dde755cc2098744f79fa5484ecf5520ae7f', '8642c3bc162ac445c8fd7bed403bfe0dd657dbfcb7f979b57580ab96159ce6ff612fa51e08481d89da782e981eedcbfb2522ccfff245726544330194c07a1717', '346afb577fcd8eaee4202ddeb8d7e73610e7c2cfc57e9c6626f61e05eb4361d02939c581f119345ca38710a6535fd12bd0384fec6b3764e760e9a6736660ec6f', '074da8a90f3db7e72072e8c16cbbf43c4231e603fe0a7503891cec6f7aa29b2238bca9008075959297ff406337e3d30c7188f44ab04490bad127979a7b98b088', '3ebac333cfa50b6ed33eeb5f37b46b5e31e2fd4af8ef11de3c9a72370e6abe18feefde25d20942578ccbab553f8fb16d190a5d28b729459b3382c172ebc18ba6', 'd05f26a96fd7f9f1091b460a9a55689263ad3256e0be781e9bd7a99050c16fe3707a7feb7f05331fd013757c63a792ea55374a992e447aa96a9f73428c60be1c', 'b714a57d0ebad5fa792b4a0c83af943b690157fe0780b068e1520bd72025bd1eb62d7852ec937394ea335cd83341481d7522f50b663777ae69786ae29c622c6a', '91f7a98cbad99f6e91014cae50076cab5b8c6a5c58c5858bf2d91102501b43ff31dc73e7723964972371c009bd72f2a795f74a8cb6ae9c50e8970631d0cd2a93', 'fd38b957099419344feb7e371b0aeff55a09ef99fedc17fc41a4ea85e755a5883c947a881d02c29c91e101b3420ab6c81a6ea171984245a142b1d92bf540a8c7', '02d8390a6f7045650dda88d41b0fe79c9b864da60b0df5973d1282a8b6f82a56afce5c44d94bf192b2358f9954e09ac7523c2f65a70249b2e7a7cc02da700f8e', 'a78e05af0126a939666c36a627efae721eee96be180b3794dcd60e4bceb41fa89f2d10dcdbef9382a90cd4383870d360aa3a71da027dd86ecdad5724a094c9e4', 'f020f03ba9f2cf28206223bc62421d72b7fe3c9e81e6b65aba7d760fc517d9bde64a82be98cd6ae48f13fd504008bdcc464a588c97ee17dfd783602ca69fd351', '6001f080a74f916581324eea8809b16b82b65ec6836f8c01238a365d0f640e461d6acf2288dd05c9e5bf6e49edd2ffb52edef2f6018dfea19ab9c8b3f12a06ca', '29894e9432aeb736623a2d753dfe76f89310b301c5ea4e33e0ab2e706ff3daa51c955137299428af402ebbd3e6fc21105234616fefec9703e910686e33eceea4', 'bbc9bbe8f52c4e369cf314019054363186e7ca2f3912b926ff28f00dfb15a95c70fb8a88d82da465f657381056cbef51922eb956804042d5f8709d4cc8e244c6', '88f2adfbdc29c83694619a42fb23e9ed172c48bac2c72f0c966172ff4906ecdac482b11f8757536c64382ce5f210bdc3d49c84bf44348fea50ce3d710a7d9383', '65c544b2d7d7d28ae51611e96c9515cdc11bd4f00d4d96e0273c45af09ad925e7e3a01e5036d1533b59db1ceac1f145ccbe8fcd43c1e027f6aca957e67de0274', 'abd41a53271f5c4c8356a97489a0f4418877d67937f2fdb829b4b71eaf64c72db3a821bb91f270d3e01d2da112d12c9ca3c6d2964635f18d989dfaf6bf8fdeb7', 'c2d11c45906c48e254665d0693d843134c5365e134ba487c8ef3da0584ca566f537092c89993ad4071d3fe17d75a513f95d8be218ccf41226ce0fac1cf3947ac', '05488f64fb8bd8b2b3bcfb99925525aafbae1b1262d3ecc1f4176761b137ee3bbc9769f28a6d13a3181291083fa3b39c0702db5679837be353472301a1f5e318', '95792f73d843ff4ccc62c53da8c58db48f56e22c0f38aa0ac4b0275e3a305a3a812425efd2d6203aa4a35c7732e4712c46ff5d38c933eab5ce286cee4b85538b', 'b39b004b6c12c0635e51487926623f18f0f5c52eaa81df6a8e3b64398ce020ae49c097b164c734aa851c1e4ca1dbaf1e23947dfdae1257522243e720951e8862', '6891720082ff1885fc095767a2114a2322f326ce48af92453ea76d57c99c2aad7d0dcbd9cb80d36007913209d14051947b026acfbeb7ea8078df4f9a576fbfc9', '93351dad07711cf9501e6e565025a6414da57f52260a3fb1f30aa3bbd1d9318b063305c203c68f93b2a6555b574c02a836ced1b5acc765d8047c033446e19616', '9ea4e43207d9f5a10c32608e782687d177107699cf9dfc9faedba09a477c3f6b8bc1677a0b17c70f94c3f9f8a857aa63cfaccb4a2c0ddd9373de7ac0eef6966f', 'b51db0b7a06dd6b1721a0362b89d6ede3613bf03f7bf4efa5444cfe7fec06c7cbc2e848f53eff793785594d302564551d751c70f033b3f9cabd7f795b205f3a5', 'f551370d4659c0f85253c345a8a80ea3e98e41dc61fd5ee9a77982c2586ce5847d76aebff3e0a63c5b5ac9376baf65abbb15f0f5d33b6b0e02ca9fdb2f1d5fcf', '324b9f33d41c2fae485c0150e695832ed4f885f5df8d0beff39a982fb9198175cc3211d06f46f9fed0a39338c9cec971b1f7d0568008823f3ac0b588ec8f17ce', '6d27e580c4f673b24ec4ffe12d8f6c4e15897bdba0628627930b267aa0da0f66e2ae143ae1eef11e246c85b15d0c17b06df77ab9b13ea812514175779721c915']
R=[]
S=[]
n=ZZ('FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123',16)
for i in range(100):
r, s = int(sigs[i][:64], 16), int(sigs[i][64:], 16)
R.append(r+s)
S.append(s)
M=Matrix(ZZ,102,102)
for i in range(100):
M[i,i]=n
for i in range(100):
M[100,i]=R[i]
M[101,i]=S[i]
M[100,100]=1
M[101,101]=2^250
res=M.BKZ(blocksize=30)
for i in res:
if i[-1] == 2^250:
print(i[-2])
# 399554059433875376054790320976494104539757595501141010535012224082738919470