“鹏云杯”第十二届山东省大学生网络安全技能大赛 -- Crypto -- WriteUp

news/2025/9/27 21:32:55/文章来源:https://www.cnblogs.com/chen-xing-zzu/p/19115696

“鹏云杯”第十二届山东省大学生网络安全技能大赛 -- Crypto -- WriteUp

rsaaa

task

from Crypto.Util.number import *
# from flag import flag
flag = b'flag{test}'
nbit = 256p = getPrime(int(nbit))
q = getPrime(int(nbit))
n = p * q
t = 4 
phi = (p**4-1) * (q**4-1)
print(pow(2, phi, n))
d = getPrime(int(0.9*nbit)) # d.bit_length() = 230
e = inverse(d, phi)assert b"flag{" in flagc = pow(bytes_to_long(flag), e, n)
print("c = ", c)
print("n = ", n)
print("e = ", e)
"""
c =  4569479985227351005063785995135067032720378517762895932536659766750620715910605148533244779487921315047171013575610160508152407529266889273867903198797261
n =  4886488210976342084709096740163565218271041981736454979038282347346782586289498952728993072164156014308360739234075655553608312787941314479273226321644139
e =  69226245919249557284362852197482448692961051575353210229155811272280423133461036546714805862880491826820998627526504053578014404131806296413582035968459012627551356400980693085358304615504234701685438459878813948020276726029476169237998655600278740940333141714850818687244699016224065398835277355085190021649464175896949882797374785669601481278636634767170296279707462651980061069176263757678901169598571771064631589157944694386675873019622753613139854047148807223799604198162775252510345809461265433420840521382586775251192251617135265179686326411651203242167525116012981497530813723052998392487942518359093767791
"""

analysis

\[phi=(p^4-1)(q^4-1)≈p^4q^4=n^4;e \cdot d=k \cdot phi + 1\rightarrow {e \over phi} = {k \over d} + {1 \over d \cdot phi}\\ \rightarrow |{e \over n^4}-{k \over d}|≈|{e \over phi} - {k \over d}|={1 \over d \cdot phi}({1 \over d \cdot phi} < {1 \over d \cdot(2d)}={1 \over 2d^2}) \rightarrow |x-{k \over d}|<{1 \over 2d^2} \rightarrow {k \over d}是{e \over n^4}的收敛项之一. \]

exp

# sage
from Crypto.Util.number import long_to_bytes
from sage.all import *c = 4569479985227351005063785995135067032720378517762895932536659766750620715910605148533244779487921315047171013575610160508152407529266889273867903198797261
n = 4886488210976342084709096740163565218271041981736454979038282347346782586289498952728993072164156014308360739234075655553608312787941314479273226321644139
e = 69226245919249557284362852197482448692961051575353210229155811272280423133461036546714805862880491826820998627526504053578014404131806296413582035968459012627551356400980693085358304615504234701685438459878813948020276726029476169237998655600278740940333141714850818687244699016224065398835277355085190021649464175896949882797374785669601481278636634767170296279707462651980061069176263757678901169598571771064631589157944694386675873019622753613139854047148807223799604198162775252510345809461265433420840521382586775251192251617135265179686326411651203242167525116012981497530813723052998392487942518359093767791cf = continued_fraction(Integer(e) / Integer(n ** 4))for i in range(1, len(cf)):d = cf.denominator(i)k = cf.numerator(i)if (e * d - 1) % k == 0:m = int(pow(c, d, n))flag = long_to_bytes(m)if flag.startswith(b'flag'):print(flag)exit(0)
# b'flag{fc3f4ce8dc3eaca8807812b8c0435cd4}'

ezcrypto

task

from Crypto.Util.number import *
import random, gmpy2
from flag import flagclass RSAEncryptor:def __init__(self):self.g = self.a = self.b = 0self.e = 65537self.factorGen()self.product()def factorGen(self):while True:self.g = getPrime(256)  while True:self.a = random.randrange(1 << 273, 1 << 274)if gmpy2.is_prime(2*self.g*self.a + 1):breakwhile True:self.b = random.randrange(1 << 273, 1 << 274)if gmpy2.is_prime(2*self.g*self.b + 1) and self.b != self.a:breakself.h = 2*self.g*self.a*self.b + self.a + self.bself.N = 2*self.g*self.h + 1returndef encrypt(self, msg_int):return int(gmpy2.powmod(msg_int, self.e, self.N))def product(self):m = bytes_to_long(flag)self.enc = self.encrypt(m)self.show()print(f'enc={self.enc}')def show(self):print(f"N={self.N}")print(f"e={self.e}")print(f"g={self.g}")RSAEncryptor()# N=27471366612277687007582969113484500296001065780066244888800712342807125394382681326213781865815461951298727242405665286291957769318403190235219727462190547340268057407480936794909750874545280586676586199139504945994789654115224950518297646992315179314766094156202525491469674180110591820099543752380512935927805722237181
# e=65537
# g=111684314954681193048509857146926361842347687090472066568935363273885037337811
# enc=12643371534391958135236095622827564261907624974618206428861944879376238094269846145595767463703827586815298891013812360542402349502974102836324041194817837979051818191875704215738686008582339520686043633518534916826599993931844826243220488649199690449278527396151017995036899907805560418507134336681609833081538329779248

analysis

