InCTF Jr

Oh_No_Hastad

Hard Crypto

Author: careless_finch

This challenge is a simple attack which is Hastad's Broadcast attack so bascially CRT (chinese remainder is used to solving congruent equations) as e=3 we need to solve these these set of equations

we can solve it by using either using CRT from sympy or normal CRT

script

from sympy import root
from sympy.ntheory.modular import crt
n1=20249451881324791092320757814602896594336036692629150815468509502144560495821792087987043948049876841105635882170110772407071746758188479114329517577369921842022754384092556040001835774412026961724784519424539235764333595289259122705608035910732133050400165086456223915512649076928722222045198378398435342504030162669372761655137705189699324642087355892623458815343604040465195707986906199198724534687411813263928964502446366361647730291754759285182259818625985192254565459772803508412559912472131878739340296081587773088280782189564433144036236102169959007170556032173116742872610382283424100247744409413566302210563
c1=7436960791928114770168080512335701434089582792079482095648598143829016530255257352672334226264306779848637237390422189988538145700720724443267075796093767642378844742298175963988877247677453527286149370791842742542919880255342594768248194003008755210218334547198299192330884586334370340203620581802035750395736855054227092580982207605969816968738406847918031674294446982003078597213091989318156308445560629715538600576061400322411751616170345406421798169731532225612023989108776579497355799804113212987087764821326228468441694243975992945787318708259005760617105449985803344843061029187541181825770184671772851477264
n2=9924993636496426055260138375211020747012524091725212554692557325131108276183271645958821431950554034478045721071302497721966379424982899457033894718047084388589705116593478210777975001261120603696711904805047255614793143574656803894448736450792236674113157702825646907063576950035627973832411056065215158272762156133834146655225762951008726804019010913729028877287836166394381386162802545218956416856757609130616793134192869760908872901036381754253724732836629830079607759229078120377069286361416689963533966892414110486019174243903751232185922923347874056530239409099222376687571275613656496124478808300814501417061
c2=4757421835345747440504057462553951912127382568806788709712294360325437660441912201590881908538248597198413834895860555352881914399848349311913985937823385410922394904748920508271215322909610427666784755666448507419073908365007073023191830601131813576433446433230673259979879329078831902856789603282742066679565327549569666519490477129722150903855973805434839505715891237754353453181604507115909802560607923021581057901919505743465810945990384193291788367453921380660228430137901590599222896450409721812591906755242709824326563108643046213078442649249988320605473238826138445381425964989592191047074330376511656610891
n3=11503521021017709704721124765916909535361182328393433170305677182940478339493210154947559574142583871885601136503499821172125520993388368396598693299765916527600755939161291639082246315230733082456574739379932214337768774673047433315008632224178014820860314802461593601861195965442817628709862917079455977242828346286333401148072116049915872679418457638480681225689628879503420215059743976446998459782169908972998019690850375235688615874186499710201306514752082765910794423956668904777599007103083585940853133198963489487396154324430366344730764761260521154634180226743463523064847553074450308647580471333285617618837
c3=224943041042345104011846179384754541477450404924867329815967072711082135014876931604395426864445875958239339722208244649314902176547490127484643407701689483578673812074308973092321997291193159818252574787465535302125503140279046098860173729736222894026306978533838039820911317968638516677194324818652061518807378241594274467934612299012338792090484812556991934609878716246439039721491941532249481621744934713127225405389234672806278185620414302830020298163281718956338776248191450134296182197431308143531140988336478014870927934390568561873210502758168209408318748874127285748098776934572648199435884703706930996891
m=int(root(crt([n1,n2,n3],[c1,c2,c3])[0],3))
print(m.to_bytes(m.bit_length()//8+1,'big').decode())