\[g = getPrime(256);isPrime(2 * g*a+1);isPrime(2 * g * b + 1);h = 2 * g * a * b + a + b;isPrime(h) \\ N = 2 * g * h + 1 = 2 * g * (2 * g * a * b + a + b) + 1 = 4 * a * b * g ** 2 + 2 * g * a + 2 * g * b + 1 = (2 * g * a + 1) * (2 * g * b + 1)\\ \rightarrow phi=2*g*a*2*g*b=4abg^2\\ h = {N - 1 \over 2g};{h \over 2g}=ab + {a+b \over2g}((a + b).bit\_length() = 275 \and (2g).bit\_length() = 257\\ \]

exp

from Crypto.Util.number import *N = 27471366612277687007582969113484500296001065780066244888800712342807125394382681326213781865815461951298727242405665286291957769318403190235219727462190547340268057407480936794909750874545280586676586199139504945994789654115224950518297646992315179314766094156202525491469674180110591820099543752380512935927805722237181
e = 65537
g = 111684314954681193048509857146926361842347687090472066568935363273885037337811
enc = 12643371534391958135236095622827564261907624974618206428861944879376238094269846145595767463703827586815298891013812360542402349502974102836324041194817837979051818191875704215738686008582339520686043633518534916826599993931844826243220488649199690449278527396151017995036899907805560418507134336681609833081538329779248h = (N - 1) // (2 * g)
mask = 4 * g ** 2
temp = 180000 # 180000 is the smallest among the differences obtained from 100 tests.
while True:if temp % 10000 == 0:print(f"temp = {temp}")ab = h // (2 * g) - tempphi = mask * abif GCD(e, phi) == 1:d = inverse(e, phi)flag = long_to_bytes(pow(enc, d, N))if flag.startswith(b'flag'):print(f"Success, temp = {temp}")print(flag)breaktemp += 1
"""
temp = 180000
temp = 190000
temp = 200000
temp = 210000
Success, temp = 210328
b'flag{d39691fd3467e11c5c4443e65a93ab37}'
"""

hardcrypto

task

from sage.all import *
import random
import gmpy2
from Crypto.Util.number import *
from FLAG import flaga, nbits = 20, 1024
p, q = [getPrime(nbits // 2) for _ in range(2)]
n = p*q
evaluate_polynomial = lambda poly, x: sum(Zmod(n)(poly[i])*x**i for i in range(len(poly)))def task(tmp):def iter_k():k = random.randint(2, n-2)poly = [random.randint(2, n-2) for _ in range(a)]while True:k = evaluate_polynomial(poly, k)yield kgen = iter_k()out = list()for _ in range(a+3):x = [random.randint(2, n-2) for _ in range(3)]y = ZZ(evaluate_polynomial(x, tmp)*inverse_mod(1337*next(gen)+evaluate_polynomial(x, 1337), n) % n)out.append([x, y])return outtmp = random.randint(2, n-2)
out = task(tmp)
c = sum([FLAG[i]*pow(tmp, i+1, n) for i in range(len(FLAG))]) % n
with open("task.txt", "w", encoding="utf-8") as f:f.write(f"n = {n}\n")f.write(f"out = {out}\n")f.write(f"c = {c}\n")

analysis

\[p,q=getPrime(512);tmp \in [2, n - 2];c_0,c_1 \cdots c_{a-1} \in [2, n-2],poly(t)={\sum_{i=0}^{a-1}{x_it^i}(mod\ n)}\\ x_0,x_1,x_2 \in [2, n -2],x(t)=x_0+x_1\cdot t+x_2\cdot t ^ 2(mod\ n);k_0 \in [2, n-2];\{k_j\}:k_{j+1}=poly(k_j)(j≥0)\\ output_i=(x_i,y_i)(i \in [0, a+3));x(tmp)=x_0+x_1\cdot tmp + x_2 \cdot tmp^2\ mod \ n \rightarrow x(1337)=x_0+x_1\cdot 1337+x_2 \cdot 1337^2\\ D_i=1337\cdot k_j+x(1337)\ mod\ n;D_j^{-1}=inverse(D_j, n)\ mod\ n;y_i=x(tmp)\cdot D_j^{-1}\ mod\ n\\ FLAG=[f_0,f_1,\cdots,f_{m-1}](m = len(flag));c={\sum_{i=0}^{m-1}f_i \cdot tmp^{i+1}}\ mod\ n \]

\[\begin{aligned} &\text{1. k 序列与未知变量 tmp 的多项式绑定} \\ &\quad \text{加密中输出项 } (x_j,y_j) \text{ 满足:} \\ &\quad y_j = \frac{x_j(\mathrm{tmp})}{1337k_j + x_j(1337)} \mod n \\ &\quad \text{其中 } x_j(t)=x_{j0}+x_{j1}t+x_{j2}t^2 \text{(已知系数 } x_{j0},x_{j1},x_{j2} \text{),变形得:} \\ &\quad k_j = \frac{x_j(\mathrm{tmp}) \cdot y_j^{-1} - x_j(1337)}{1337} \mod n \\ &\quad \text{令 } s=\mathrm{tmp} \text{,则 } k_j=P_j(s) \text{(} P_j(s) \text{ 是 } \mathbb{Z}_n[s] \text{ 上的二次多项式,绑定 } k_j \text{ 与 } s \text{)。} \\ &\text{2. k 序列迭代的行列式为零条件} \\ &\quad k \text{ 序列由 20 次多项式 } \mathrm{poly}(t)=\sum_{i=0}^{20}c_it^i \text{ 迭代生成:} \\ &\quad k_{j+1} = \mathrm{poly}(k_j) \mod n \\ &\quad \text{对 21 个连续 } k_j \text{,构建 21×21 矩阵 } M \text{(第 } m \text{ 行: } [k_m^0,k_m^1,\dots,k_m^{19},-k_{m+1}] \text{),因线性方程组有非零解,故:} \\ &\quad \det(M) \equiv 0 \mod n \\ &\quad \text{当 } k_j=P_j(s) \text{ 时,} \det(M) \text{ 成为关于 } s \text{ 的多项式,且 } s=\mathrm{tmp} \text{ 是其根。} \\ &\text{3. 密文的线性有界结构} \\ &\quad \text{密文 } c \text{ 定义为:} \\ &\quad c = \sum_{i=0}^{m-1}\mathrm{FLAG}[i] \cdot \mathrm{tmp}^{i+1} \mod n \\ &\quad \text{其中 } 0 \leq \mathrm{FLAG}[i] < 128 \text{(ASCII 界),本质是关于 } \mathrm{FLAG}[i] \text{ 的线性同余方程。} \\ &\text{构建 } k_j \text{ 的多项式列表(ks)} \\ &\quad\quad k = ((f[0]+s*f[1]+s^{2}*f[2])/y - (f[0]+1337*f[1]+1337^{2}*f[2]))/1337 \\ &\quad\quad k_j=P_j(s) \text{,将每个 } k_j \text{ 表示为 } \mathbb{Z}_n[s] \text{ 上的多项式,存储为 ks 列表。} \\ &\text{生成含 tmp 根的行列式(dets)} \\ &\quad\quad M = [[ks[j]^{t} \text{ for } t \text{ in } 20] + [ks[j+1]] \text{ for } j \text{ in } i:i+21] \\ &\quad \det = M.\det() \\ &\quad\quad P_j(s) \text{ 构建矩阵,计算行列式得 } a(s),b(s) \text{,且 } a(\mathrm{tmp})=b(\mathrm{tmp})=0 \text{(tmp 是公共根)。} \\ &\text{多项式 GCD 恢复 tmp(sec)} \\ &\quad\quad a,b = b,a\%b \quad \text{(多项式欧几里得算法)} \\ &\quad b = b.\mathrm{monic}() \\ &\quad \mathrm{sec} = -b[0] \\ &\quad\quad \gcd(a(s),b(s)) \text{,得一次多项式 } b(s)=s + c \text{,故 } \mathrm{tmp}=-c \mod n \text{(sec=tmp)。} \\ &\text{解有界线性方程得 FLAG} \\ &\quad\quad \mathrm{solve\_bounded\_mod}(\mathrm{matrix}([\mathrm{pow}(\mathrm{sec},i+1,n)]), [c], [0]*nn, [128]*nn, n) \\ &\quad\quad [\mathrm{sec}^{1} \dots \mathrm{sec}^{nn}] \cdot [\mathrm{FLAG}[0],\dots] \equiv c \mod n \text{,利用 } 0 \leq \mathrm{FLAG}[i]<128 \text{ 约束求解,转 bytes 得 FLAG。} \end{aligned} \]

exp

参考项目地址:https://raw.githubusercontent.com/TheBlupper/linineq/main/linineq.py

n = 116453443011853420809668711972989061467167211131495671704601453130223740856216616625387720247530408092178973025350957602160993018233209418363808239513212341336780972586975651194279671865091218160787337196434882173525480077084380598378049942388559299462451640419676705001459757144162190308134698825233144897749
out = [[[16202202709219135129403535115561247399977089470249786010905831351050828035092071987394871461648564822458026821152636120958488848435033525506546247286831014711277437242458340909670993931079588744005442891819520597833821677064612826668557463116238537040729890498884207418044825228237556147770662118517249396692, 47158192188393792036761669055070121097565546581855822668072252508984969016382263782182156850329836251452643985099809550432223868546772450504191662191518730692714240908609895200745325500068798626407440315577361914722023760873813948922485169333094880559869204367802969251878550853540529173583403779243634588604, 73927625248528508727506689167602509318856827244269778113172507152170146136288370655984908451797113525661097527285151404494400219742279412758039840931298207297289963189499752714106040341865951763256712217026142058162694702333853392532178512115879867464597527114665801655708081605280368496958303402491704600584], 51864937236600707435768724852033314476477669961909044676208972957376070847060463289033257762974094414335257339672814328031654081615000138763180508775159261415280699906486659381347902637899134495420905443588586685373955079581768218221599703763526026715818855966586436002113845929747799383351582831788974684309], [[76660081674398666486584942779101568537781567835048243200366783876578342312616552543205070179657417015739902386359040672041175431121020272986018163421967823711107123849151658480528540366899247281616589424888470708608814898560458154865111940404026802158839859641189598832996747278157093816109048662454468912160, 1550621862504567026307313040767278992903174727197013334431402456887715004704904838378685049291470526410012581399663690225444150417069303915784004191323464391537179401935217589867923029857161418345741981218408267569169003539739969534780094604962003844056183595572442367015432434725636136725615624799257902273, 103691161388965891083511540669629096824387462760126408943976022861373238317933691591174139523404721975728011024858334027473690640406561219563274271093840474461469259526967964255745038057045630535053525992843913849389129389072869175700049875888365816550001926564760567441482021173615885265314532717971144072436], 109329053238859460773880062949215739009203387729922979347055536285547838704417526391639869616198654308047577694010136928410905723093613603544877903567932375204723670941029221665521462713045260242030401858875927809422739968390490826323380441631539689517736215505859519765548497286619630116183058582611042246369], [[71063016763458595308299823282949599711073497316738141366458428416293703474410115543754719076600805570495280158181661129905865799265154758490336848790188021588498564326506949982264181744818700407078613075128779171244675261648701621756233316396918992280225757365041602077620352961516860555234526519394145894364, 23863439320217626123215351380712215173387323691232306523327117878196112193569139126522868475556962757564928654130193953387811481798132686615403042128907850885883159611158548134731593454445238505694690449348358844808990179024381862701845930141864411493631874194084507235015918807570913763807927369718097151946, 46251623654053625041578155939703706925735452958297550237506863855950328883002724051798288001661218065735630192853387792469530202446917120783018445953564979337983801098259807004584214729197528434003672127054562439159692479917116252747733825708851436337379005199328150957719092599012226530171519296134291429333], 20541957714569855147881414533905907273787690483455185474272189088938269558471165254257080203616264526925365808122347083289422058206188461155931629076858009969097667060189437555527196021328106475204575577373765629375684095790090349124112155499959570226620986961970988796036454698434478381954820370037569562472], [[98385931177868144142678164342062942215233773659024552802654736148819134551637839519131334802942455514658537888131861963033926836286475693004774728456880024273347422082494085967140208928854639606580843488642010350078022741244710730304325202831477423683579809643530241665937118708439517195704884588072355905101, 52030472807125630678734941720943434904143676958020247525641038088243451004204368782938487192846576646526898193363769064698983438260986327767236384812288843877965545577660348084036940894862054520872909856540852035593085378101213617465247653165469372693594303331621800145452735678550174525009508373083678236867, 523602719930901858034006942504408719492750487205610920603144892358620658846833982916593128470038014187835317445608773115508746960703250186344552080263934007493216011455463858204088115743769083483400967794016684681300107139953334133202249138776349591323448833792666183925012146892747230741982710903609016183], 6377754347661396326484976917010096465402925014487130080479060605772290246532818618279733498000478916745740197158609313660600109416841195019247526091819829977871311602310585718529247756426968246127354966377582301469585132751663969954262276170227847149800966222485501530912502680987139929825764701310072447082], [[63713986633703180945386990707034396380202538382646006287838380941357338427962945657623575076925716246830754960227963626069732626380518247686255507220357279453758720304894361923782999203731985870918476688036041969022102596141517849311448943605587892693782937620569556646991079148216436245862101539122191287088, 13516250802814386395615976788387731838762508525757950259749120854718029460905574163896572674089811534332609376255195318758274528053060434017198007356624155984629501743779102066782585720728654524723424183777655125739048445522545642838215340378264648174214613386656000604803585003123483994347041234741318401963, 91187462570905131283675677817201245879573407014400584027302689925961038419236390332549570240123651747799599705807962117059962510260284863829440640428471913198948479858891961124836824313982922941012782374136477712159885030847887512274018070436306844689346683495665492720757193132986254598095474796073403286995], 88084205909536195407761037198987227874929535389056463375798731270813436904649944359831649630423975694404423243775921203442749171785307321040635069860846458999378244276149248514036824070990838731769180098075159145659061106276976710921700962553832892516094969449087052993257429191638538368344805857163808452608], [[74060250865842632775428195628136477482448881190154714303324134536345103912307941566519478314739220283454821722467966615712580967994325949550266143745591738143240080269968394042280307559609549846121346156444972160632606257525829164779309147673622003842414222080079662181143453950800435445794673363976898020292, 26876038309085076802377748933508522636163342933476196219565640667421011688912237122495400916162010874498216848398573810878823231799956846807095503869274899324219546114460725593787609737005548838047611130806761626610434224203364132676034508351679550727276781022279759075732190533081039090485705633190476895133, 103860811322173087722752868026604435140543309367362368560119023346809772029268048442763277920432022639236701189708836723229286715421341483391115273957369303298017121219611217931369293637411560765870255581345220137889069259901877130567083392110418696809931894826980595040365378700330701378625315364070102882092], 83900149684641739691308786240747642200537694434353604597504025385188686894110862784784768731153845058212503936401653163017111078996233424719530433742644244682297817006086158415395173142680053609429803507604732461265452486738007777533155789560909685236025998598486469161365439204397051609762831094139102903558], [[33503964755853596982393509144972276102828982893555637730713564537878298656457066559495335483254480224763433167363214899357768494231067072330155586424380366393546784884092075386143329258133807327590904190298400227073468513326817411078639258328877959587389659147590680348868768306363862043912292780208209623160, 61372437615540357086871438778687859693798377847867436866638141709007030665269843816323371445551818189739631539450922944660847419570581110103315242988304735933212419899257780911205571163690475106663647971288005510167592252250028014859266302219884779073224250585755619205376950906593854148859955806183207782275, 15045986477779185426338881734600203872490441885383620056237618890705007261090478241664842680042930429564381076205276342301822785321070262294476287838763444667942293900124090202134959425508379894530817325536462674973968695968319872356222774463169270393348312132220110036695978378699408929756581093445665539588], 84171172794611978008710129733225515546938473935658366760844276185302462698951103041786436171446483264651751410466911019512923082450118247319009605542974534858000268383278612008587204166384141512225134976143474116233901757587313461170214694777623513050325620439056734143325608085693899677613283964681604024877], [[84014495295458989677800074579048346113228196056204095834481029625685071820226052353269136771804260214636613229924063194707894808953948886246274313297543638321965202795984114972515489438215567788898139402787195026711318030699006230882919112829103260514132346738902142746395236139796297261907991996506783682402, 35209492864712575850366509330327883776677132244002277616527162301172787754086756582119424771615136618135421861159598082849570888147404745737962687653730215073449193456829537165526480663128146105892988997451680239336153022788741107619293417526753592025979195150496445574631334377462620486132684070314587854095, 93383602542222857480948859883431464392536936251509895433416790622672438304153041395979254957730226458009284903094015842760169075971268193372301985676575189055749764696059074648349276308360074125847209817399902053559051980785517731188589447165654171274013421949347392896724299322715090627260622220993051227421], 60281682754290411353797076978463456433355170181039483646232731869017116831291977231284257134256823272806027797262878077923433860474289707204870405706540812566365712206137836013417642729251459131073326743249458525387556276128631714528838378354065279853609977409219279388600986196894293570548252071023980606354], [[107198854768705164999041562918966691673136503105907526944651262807243220742309176161745717023532909132979868727155703251550161821155809658921928263889141617768562567192388365481319158080996756262643984260136139294495459145476910942506673617102062488251988434905125878111452695834226573738514028315411853542896, 30739249460985953633998149910058549298936958701826310950439470319557772499858308612868326324339664441929916676093864347062844603896214981787147212803753224671478196457265239483494487253212013459673701739982164205699366175690468526104017546271558895093788378220763164237604195306763331674548168438750182579367, 56830129469009412583652636831766750545718963925722773023231959321709591329545008751739336358784807725273889914726974823663966537067889715805072460657347682057224805691697945351465061187188799934749941364579445789559031327884002611502566122341711031553352217548797141065889572646791646246650800626812704021831], 49246941629578553872980014982834959225653051422367381290482323319159222235133086898918291527014843929780992554066305023649676524013157879440226333629599733913388142456254413399325771330418140867745197927809314890811795163799140130286385642189554961909182486493954220678231532344051090327023015411977343117537], [[105346457873061006390983529088104863157218894276125716892732197077806217052468646755940646995057710117367018962533642146941681095162233104225101028118327138227301141036392834354316767549125651957904266431689443834379189628838455523142094675717455084464575621637716348073283410243272496328357262803909284592675, 112833281928046755492945805061331428184416166122958033002717338734084922299843353761674827655894109957002752856648568327745209873271876138969282679545132993667321813896224719476020215141058510120055738396966588325959782875510756753675850138041962875665404529319996495407817970365176523584303305563261522515606, 86330183898163350720074630319408764026964390775266146623738670377906546395879294798846388138243958057320749031597721437108920775183959157703153587133135851049900508206584783966160765856750008923807082351620350282323297925238292632626251368596161668065141054312174867005317865278541843428834718408702529808578], 89543894060533728296784056895294537201496633628767141045195928580688549482791819687684487388456723735237065523264675337824298295244631311834754890517856127377074167780696687486495106243951375763319814158905817090095412990961773439617478247919710494238221619773259087056917943631113066880419353883994108994392], [[73488459629807623514515187630831255583171611094539000854636177608635325116747334572256715347807243394789178040087223646460242222591574563703476232166759472670729313294898052413258927335874816063617689757742235912136477460693785027371078351455025322808400457313530693482254103153897091547806041361687275034774, 89656863753742058639251637482405817186283635417917683354537330469456595132541759782496145607881036883465405234272137814981648111987240116845092010112309854618752437550293621979102922657436349620761400027813262644764805920663365754936771607328980030792697819973151387235931343997383642801489332703678557182224, 24237530548438722139532450304550595904565514428160345966378160574172004957720851274694508143653927619142000674819333452320819649468334498097222579561527084634833518604172321910345901723595569348633914624576839611460355563602665974758737294352058905312519500840371026509656342371664153378926764856303237351996], 3056332146255267630995970107844135532474090730540024465995354436397979408855899583937610501389647972002282027483423004895115779123938842115270476325458498847580649918547313079511416396928731116623307040058008802917862406913680081505066067649933245412996381583148273608519925074257978193758467693046091373262], [[104252958148223714319033323795910539457607379001670787437825014313845028386043979342525423253657296267418528101280256883331675896987672557157230317902790980648841537926046888267253264584413250432326863534430998256593368650188600652150151174605766721208827496659067675598162476002353526226499477050631859902117, 8276927707823582509500270372377047948792290197424492900116983596113736956839983927792224870984831520182250219182036651516421076883938266883937554618575953453431450308396875920883719746646660269359721620253550848587935645083992293455783891840657961820209244839046926863133745572649519509362074060721901210633, 29873758120614540050399222624704028409396687860850861568717335768913330588392424983170746143131745150189460827877850200657344900322661283910589638972157704438354522450845808785360392362003889063276015579896607620563435197786450529304721188617740835032705528440300106382510252789100436003075485743727110145581], 96571057418329280374840352385052732394003352675623318528364626883292434836162783375795595655783060256404717621279762473838578576979550228191552900399428054277432544348633216904972819047024619503970980283025119364983622874091709494042063485112287362037427867063239046862280405184051909556601888699782113104402], [[81572811686104824617910213941113387233985332530256460418345457404644532328477084335659435778818281299640299671198612930806103609868016641965753541373642449064785106882084606432865809479793200086907482068115558467801682581801097207353247137419715718074226662540089546761286612714879505526931170599689661852976, 96289728256703036186477082308986392211181423355590099186292170812892952451999622842773830674826243105238399764479389006598672478951737384761780248967764730430278207363724292631934086129875520650540367085886511363732684111935714119824437755993351945005571624635160208076185769117802565917035622770646020317496, 76766469131080519832107912987769306493423225824012814798361418493228349072330142629342196012398100251761138584641161853838853585086649377187536868404308315735992717520373477443063732059762650236839792309765750183896242273253140228409279033181326278290474224360344291750030458266032378954956536091033088981249], 64523554489004578649130086419464063559679518325365683584570125200094905465607528688378646031486230865134951101752400042086872210301338786422807454516302374357315879648631356510427882030263203410264068736088259844423782328462929625683323509051879226906432662952697363065494749166318079132947856993696440597182], [[9833122372699739238089806382828382475447452794885627239736279850623061624411579316960650675653458522319550656076804121793197894109655920863863474715492234644111723897461909938301355208849190576661915745231826015350348298109401750470561865613734968365963884860030717120361487568325542263942204201007581908498, 76119976970224787608516117626746719733512731814737110253574374417827643038438694347547545959929200257397650562880643684533262842320435582573398063190956508557692135660111240776597192413569717588006745267258554096302440458337357795347758699938013204229080889782785189420346025896422790035470319392385549593927, 73461178014175550565542245441879775888369865815716197999222537034152882115075410778284307626260908722269646660577747834214069892092322761573019296902000768218681353288467451487128656353869640229811786836682269661191076332129044157530585993014705523286722450785736796649832467116745915733346029714295906637919], 77935294521715753192317134897036574530777246092207085687149222589907436390575638974856947641113417694124248973308841930055966630705961881144190655509760089633026395264472304707191775479474542054796492748315575392764891396416105528520525686851163747987404722141975729892216481643149531783057298901083984565243], [[757065886387394850996953218303831607013491482542289767775064443509921231044204369355351401447795849215749976298498723632711120351553847472573282397478864429674522960626034830583676459177292125910448302445765412500989701027034877007981125224357106206237464088773851747292192250876938286357381923328588167316, 97570067367367821826802002917869227855171921905379989246266812597000817024385554085535630955146730210832756301331147489521591337218478512257944112883208214000368314730877692373565760809196681952147707934892506714516506838529754080111510032511869805985868067361838154087959008017789609873724428789435093681221, 12740384753090801118403951090063877575992465665496574111200493781475788420731872827817728052620398528976026588669807221206874694997062894777951157089435371431758074716191515753986228570240965626443470053861501473013576591988001796871039426701208791074545907673103747925744432828250929242772084413234117863066], 89847282116363233375974487315850965811811448330510420823700594945407974123592498338763644936382057498441170840174119506202931301738021582699675039044258187574588789755574083056136864541860912157613010910603641289416200057772772204022847611117240453760422898518243733409285291966151360375337627325897220841526], [[65500640935770089156543095700546546175851987421798701889904241268923626233724569043741697411446342729627702127128000446027687531922750512642450125540122901439618418887176392774808639645370861806069223540527569471000520279504140461393078727379837239883143622591920794968126204494809102073375910319543609916704, 24344405110571547879873375063855575759367907985093165587872091925441977102689822849429110033665206613088838668299589164782919381688370602608147678226303729386739248398013505147202577594356520647518116282538552835157022485365143292063824763697678487921084524389405045091005256844089626732401923562732738727925, 90420786817703357293164232263002730804403474815464257968630374995199701533376719106000457997268245958796241358255398038017940114625497480060664934071834968452058705868249589226553372055661799474451508418043309462145288937348790870053523546820993623112821216603251802931920545081531236900637849718781130810718], 14636158135669663463735271814557001961580029550897536556481653930410492444042307505050501592781622619831839768651396506010305808212466856537687697707882554218809639875739616770067966896056202920860208099882232761347400093183849178585777123038169835812651534695963898466682478219823555319689858231812199594497], [[67995704135751247973959398435744798031133745367576090038203531623157412024431568243526996240192072791872436201920334136682433215545788854064539811045018453554173341854582348783086779873558389887845441557320342163178035745237321526875786944860596283319326087354844093371463835075465250235199626099341082043983, 4769547381458256256169257454357918986956842065500996073949647694341976191821781911976054985865043094831832484117379645733301892320572802024523432515785589561802487823001024849828445984976652075800059188675351121057345660068397413321616938880281495910282360098750491678578553487609501255727208270143231114108, 31388551852035156389924676545579150716102934737385796501460479409921248306467805387460807855124235740788437822504840015727195718234271455353103281784835098870718175588124288255888278450555772458794373125609863453458783012868359594759175800467192337243101181020068989513733865565869010024148094470172059229843], 26797198108478294580563826214769535187350319440016076982523496482983736565285027237974174825346849993356126888340942399711626822426480314604277754161864647974361937878252896715050184883285840998485876116713482668391344951024434371805593350863955020708625827368516195137889475135285446702654211695711663723843], [[79264306485749175473736520122686421465831186493822344778033531242612486525656088340358276995487614854543429227766071964459270789601807986929934260550897390753339637341874749016626288269387897792082332333290309553472736797934030725457971209940025781383072248618218247420019422453008564758705484192516868930927, 106189180071125356863036776279180014841652337431005857417739945205372004721795938632884522422148981271805076758412959840322253794356116318394491430134534571938380428396521598986822271752680860849743121744975336705659216645541050286068171029412310009000987210132718300354900251836771519251328107850292337176080, 71512443717466691999630501640421888117915211403926419111323037029359929138546164344940868737874772929466734826853063480112852097799432698902806575517708530444435192717313916928643753305963596356891183942684741323530929320545789704364091418995112737392693496639279112130323230310001983178675059019254267128371], 116308817457919628702078025138503340125394047287148313150185641213662289171409954106035640559722037015266164316871048525152624814096490242176903189252692383906990713743411271563990145433168622974333193359992221054066223941933075953543151748133987729836810523253668196299266293714928621119287232209210080587350], [[3994016470078720829863563387424487233371149590262910119126403742845045990974817921599826929641810898629903480748987970304639950544276455096010806982713739733860618928562568008759715401032340809581366949451905904024983905770128524082172249577314872047783921093565578632103714452415312969624614778552986610419, 50381589841849569448516884322451367260843087358951475993894941077290660062666224911460715877208380125285416700743563762293876989442525277972956191549540224929671849265985818218036342557721530971957708960477850494144159138307071732580848260685848409968079991960947823892492361566205494618181545746428349885442, 5072663298448312796371138115085862389880256380560476681984388082502355761086226463059253103877431070699458959488265398239726155838144564253281502741808840352379086925360024790420790231637090500634659503677521738853982386826478764148809643762366851264475616266049526021644249374554563951232049682797804376096], 56596400795113585363403923076660086978862899328594790118295309482156200702587738117400215653063532514022219802426563616467898227525145533644571123646619673573868805541339611866385463221646884975158894725383115995445498577214431152172446342970970719284058006316533597432323566594926830963490807691105840684334], [[89924572911690288644365857507472509171900000287210201910638028038406371868624484036906823123463456276957443046052324544341670862660625430436438374667983229763962645122089260846010799671132595612268981809937823727087574256778345092640814129324199665060503811017879272607154969791604764932581041076016038812189, 43761463949002008241389930019922211726010574358175925907609825881050877960579501365324056904668877042379710596701156954156224346359009530946975914390732211395342011365839850745861307544073900159078389128913914451612111369127324911027396306901652691215975779416018783745449379587963243830729240378748884967147, 24356619460601057590183798743556067174480304908570389112751124941171463302475276714159033540817800544469328092070967493395311505053037303979223425750971723750262930702614985347665509027269777107159592254383065715131821476320913689828395951985804213809936675614572577646204642199362157757697058247719975551248], 53675314922130844227520156681574791722183549954501459203529771105728854639314292834848516445545264673230567109008296107286917660394372370901835530317504212323585522239946684091865724048212226170757090601309891903588018637537616074454363475935321671759538436023362432161971799828933568558808101781196097551362], [[92506878758268494106102257663783742111554925577165210949592323939488948819517456377096079152422852321712850953364427688037147349206956227408211010996973229399826970620780280637925922328062580767827442085796097722758396313018815773442235727271074211932340776855527863559147537582975111594896263366054525623017, 11738660646529747306241390123341219911976301464233649849768464281951625434353311207147307414119545664434337766221575479716433943441152606727472060261496173797009394497700864338944690925574460679945176209765618901671857111180894170631652437850099768925591261050813342074890884974438391263508465364939540539420, 114389424796932197942297592758213506099293098776213073622733283500974920219408238670695296048436589977114436246632634315361831553610466322473526758533355618326913357113944505087772809228644215578802775070040166153395077981124353698819011262169477426981280321887197527958157776604457206669976424481676091580392], 19468609391993760939275404556764073216989777766897330082996905160896969297512971262049070993022816789970926482229517170305734354541761217585512567318972212730851827570346628679844085800471398379140766805940786882922145621049354303498583489511048535082717292847134533844386849210975995838043852970606967554503], [[23234091750787883553682215212188353694656954570146197597422166528883316585894869961369447565811370679538808775297815635022172566026731633567455124105836043849038738103459335844419679057792840224161094399505315230741224154159202616930080019075231590889669985692174162773710725395000751240504946781906844343542, 49143821735647786255200096595145808778133894242967820418598778356625431390744392467037074688538829519605201819377318838732263345248537848537263731015346823959742417519567726895470261121834345110499174235599069644365860643188163129931896053837101660776106668688928118258436592661190433808903948332232416603755, 77929173140343853945157515881628939446027062396062114615528837729640271407415759789540090484501709636872048975582503252083572972958312707405751495410134958696433411208659382678749404908812843861293579837315909994737336050900265506130596253389376773755531270366122754942216765127507054000815136788308896917771], 65467525683670938099854080106567484300607591518830131118361262856876027675726694250083030400128607066483282462859803424288045703755111039460451962292255962308808438044463057732987151825677551106968898239633147533102756383335169534539768636656778333632471953970415633001685446639031149440838738131247327795818], [[61061250276159257300972298048875266803492888227239327855597374538718504171237877181850542902967637656128745536708886692076515855671228056777134673999012305163948151304483687771202886330397404834382721832951960745638437750534468839084551714019069781550263901790919014301560344856200523537776598727541197576990, 70011524138299994971789939916219514471321358539251845830267734157327560757521525963457447635694543212339715302658998988623119213602425292656902882358243143527932180266360386272953237777937883238550081176218645118763837899504098081143769927501660543976121973769053377849636058839323785497688561362422433165034, 58753995889420858681699008127901134737936242336500387704238442025471579202628392723723004733152454734385025933123958699852284716013186554188768536576516075436705211661215647742993663494419208478444161398761644552066584622173751479067293310208099806843787781036157553251877245422055337106667988202320311123051], 22651826751802020100933700735039219560856029120327027458549001046961779104040803444819616535627370245021806833936208658436578424280891973621013831763904001833391103936157956995265535161913926610134973189621687227028743513583768437743923590050833114893969212835528691231524912595308064524967002241320811935927]]
enc = 84577236454971991939792029780215123348491355727867721348641862256497200528819297060280639534715710329892282157539373441311413502050681512321833218463376392843270931631689863941239230590311603617176093419589582219387687745872942987407171734924672615800112037849345263822600919692024899190144689490697325547157P.<s> = PolynomialRing(Zmod(n))
l = len(out)ks = []
for i in range(l):f, y = out[i]k = ((f[0] + s * f[1] + s ** 2 * f[2]) / y - (f[0] + 1337 * f[1] + 1337 ** 2 * f[2])) / 1337ks.append(k)
dets = []
for i in range(2):M = []for j in range(i, i + 21):line = []for t in range(20):line.append(ks[j] ** t)line.append(ks[j + 1])M.append(line)M = Matrix(M)det = Matrix(M).det()dets.append(det)
a, b = dets
a_original, b_original = dets
while True:a, b = b, a % bif b.degree() == 1:break
b = b.monic()
sec = ZZ(-b[0])print(f"sec = {sec}")load('https://raw.githubusercontent.com/TheBlupper/linineq/main/linineq.py')
print("begin...")
for nn in range(42, 50):flag = bytes(solve_bounded_mod(matrix([pow(sec, i + 1, n) for i in range(nn)]), [enc], [0] * nn, [128] * nn, n))print(flag)
# flag{b2ff9366d31eafc68c75a72879c9325d}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/919966.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

服务器系统时间不对?Linux系统时间修改与同步全面指南

前言:时间不对会有什么问题? 在实际运维工作中,服务器系统时间不准是一个常见但影响严重的问题。它可能导致:日志时间混乱:故障排查时无法确定事件发生的真实顺序 证书验证失败:HTTPS、SSL证书等基于时间的认证会…

处理限流、缓存与数据一致性:1688 API 实时数据采集的强大的技术细节

处理限流、缓存与数据一致性:1688 API 实时数据采集的强大的技术细节2025-09-27 21:30 tlnshuju 阅读(0) 评论(0) 收藏 举报pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto…

9/27

今天放假,休息一下

2025 常熟门窗店优选:丽格门窗,20 年技术沉淀的品质之选

在家居装修中,门窗作为 “家的第一道屏障”,其品质直接关乎居住的舒适与安全。2025 年常熟门窗选购,丽格门窗凭借二十余年的技术积淀、全产业链品控实力与适配本地需求的产品优势,成为不容错过的靠谱之选,其常熟门…

2025上海门窗店选购选丽格!20 年系统门窗经验,徐汇宜山路店品质之选

在上海挑选门窗,既要适配潮湿多雨的气候,又要满足家居节能、隔音与安全需求,丽格门窗无疑是值得信赖的优选,其上海门店位于徐汇区宜山路 450 号家饰佳 5 楼,方便本地用户实地考察选购。 丽格门窗隶属于沈阳辽沈企…

2025GUI工程实践:Unity编辑模式下GUI运行

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

最好的wordpress 网站wordpress 验证密码错误

B站UP主实时数据展示系统 - PHP源码分享 想要实时追踪你心仪的B站UP主的最新动态吗&#xff1f;现在&#xff0c;你可以轻松获取并展示B站UP主的实时数据&#xff0c;包括粉丝数、作品数、头像、播放量等关键信息。 功能亮点&#xff1a; 实时更新&#xff1a;系统通过B站AP…

网站关键词排名优化工具昆明做一个公司网站多少费用

解题思路&#xff1a; 递归参数&#xff1a; 生成括号的对数 n、结果集 result、当前路径 path、左括号数 open、右括号数 close。递归过程&#xff1a; 当当前路径 path 的长度等于 n * 2 时&#xff0c;说明已经生成有效括号&#xff0c;加入结果集。若左括号数小于 n&…

哦好多天没写了水一下吧

哦好多天没写了水一下吧这几天虽然没写,但是一直在干,跟着教程已经干到第三步了,现在在干第四步,发现我的博客完全是没营养的东西。。。。。。。。。。。。。。。。。。。。。。。。。。。

wordpress做网站建设部住房城乡建设厅网站

Bilibili助手&#xff0c;一款非常精彩的手机B站助手软件。通过这款应用你可以轻松实现自动领取礼物、自动签到、自动领经验等功能&#xff0c;非常精彩 &#xff0c;赶紧下载试试吧&#xff01;Bilibili助手介绍Bilibili助手&#xff0c;第二简单的助手&#xff0c;简单、便捷…

专门做ppt的网站wordpress views插件

Linux中sudo、su和su -命令的区别小结 我们知道&#xff0c;在Linux下对很多文件进行修改都需要有root&#xff08;管理员&#xff09;权限&#xff0c;比如对/ect/profile等文件的修改。下面这篇文章主要给大家总结介绍了关于Linux中sudo、su和su -命令的区别的相关资料&…

实用指南:Apache、Nginx 和 Tomcat 的区别

实用指南:Apache、Nginx 和 Tomcat 的区别pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "…

python+uniapp基于微信小程序美食点餐实用的系统

python+uniapp基于微信小程序美食点餐实用的系统pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", …

parted command for linuxg

安装parted yum install -y parted 列出现有磁盘分区 parted -l检查磁盘状态(sda是新添加的磁盘) parted /dev/sda print新建磁盘分区表类型MBR parted -s /dev/sda mklabel msdos 新建磁盘分区表类型gpt parted -s …

如何在不绑定Apple账号的情况下备份florr.io

很多入像我一样,喜欢玩florr.io 可是只能在同一个电脑的一个浏览器上玩一个账号,换电脑或浏览器的时候就只能含着泪,告别账号 但是你可以绑定 \(Apple\) 账号,到别的电脑或浏览器时登录账号 虽然能备份账号,但这个…

深圳店铺设计优化培训内容

数据库的三级模式两级映射: 存储文件------>基本表----->视图 内模式 ------->模式 ------>外模式 一、视图 1、什么是视图: 视图是从一个或多个表中导出来的表,是一种虚拟存在的表。 视图就像一个窗口,通过这个窗口可以看到系统专门提供的数据。 这样,用…

AI智能体框架怎么选?7个主流工具详细对比解析

大语言模型(LLM)虽然拥有强大的理解和生成能力,但本质上还只是一个能够处理文本的模型,并且它们无法主动获取信息、执行操作或与外部系统交互。 而AI智能体可以通过为LLM配备工具调用、环境感知和自主决策能力,将…

原创OI试题 - L

T1 换乘(metro) 题目背景 H3Z信息科学协会成员准备参加NOIP。他们准备从学校出发,乘坐地铁到达考场。但是,地铁线网错综复杂,换乘次数带来的问题困扰住了LzyCoding。作为信息科学协会的一名成员,你能写个程序来帮帮…

《深入浅出WPF》:8.3.2 自定义路由事件 事件注册类型为 EventHandlerReportTimeEventArgs,但.NET 事件包装器类型为 RoutedEventHandler

事件处理器的签名要和注册时的签名一致:包装器的参数类型为基类型,事件处理器的参数类型为子类型,根据委托协变,可以把子类型参数的委托赋值给基类型参数的委托以下是deepseek回答: 这是一个非常好的问题,它触及…

网站转app工具高级版怎么分析网站建设的优缺点

Pytorch torchvision 包提供了很多常用数据集 数据按照用途一般分为三组&#xff1a;训练&#xff08;train&#xff09;、验证&#xff08;validation&#xff09;和测试&#xff08;test&#xff09;。使用训练数据集来训练模型&#xff0c;使用验证数据集跟踪模型在训练期间…