{"id":318,"date":"2024-08-03T23:24:27","date_gmt":"2024-08-03T15:24:27","guid":{"rendered":"https:\/\/jotaku.cn\/?p=318"},"modified":"2024-10-03T22:14:46","modified_gmt":"2024-10-03T14:14:46","slug":"2023%e6%b1%9f%e8%8b%8f%e6%95%b0%e6%8d%ae%e5%ae%89%e5%85%a8%e7%ab%9e%e8%b5%9b%e6%9f%90%e9%81%93crypto-wp","status":"publish","type":"post","link":"https:\/\/jotaku.cn\/index.php\/2024\/08\/03\/2023%e6%b1%9f%e8%8b%8f%e6%95%b0%e6%8d%ae%e5%ae%89%e5%85%a8%e7%ab%9e%e8%b5%9b%e6%9f%90%e9%81%93crypto-wp\/","title":{"rendered":"2023\u6c5f\u82cf\u6570\u636e\u5b89\u5168\u7ade\u8d5b\u67d0\u9053Crypto WP"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u524d\u7f6e\u77e5\u8bc6\uff1aRSA\u57fa\u7840\uff0cpython\u57fa\u7840\uff0c\u4e2d\u56fd\u5269\u4f59\u5b9a\u7406\u7b49<\/p>\n\n\n\n<p>\u9898\u76ee\u96be\u5ea68\/10\u3002\u5927\u4f6c\u968f\u610f\u3002\u6211\u53cd\u6b63\u662f\u786c\u5543\u4e86\u4e00\u4e0b\u5348<\/p>\n<\/blockquote>\n\n\n\n<h1 class=\"wp-block-heading\">Task<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>from Crypto.Util.number import *\n\ndef pad(msg):\n    return msg + b'\\x00' * (2048 \/\/ 8 - len(msg))\n\ndef day():\n    print(\"# == Day Time == #\")\n    A = &#91;getRandomRange(1 &lt;&lt; 30, 1 &lt;&lt; 40) for _ in '01234']\n\n    from notebook import pubkeys\n    hint = str(A)&#91;1:-1].replace(', ', '||').encode()\n    hint = bytes_to_long(pad(hint))\n    package = &#91;]\n    for pubkey in pubkeys:\n        e, n = pubkey\n        package.append(pow(hint, e, n))\n    print(f\"{package = }\")\n\n    return A\n\ndef night(A):\n    print(\"# == Night Time == #\")\n    from secrets import secret\n\n    p, q = &#91;getPrime(1024) for _ in '01']\n    e, n = 0x10001, p * q\n    message = bytes_to_long(pad(secret))\n    ciphertext = pow(message, e, n)\n    print(f\"{e = }\")\n    print(f\"{n = }\")\n    print(f\"{ciphertext = }\")\n\n    core = getRandomRange(1 &lt;&lt; 70, 1 &lt;&lt; 80)\n    box = (A&#91;4] * p ** 4 + A&#91;3] * p ** 3 + A&#91;2] * p ** 2 + A&#91;1] * p ** 1 + core) % n\n    shell = (A&#91;4] * box ** 4 + A&#91;3] * box ** 3 + A&#91;2] * box ** 2 + A&#91;1] * box ** 1 + A&#91;0]) % n\n    print(f\"{shell = }\")\n\nA = day()\nnight(A)\n\n'''\npubkeys =&#91;\n    &#91;13, 16966923273393034574368601955241184391111444785998466710722972275633988040568029224272430397635357872449163107278928804572765398970752644900568552514020294813546024733050135082024292481598322682990045855877556853392263676715734911232910368712575738786450510156105046776600566496799942574786503183241332740784997363514285857446938222302824964396227964711868412832852194845619628366554904150230665043909281603861298992421759553638135733037244888585600075655017766713763334284974682754159767494437867386464788270392548503256135412609157993954349845981674000072937143857040970855382655304911806719316346552101453584266121],\n    &#91;13, 13636547774903694433910615288816366243965221147245493790443257513469643051508482519945160993497983268746607032666514024577996510214003878851754244812785830861056511467944880656887067183093022088006603023892079757597903932697728395729605528467171403935076011715369931494813762896302405865063013876978950952553183445737415893862580946529557997177862386840671940665891984463553509323759394863514802662045074793125218445076375294720405008157895103559623204523371691063630903658360461001806917018298844432738514873530829540084732665560723768831816785580126848217585494349751859982707295270194451027637908966488433591336079],\n    &#91;13, 13422209706853784863425138450444393536114566510977689013118842078064352816867606066548879016746689784867031499069217146653949323203507755857385123653072875573743110808787259755688613540214185294636104765964080842615717180413731820679997453377899736419007193552970900617704671115646941207925636014254352661937769415565529244046272257822921740649781322893596978112103176487718960676212380426151079825140922318909470514158027009961239217428522970405297292867815726509360369236095377704967444339421311749405316999191339677904499413281713365474466679134722393111495793887387332928227905039036942450742103526490509249576159],\n    &#91;13, 21746430662648628292439055708644436184530740821098010749514133474681581832957631729292681550968108122182841907644832479495695011213810971334153360397292385819609198743433956578966857749821825621262178208409227379634952172419748956184624505995106932133301461499473823229623656490844764958301835433668618062743327682117611417235819168865744757242990985069648255779083246816509593018812991050741917153961245784296647661659339041115118272068392627299499703962645966495325055378652176922700072734325787550811454984878236039742147547963385471101805136506286953288566035101103034341742923072819774753918471775281464739904101],\n    &#91;13, 16012920802348742413202394765537959589119609441428117329692661212660781149297315973073063954731746455220386673231725950116051390914388279415796378305381377822621647264088603927560119754278978906758212463937071494263575443156089509654950881813861479449401068535285885349738367249035960528895049222211387021733152221289202030407416118814341241382479971018611239102343929419190892133819275458474489856666791981711793637127167775551296403296397810821548297674986394286293380472089135564385129140069501205054853729781710604489652713172579677128036322403868618295553335257593973027194532512596143733434234439677513237984107]\n    ]\npackage = &#91;\n1348275592172789430802632398715397831929456592129727148350341695822097922745546634103895397114240780119492097879709874341733998189314701220819602086989170395665694216144611451695210776788208725517321710496401109614989729783280209806513298851774400705822274570042128297336679615535569295725037051009221966882907606741910671983811835353310553679554656322510247012465612842055583530354825164440556725066351429241835394579392892121937744444324723509039593320520073762479405487678614235658010109343868772211070874500834820005557924944766175445227592086997786601600141172729543326022039897279215360210475222205314199752358, \n11817047514083750028443306573161291960303002458276716688201587284992675854178250185695613342603396451495053496021018943618684096193774851513377343785523373066637422156529843356640438514917147007662989366432951340073247573347091422478343675687872524102452812391963856179412214914106817415620613886827405526709334122157218264253412138947978859771457788135381194396144386611627935519990330309154612803264373276472523863776757124489507206744895878709136339189551422814752920383697719212261820943113370067423118794871570596583232694067119303936516491830190746798281923693136901268220982292626728815051587839682733501582997,\n3131427695639074007646625687827523632044624200167725001731246731463369200890045250738898155425873822581405723445926216099453276470655307513244478613248253397941362848890729091875615893643288181126353294271063912991208029628896380928878098320509891044728414542705582996774991148116051162157848421643082210867849206627757941596203046799655123006406284498009424107637970927771132706399889289085811447333980744767367889464364519571965014435281718495338752896521777070285880327861778156398424643033288480056322928449210425585380975486759287881877636187364299666207762828705236236071045450767253946524067440138527952996304, \n3345060634868343217881273515503289974894457362066685037297545772310131198850220025672843957153107490874807599311288876818421468275658855183857485067696603798636556327070411528170381402923911922437076616994460720931230980991440337397730061039967493443152767007916713160518618697678791358770766857737217910848181657393760417031865203943283074078341988117567851667858026108335625589177179258992930648353570238327435125409871028669479754623782967450462280802423233657422873275069133939005033872391235288329468886849808534906305377008408076775145268714146937205940659708210819711903273898505450411746796296074348301840443,\n689229715602713064347690095007369004049337459458047359544160409565437783924368962797071453687950582019132146435134269723546824657132278724115055713024437048832952574546581164678912794341156478859615959289720931333010836265396177238403118182219901102453660596556053537987705012972371809213618745302576874122654094213771963420178465724399112964705426548207838941065298709968044913923423922781681311806180694571535910059881703228238538782302346351472443730399075812346657046097375387076507982673848430573754749554553794234945423901111974280859817600907619255722739374513108613738135872066592727564964404002462119084702\n]\ne = 65537\nn = 19628814650078845889624476490795800811418703155298421183649751922179289373872110164946485468758965499898659860381452920316689731813466611171330082419646032975535828938381971760997472673267667258345915647828047467420412766203712358122436358120743184983881044132767579608354023899206025747277296489890315455139161247982158229333619416375842911027431739437723838483131248360727904613423834627213036877579164949084954352768932164210879329537266501942223360207803513487189832308290555832923018589686990981697562750385892888271329399531648035355662276186237232094775404084845357101354614900716614704579902047366473325519851\nciphertext = 18231770979476945075115454933498285687471248736331968136534439886998853983159878091479109027681230666670001308495054141682281492473521819495259722942633525843224223138121210743435008344491182811096997837681349401919300801071760448609909297020846949507707329708251861866061443743942558286917774317607571379516986051564317860557772153943821431899226380831989795907857566336085097807330399388077758869632230636727348278392968946952484442630549599469645903047917899063746000458656292320802815605327181346234519795519772619774175495201258591571744214020509439053957080210165266709953654561600989486386199867341092142358249\nshell = 7450311459083436799013470526820816670296314417175130490433500468646960366746415074085735399822973890608046359739147553438015771999419943640758794686461655503899174274852006852675273759918109697488252918038788275865249305840107266839320745067341253227218580768443831238305064450748932813304412926315551102620477056031794884272260575749720364002093756539399717557808977458033683588388899534871439955606629530406662400672087729944642496842353084711242911328651341343429685261174338868058208644730980459845089948243884209259777439653298562832822410224626781415627048867272937969823329086437858777995321438386601575065665\n'''<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u811a\u672c\u5206\u6790<\/h1>\n\n\n\n<p>\u6211\u5199WP\u4e00\u822c\u4e0d\u5355\u72ec\u5199\u811a\u672c\u5206\u6790\uff0c\u53ea\u5728\u601d\u8def\u90e8\u5206\u63d0\u4e24\u5634\u3002<\/p>\n\n\n\n<p>\u4f46\u8fd9\u9898\u5b9e\u5728\u662f\u592a\u53f2\u4e86\uff0c\u7ed5\u7684\u4e00\u6279\uff0c\u6211\u4e0d\u5199\u90fd\u80fd\u628a\u81ea\u5df1\u7ed5\u6655\u3002<\/p>\n\n\n\n<p>\u6211\u4e00\u76f4\u5728\u60f3\u5b83\u4e3a\u4ec0\u4e48\u8981\u628a\u7a0b\u5e8f\u5199\u7684\u8fd9\u4e48\u4e11\uff0c\u6211\u867d\u7136\u4ee3\u7801\u80fd\u529b\u4e5f\u4e0d\u5f3a\uff0c\u4f46\u662f\u9898\u6211\u505a\u7684\u4e0d\u5c11\uff0c\u4e3a\u4ec0\u4e48\u751f\u6210\u51e0\u4e2a\u968f\u673a\u6570\u5c31\u8981\u5199\u7684\u90a3\u4e48\u7ed5\u3002\u4e0d\u61c2\u3002<\/p>\n\n\n\n<p>\u8a00\u5f52\u6b63\u4f20\u3002\u5f00\u59cb\u5206\u6790\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u5206\u6790\u52a0\u5bc6\u7a0b\u5e8f\uff0c\u7531\u4e09\u4e2a\u4e3b\u8981\u51fd\u6570pad(),day(),night()\u7ec4\u6210\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>pad\u51fd\u6570\u662f\u6700\u7b80\u5355\u7684\uff0c\u662f\u4e00\u4e2a\u586b\u5145\u51fd\u6570\u3002\u786e\u4fddmessage\u662f2048\u4f4d\uff0c\u4e0d\u8db3\u7684\u4ee5\\x00\u8865\u8db3\u4f4d\u6570<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u7136\u540e\u662fday\u51fd\u6570\u3002\u8fd9\u4e00\u4e32\u6709\u70b9\u590d\u6742\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>A = &#91;getRandomRange(1 &lt;&lt; 30, 1 &lt;&lt; 40) for _ in '01234']<\/code><\/pre>\n\n\n\n<p>\u9996\u5148\u8fd9\u4e32\u4ee3\u7801\u521b\u5efa\u4e86\u4e00\u4e2a\u5faa\u73af\u8303\u56f4\uff0c\u5faa\u73af\u6b21\u6570\u548c'01234'\u7684\u957f\u5ea6\u76f8\u540c\u3002\u4e5f\u5c31\u662f\u957f\u5ea6\u662f5\u3002<\/p>\n\n\n\n<p>\u7136\u540e\u662f'getRandomRange(1 &lt;&lt; 30, 1 &lt;&lt; 40)'\uff0c\u8fd9\u4e00\u53e5\u4ee3\u7801\u610f\u601d\u662fgetRandomRange\u51fd\u6570\u4f1a\u751f\u6210\u4e00\u4e2a\u5927\u5c0f\u57282^30\u52302^40\u8303\u56f4\u5185\u7684\u968f\u673a\u6570\u3002<\/p>\n\n\n\n<p>\u5408\u8d77\u6765\u5c31\u662f\u751f\u62105\u4e2a\u5927\u5c0f\u57282^30\u52302^40\u8303\u56f4\u5185\u7684\u968f\u673a\u6570\u3002A\u662f\u5305\u542b 5 \u4e2a\u968f\u673a\u6570\u7684\u5217\u8868\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from notebook import pubkeys<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e00\u53e5\u662f\u5bfc\u5165\u516c\u94a5\u3002\u516c\u94a5\u5df2\u7ecf\u7ed9\u6211\u4eec\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pubkeys =&#91;\n    &#91;13, 16966923273393034574368601955241184391111444785998466710722972275633988040568029224272430397635357872449163107278928804572765398970752644900568552514020294813546024733050135082024292481598322682990045855877556853392263676715734911232910368712575738786450510156105046776600566496799942574786503183241332740784997363514285857446938222302824964396227964711868412832852194845619628366554904150230665043909281603861298992421759553638135733037244888585600075655017766713763334284974682754159767494437867386464788270392548503256135412609157993954349845981674000072937143857040970855382655304911806719316346552101453584266121],\n    &#91;13, 13636547774903694433910615288816366243965221147245493790443257513469643051508482519945160993497983268746607032666514024577996510214003878851754244812785830861056511467944880656887067183093022088006603023892079757597903932697728395729605528467171403935076011715369931494813762896302405865063013876978950952553183445737415893862580946529557997177862386840671940665891984463553509323759394863514802662045074793125218445076375294720405008157895103559623204523371691063630903658360461001806917018298844432738514873530829540084732665560723768831816785580126848217585494349751859982707295270194451027637908966488433591336079],\n    &#91;13, 13422209706853784863425138450444393536114566510977689013118842078064352816867606066548879016746689784867031499069217146653949323203507755857385123653072875573743110808787259755688613540214185294636104765964080842615717180413731820679997453377899736419007193552970900617704671115646941207925636014254352661937769415565529244046272257822921740649781322893596978112103176487718960676212380426151079825140922318909470514158027009961239217428522970405297292867815726509360369236095377704967444339421311749405316999191339677904499413281713365474466679134722393111495793887387332928227905039036942450742103526490509249576159],\n    &#91;13, 21746430662648628292439055708644436184530740821098010749514133474681581832957631729292681550968108122182841907644832479495695011213810971334153360397292385819609198743433956578966857749821825621262178208409227379634952172419748956184624505995106932133301461499473823229623656490844764958301835433668618062743327682117611417235819168865744757242990985069648255779083246816509593018812991050741917153961245784296647661659339041115118272068392627299499703962645966495325055378652176922700072734325787550811454984878236039742147547963385471101805136506286953288566035101103034341742923072819774753918471775281464739904101],\n    &#91;13, 16012920802348742413202394765537959589119609441428117329692661212660781149297315973073063954731746455220386673231725950116051390914388279415796378305381377822621647264088603927560119754278978906758212463937071494263575443156089509654950881813861479449401068535285885349738367249035960528895049222211387021733152221289202030407416118814341241382479971018611239102343929419190892133819275458474489856666791981711793637127167775551296403296397810821548297674986394286293380472089135564385129140069501205054853729781710604489652713172579677128036322403868618295553335257593973027194532512596143733434234439677513237984107]\n    ]<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u8fd9\u662f\u516c\u94a5\u3002Public key\u3002\u4e0e\u4e4b\u76f8\u5bf9\u7684\u662f\u79c1\u94a5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hint = str(A)&#91;1:-1].replace(', ', '||').encode()<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e00\u53e5\u7684'str(A)'\u9996\u5148\u662f\u5c06A\u8f6c\u5316\u6210\u5b57\u7b26\u4e32\uff0c\u7136\u540e'[1:-1]'\u7684\u610f\u601d\u662f\u5c06\u5b57\u7b26\u4e32A\u5f00\u5934\u548c\u7ed3\u5c3e\u7684\" [ \" \u548c \" ] \"\u53bb\u9664\u3002.replace(', ', '||')\u7684\u610f\u601d\u662f\u5c06\u9017\u53f7\u66ff\u6362\u6210'||'\uff0c\u4e4b\u540e.encode()\u5c06\u4e4b\u524d\u5904\u7406\u7684A\u8f6c\u6362\u6210\u5b57\u8282\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hint = bytes_to_long(pad(hint))<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e00\u53e5\u662f\u5c06\u4e0a\u4e00\u53e5\u7684hint\u5148\u8d70\u7b2c\u4e00\u4e2apad\u51fd\u6570\uff0c\u7136\u540e\u518d\u8d70\u4e00\u4e2abytes_to_long(\u628a\u5b57\u7b26\u4e32\u8f6c\u5316\u4e3a\u957f\u6574\u6570)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package = &#91;]\n    for pubkey in pubkeys:\n        e, n = pubkey\n        package.append(pow(hint, e, n))\n    print(f\"{package = }\")\n\n    return A<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e00\u6bb5\u4ee3\u7801\u9996\u5148\u521d\u59cb\u5316\u4e86\u4e00\u4e2a\u7a7a\u5217\u8868package\u3002<\/p>\n\n\n\n<p>\u770b\u7740\u540e\u9762\u7684\u4ee3\u7801\u4e2d\u719f\u6089\u7684'pow(message, e, n)'\u6211\u4eec\u5c31\u80fd\u770b\u51fa\u6765\u8fd9\u662f\u6211\u4eec\u7684\u8001\u670b\u53cbRSA<\/p>\n\n\n\n<p>\u7531RSA\u57fa\u7840\u77e5\u8bc6\/\u9898\u76ee\u4ee3\u7801\u5f97\u5230\uff0c\u516c\u94a5public key\u7684\u683c\u5f0f\u662f(e,n)\u3002\u5373\u524d\u9762\u7684\u662f\u516c\u94a5e\uff0c\u540e\u9762\u7684\u662fn\u3002\u5355\u770bn\u7684\u4f4d\u6570\u5c31\u53ef\u4ee5\u5224\u65ad\u8fd9\u9898\u4e0d\u9700\u8981\u6211\u4eec\u81ea\u5df1\u5206\u89e3n\uff0c\u56e0\u4e3a\u4e2a\u4eba\u8ba1\u7b97\u673a\u4e0d\u5177\u5907\u90a3\u4e48\u5927\u7684\u7b97\u529b\u3002<\/p>\n\n\n\n<p>'pow(hint, e, n)'\u8fd9\u4e00\u53e5\u662f\u6807\u51c6\u7684rsa\u52a0\u5bc6\u65b9\u6cd5\u3002\u5bc6\u6587=hint^e mod n<\/p>\n\n\n\n<p>\u7136\u540e\u662f\u6253\u5370\u52a0\u5bc6\u4e4b\u540e\u7684hint\uff0c\u4e5f\u5c31\u662fpackage\u3002<\/p>\n\n\n\n<p>\u6700\u540e\u8fd4\u56deA\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u7136\u540e\u662fnight\u51fd\u6570\uff0c\u5927\u6982\u662f\u52a0\u5bc6\u7a0b\u5e8f\u4e2d\u6700\u6076\u5fc3\u7684\u4e00\u6bb5\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from secrets import secret<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e00\u4e32\u662fimport\u4e00\u4e2aflag(\u6211\u4eecCTFer\u90fd\u559c\u6b22\u7684\u4e1c\u897f)\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>p, q = &#91;getPrime(1024) for _ in '01']<\/code><\/pre>\n\n\n\n<p>\u751f\u6210\u4e24\u4e2a\u672a\u77e5<strong>\u8d28\u6570<\/strong>p\u548cq\u3002\u800c\u4e14\u90fd\u662f1024\u4f4d\u7684\u3002\u76f8\u5f53\u5927\uff0c\u4e0d\u53ef\u5206\u89e3\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>e, n = 0x10001, p * q<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e00\u53e5\u662f\u7b97\u516c\u94a5\uff0ce\u8fd9\u91cc\u662f\u5341\u516d\u8fdb\u5236\u8868\u793a\uff0c\u5341\u8fdb\u5236\u503c\u662f65537\uff0c\u9898\u505a\u591a\u4e86\u5176\u5b9e\u53ef\u4ee5\u4e00\u773c\u770b\u51fa\u6765\uff0c\u7b97\u662f\u5bc6\u7801\u624b\u7684\u57fa\u672c\u4fee\u517b\uff1f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>message = bytes_to_long(pad(secret))<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e00\u53e5\u5c06flag\u5148pad\u586b\u5145\u62102048\u4f4d(256\u4e2a\u5b57\u8282)\uff0c\u518d\u8d70\u4e00\u4e2abytes_to_long\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ciphertext = pow(message, e, n)\nprint(f\"{e = }\")\nprint(f\"{n = }\")\nprint(f\"{ciphertext = }\")<\/code><\/pre>\n\n\n\n<p>rsa\u52a0\u5bc6\u3002\u518d\u6253\u5370e\uff0cn\uff0ccipertext\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>core = getRandomRange(1 &lt;&lt; 70, 1 &lt;&lt; 80)<\/code><\/pre>\n\n\n\n<p>\u751f\u6210\u4e00\u4e2a\u4f4d\u6570\u572870\u523080\u7684\u968f\u673a\u6570core\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>box = (A&#91;4] * p ** 4 + A&#91;3] * p ** 3 + A&#91;2] * p ** 2 + A&#91;1] * p ** 1 + core) % n<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u7b97box\u503c\u3002A\u7684\u7b2c\u56db\u4e2a\u6570\u636e*p\u7684\u56db\u6b21\u65b9\u52a0\u4e0aA\u7684\u7b2c\u4e09\u4e2a\u6570\u636e*p\u7684\u4e09\u6b21\u65b9.........\u4ee5\u6b64\u7c7b\u63a8<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>shell = (A&#91;4] * box ** 4 + A&#91;3] * box ** 3 + A&#91;2] * box ** 2 + A&#91;1] * box ** 1 + A&#91;0]) % n<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e00\u53e5\u662f\u7b97shell\u503c\u3002A\u7684\u7b2c\u56db\u4e2a\u6570\u636e*box\u7684\u56db\u6b21\u65b9\u52a0\u4e0aA\u7684\u7b2c\u4e09\u4e2a\u6570\u636e*box\u7684\u4e09\u6b21\u65b9.........\u4ee5\u6b64\u7c7b\u63a8\u3002<\/p>\n\n\n\n<p>\u51fa\u9898\u4eba\u5728\u73a9\u53e0\u53e0\u4e50\uff1f<\/p>\n\n\n\n<p>\u6700\u540e\u6253\u5370shell\u503c\u3002print(f\"{shell = }\")\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>A = day()\nnight(A)<\/code><\/pre>\n\n\n\n<p>\u5148\u6267\u884c\u4e86day\u51fd\u6570\uff0c\u5c06\u8fd4\u56de\u503c\u7ed9\u4e86A\u3002<\/p>\n\n\n\n<p>\u7136\u540e\u5c06A\u6267\u884cnight\u51fd\u6570\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u603b\u7ed3\u51fa\u9898\u76ee\u603b\u52a0\u5bc6\u6846\u67b6<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u751f\u6210\u968f\u673a\u6570\u7ec4 A\u3002<\/li>\n\n\n\n<li>\u5c06\u8fd9\u4e9b\u968f\u673a\u6570\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\uff0c\u53bb\u6389\u5934\u5c3e\u7684\u65b9\u62ec\u53f7\u5e76\u7528 || \u5206\u9694\uff0c\u7136\u540e\u8f6c\u6362\u4e3a\u5b57\u8282\u3002<\/li>\n\n\n\n<li>\u5bf9\u5b57\u8282\u4e32hint\u8fdb\u884c\u586b\u5145\uff0c\u8f6c\u6362\u4e3a\u957f\u6574\u6570\u5f62\u5f0f\u3002<\/li>\n\n\n\n<li>\u4f7f\u7528\u591a\u4e2a\u516c\u94a5\u5bf9\u751f\u6210\u7684\u6574\u6570\u8fdb\u884cRSA\u52a0\u5bc6\uff0c\u5f97\u5230 package\uff08rsa\u52a0\u5bc6\u540e\u7684hint\uff09\u3002<\/li>\n\n\n\n<li>\u751f\u6210p\u548cq\uff0ce\u548cn<\/li>\n\n\n\n<li>\u5bf9flag\u8fdb\u884c\u586b\u5145\u5e76\u8f6c\u6362\u4e3a\u957f\u6574\u6570\u5f62\u5f0f\u3002<\/li>\n\n\n\n<li>\u5bf9flag\u8fdb\u884cRSA\u52a0\u5bc6\uff0c\u5f97\u5230\u5bc6\u6587ciphertext\u3002<\/li>\n\n\n\n<li>\u751f\u6210\u4e00\u4e2a70\u523080\u4f4d\u7684\u968f\u673a\u6570 core\u3002<\/li>\n\n\n\n<li>\u8ba1\u7b97 box \u548c shell\u3002<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"454\"   class=\"lazyload\" data-src=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41-1024x454.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" class=\"wp-image-442\" srcset=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41-1024x454.png 1024w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41-300x133.png 300w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41-768x340.png 768w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41.png 1169w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure >\n<noscript><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"454\" src=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41-1024x454.png\" alt=\"\" class=\"wp-image-442\" srcset=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41-1024x454.png 1024w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41-300x133.png 300w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41-768x340.png 768w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168\u4e00\u56fe\u6d41.png 1169w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/noscript>\n\n\n\n<p>\u505a\u7684\u4e00\u56fe\u6d41\uff0c\u6709\u70b9\u7b80\u964b\uff0c\u4e0d\u8fc7\u8fd8\u597d\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Think<\/h1>\n\n\n\n<p>\u5f88\u96be\u7684\u4e00\u9053\u9898\u76ee\uff0c\u5bf9\u7efc\u5408\u80fd\u529b(\u6570\u5b66\/\u4ee3\u7801)\u7684\u8003\u67e5\u6bd4\u8f83\u9ad8<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"844\"   class=\"lazyload\" data-src=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/\u6211\u5f97\u5750\u8d77\u6765\u8ddf\u4ed6\u6253.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" class=\"wp-image-443\" style=\"width:432px;height:auto\" srcset=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/\u6211\u5f97\u5750\u8d77\u6765\u8ddf\u4ed6\u6253.png 762w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/\u6211\u5f97\u5750\u8d77\u6765\u8ddf\u4ed6\u6253-271x300.png 271w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/figure >\n<noscript><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"844\" src=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/\u6211\u5f97\u5750\u8d77\u6765\u8ddf\u4ed6\u6253.png\" alt=\"\" class=\"wp-image-443\" style=\"width:432px;height:auto\" srcset=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/\u6211\u5f97\u5750\u8d77\u6765\u8ddf\u4ed6\u6253.png 762w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/\u6211\u5f97\u5750\u8d77\u6765\u8ddf\u4ed6\u6253-271x300.png 271w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/figure><\/noscript>\n\n\n\n<p>\u9996\u5148\u6211\u4eec\u770b\u4e00\u56fe\u6d41\uff0c\u660e\u786e\u4e00\u4e0b\u89e3\u5bc6\u6d41\u7a0b\u3002<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>\u6211\u4eec\u9700\u8981\u89e3\u5bc6package\u6765\u89e3\u51fa\u6570\u7ec4A\u3002\u56e0\u4e3aA\u53c2\u4e0e\u4e86shell\u7684\u8ba1\u7b97\u3002\u6ca1\u6709A\u5c31\u89e3\u4e0d\u51fashell\u3002<\/li>\n\n\n\n<li>shell\u53c8\u662f\u548cbox\u76f8\u5173\u3002box\u91cc\u9762\u6709p\u3002\u6211\u4eec\u9700\u8981\u901a\u8fc7\u8fd9\u4e2a\u89e3\u51fap\u548cq\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u770bday\u51fd\u6570\uff0c\u5728\u6211\u521d\u8bfb\u4ee3\u7801\u7684\u65f6\u5019\u5c31\u6ce8\u610f\u5230\uff0ce\u53ea\u670913\u3002\u4e5f\u5c31\u662f\u8bf4\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528rsa\u5c0f\u6307\u6570\u653b\u51fb\u3002\u800c\u4e14 \u516c\u94a5\u76f8\u540c\uff0c\u6a21\u6570\u4e0d\u540c \u7b26\u5408\u5e7f\u64ad\u653b\u51fb\u7684\u677f\u5b50\u3002<\/p>\n\n\n\n<p>P.S \u5176\u5b9e\u5c0f\u6307\u6570\u653b\u51fb\u548c\u5e7f\u64ad\u653b\u51fb\u4e5f\u5927\u6709\u5173\u7cfb\u3002\u6709\u65f6\u95f4\u53ef\u4ee5\u5199\u7bc7\u6587\u7ae0\u8bb2\u4e00\u8bb2<\/p>\n\n\n\n<p>\u4f46\u662fhint\u662f\u901a\u8fc7pad\u586b\u5145\u8fc7\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u6211\u4eec\u76ee\u524d\u7684\u5bc6\u6587\u662f\u5047\u660e\u6587\u52a0\u5bc6\u5f97\u5230\u7684\uff0c\u4e0d\u80fd\u76f4\u63a5\u5bf9\u677f\u5b50\u6765\u3002\u800c\u4e14\u5e7f\u64ad\u653b\u51fb\u7684\u8bdd\u9700\u8981\u7684\u6570\u636e\u6761\u6570\u5927\u4f53\u4e0a\u7b49\u4e8ee\u7684\u5927\u5c0f\uff0c\u4e0d\u80fd\u786c\u6765\u3002\u5f97\u5148\u5206\u6790\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u660e\u786epad\u4e4b\u524d\u7684hint\u5230\u5e95\u662f\u4ec0\u4e48\u6837\u7684\u3002\u5927\u6982\u662f\u8fd9\u6837\u7684 b'1111||2222||3333||4444||5555'<\/p>\n\n\n\n<p>\u5e78\u597dpad\u51fd\u6570\u586b\u5145\u7684\u6bd4\u8f83\u7b80\u5355\uff0c\u5355\u7eaf\u7684\u52a0\\x00(\u4e5f\u5c31\u662f\u5341\u8fdb\u5236\u76840)<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u662f\u89e3day\u51fd\u6570\u7684\u91cd\u70b9\uff01<\/p>\n\n\n\n<p>\u8fd9\u91cc\u5e94\u8be5\u8be6\u7ec6\u8bb2\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u8bbepad\u524d\u7684hint\u662fhint1\uff0cpad\u540e\u7684\u662fhint2\u3002<\/p>\n\n\n\n<p>\u90a3\u4e48\u5c06hint2\u7528hint1\u8868\u793a\u7684\u8bdd\uff0c\u90a3\u5c31\u662fhint2 = hint1*10x\u3002x\u7684\u5927\u5c0f\u662f0\u7684\u4e2a\u6570\u3002\u56e0\u4e3ahint2\u4e0d\u5c31\u662fhint1\u5f80\u524d\u8fdb\u4f4d\u561b(\u5373\u6dfb\u52a00).<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u4f8b\uff1ahint1\u662f1\uff0chint2\u662f10.\u90a3\u4e4810x\u5c31\u662f10.\u4e5f\u5c31\u662f\u8bf4x\u662f1.<\/p>\n<\/blockquote>\n\n\n\n<p>\u6240\u4ee5\u6211\u4eec\u53ea\u9700\u8981\u77e5\u9053pad\u5230\u5e95\u52a0\u4e86\u51e0\u4e2a0\u5c31\u884c\u3002\u7136\u540e\u6211\u4eec\u53ea\u9700\u8981\u5c06\u5bc6\u6587\u5904\u7406\u4e00\u4e0b\u3002\u5c31\u80fd\u5f97\u51fa\u5c06hint2^e \u53d8\u4e3ahint1^e\u3002<\/p>\n\n\n\n<p>10x\u5177\u4f53\u591a\u5927\u6211\u4eec\u662f\u4e0d\u77e5\u9053\u7684\uff0c\u4e0d\u8fc7\u6211\u4eec\u53ef\u4ee5\u5c1d\u8bd5hint2\/hint1\u7b97\u4e00\u4e0b\u53d6\u5e73\u5747\u503c\uff0c\u4e0d\u788d\u4e8b\u7684\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\u7b97\u7684\u65f6\u5019\u6ce8\u610f\u4e00\u70b9\uff01pad\u51fd\u6570\u586b\u5145\u7684\u662f\\x00\u3002\u662f16\u8fdb\u5236\u3002\u6240\u4ee5\u6211\u4eec\u8f93\u51fa\u7684\u65f6\u5019\u4e5f\u898116\u8fdb\u5236\uff01<\/p>\n\n\n\n<p>\u5177\u4f53\u7684\u7b97\u6cd5\u5c31\u662f\u622a\u53d6\u4e00\u6bb5\u52a0\u5bc6\u811a\u672c\u3002\u7a0d\u5fae\u6539\u4e00\u4e0b\u5c31\u884c\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from Crypto.Util.number import *\n\ndef pad(msg):\n    return msg + b'\\x00' * (2048 \/\/ 8 - len(msg))\n\ndef day():\n    print(\"# == Day Time == #\")\n    A = &#91;getRandomRange(1 &lt;&lt; 30, 1 &lt;&lt; 40) for _ in '01234']\n    hint = str(A)&#91;1:-1].replace(', ', '||').encode()\n    h1 = bytes_to_long(hint)\n    h2 = bytes_to_long(pad(hint))\n    print(hex(h2\/\/h1))\n    return A\nday()<\/code><\/pre>\n\n\n\n<p>\u6211\u4eec\u8981\u627e\u768410x\u5dee\u4e0d\u591a\u662f\u8fd9\u6837\u7684\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>0x1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000<\/p>\n<\/blockquote>\n\n\n\n<p>\u4e5f\u5c31\u662f\u8bf4\u5c06\u90a3\u4e2a package \u2261 (hint1*10x)^e (mod n)\u8f6c\u5316\u4e3ahint1^e \u2261 package * 10x^-e (mod n)<\/p>\n\n\n\n<p>\u76f4\u63a5\u5217\u4e00\u4e2aCRT\uff0c\u5c31\u53ef\u4ee5\u89e3\u51fa\u6765\u660e\u6587hint\u3002\u4e5f\u5c31\u662f\u89e3\u51fa\u6765\u4e86A\u3002<\/p>\n\n\n\n<p>\u6709\u4e86A\u6211\u4eec\u5c31\u53ef\u4ee5\u8fdb\u4e00\u6b65\u89e3shell\uff0c\u628an\u5206\u89e3\u6765\u89e3\u51faRSA<\/p>\n\n\n\n<p>\u9996\u5148\u6211\u4eec\u770b\u4e00\u4e0bbox\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>box = (A&#91;4] * p ** 4 + A&#91;3] * p ** 3 + A&#91;2] * p ** 2 + A&#91;1] * p ** 1 + core) % n<\/code><\/pre>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u5f97\u5230box \u2261 core \uff08mod p\uff09\uff0c\u56e0\u4e3ap\u662fn\u7684\u56e0\u5b50\u561b\uff0c\u770b\u4e0b\u9762\u8fd9\u884c\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>k*n+box = (A[4] * p ** 4 + A[3] * p ** 3 + A[2] * p ** 2 + A[1] * p ** 1 + core)(k\u662f\u4efb\u610f\u6574\u6570<\/p>\n<\/blockquote>\n\n\n\n<p>\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63a8shell\uff0c\u56e0\u4e3abox \u2261 core \uff08mod p\uff09\u3002\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u8f6c\u5316shell\u5f0f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>shell = (A&#91;4] * box ** 4 + A&#91;3] * box ** 3 + A&#91;2] * box ** 2 + A&#91;1] * box ** 1 + A&#91;0]) % n<\/code><\/pre>\n\n\n\n<p>\u8f6c\u5316\u540e\u7684shell\u5f0f\u5c06box\u5168\u90e8\u5316\u4e3acore\u3002\u6700\u540e\u6a21\u4e00\u4e2ap\u3002\u539f\u56e0\u540c\u4e0a\u3002<\/p>\n\n\n\n<p>\u90fd\u662f\u53c2\u6570\u5206\u6790\uff0c\u7b97\u662f\u5bc6\u7801\u624b\u7684\u57fa\u672c\u4fee\u517b\uff1f<\/p>\n\n\n\n<p>\u6240\u4ee5night\u51fd\u6570\u7684\u5173\u952e\u5c31\u662f\u6c42core\u3002<\/p>\n\n\n\n<p>\u6240\u9700\u7b97\u6cd5\u662fcoppersmith\uff0c\u6c42\u5f97\u5c0f\u6839core\u3002<\/p>\n\n\n\n<p>\u5177\u4f53\u600e\u4e48\u5f04......\u5c31\u662f\u7a0b\u5e8f\u91cc\u5f15\u7528\u73b0\u6210\u7684\u51fd\u6570\u3002<\/p>\n\n\n\n<p>\u7b97\u51fa\u6765core\uff0c\u6211\u4eec\u5c31\u80fd\u6c42\u5f97shell\u7684\u5177\u4f53\u503c\uff0c\u56e0\u4e3ashell\u548cn\u542b\u6709\u76f8\u540c\u8d28\u56e0\u6570p\u3002\u4e4b\u540e\u6c42\u4e00\u4e2agcd\u5c31\u80fd\u6c42\u51fap\u3002<\/p>\n\n\n\n<p>\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u6210\u529f\u5206\u89e3\u4e86n\u3002<\/p>\n\n\n\n<p>--------Q.E.D<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Exp<\/h1>\n\n\n\n<p>\u6211\u4eec\u7528sage\u5199exp\uff0c\u56e0\u4e3a\u5728\u6211\u7684\u8ba4\u77e5\u8303\u56f4\u91ccpython\u4e2d\u6ca1\u6709\u80fd\u76f4\u63a5\u5f15\u7528\u6765\u89e3copper\u5c0f\u6839\u7684\u51fd\u6570......\u6211\u81ea\u5df1\u4e5f\u4e0d\u4f1a\u5199\uff0c\u4ee3\u7801\/\u6570\u5b66\u80fd\u529b\u8fd8\u662f\u6709\u5f85\u63d0\u9ad8\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u54b1\u4eec\u5148\u6c42A\uff0c\u56e0\u4e3a\u6211\u7684sagemath\u62bd\u98ce\u8dd1\u4e0d\u4e86long_to_bytes\uff0c\u6240\u4ee5\u6211\u4eec\u53ea\u80fd\u73a9sage+python\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from gmpy2 import *\n\npackage = &#91;11348275592172789430802632398715397831929456592129727148350341695822097922745546634103895397114240780119492097879709874341733998189314701220819602086989170395665694216144611451695210776788208725517321710496401109614989729783280209806513298851774400705822274570042128297336679615535569295725037051009221966882907606741910671983811835353310553679554656322510247012465612842055583530354825164440556725066351429241835394579392892121937744444324723509039593320520073762479405487678614235658010109343868772211070874500834820005557924944766175445227592086997786601600141172729543326022039897279215360210475222205314199752358, 11817047514083750028443306573161291960303002458276716688201587284992675854178250185695613342603396451495053496021018943618684096193774851513377343785523373066637422156529843356640438514917147007662989366432951340073247573347091422478343675687872524102452812391963856179412214914106817415620613886827405526709334122157218264253412138947978859771457788135381194396144386611627935519990330309154612803264373276472523863776757124489507206744895878709136339189551422814752920383697719212261820943113370067423118794871570596583232694067119303936516491830190746798281923693136901268220982292626728815051587839682733501582997, 3131427695639074007646625687827523632044624200167725001731246731463369200890045250738898155425873822581405723445926216099453276470655307513244478613248253397941362848890729091875615893643288181126353294271063912991208029628896380928878098320509891044728414542705582996774991148116051162157848421643082210867849206627757941596203046799655123006406284498009424107637970927771132706399889289085811447333980744767367889464364519571965014435281718495338752896521777070285880327861778156398424643033288480056322928449210425585380975486759287881877636187364299666207762828705236236071045450767253946524067440138527952996304, 3345060634868343217881273515503289974894457362066685037297545772310131198850220025672843957153107490874807599311288876818421468275658855183857485067696603798636556327070411528170381402923911922437076616994460720931230980991440337397730061039967493443152767007916713160518618697678791358770766857737217910848181657393760417031865203943283074078341988117567851667858026108335625589177179258992930648353570238327435125409871028669479754623782967450462280802423233657422873275069133939005033872391235288329468886849808534906305377008408076775145268714146937205940659708210819711903273898505450411746796296074348301840443, 689229715602713064347690095007369004049337459458047359544160409565437783924368962797071453687950582019132146435134269723546824657132278724115055713024437048832952574546581164678912794341156478859615959289720931333010836265396177238403118182219901102453660596556053537987705012972371809213618745302576874122654094213771963420178465724399112964705426548207838941065298709968044913923423922781681311806180694571535910059881703228238538782302346351472443730399075812346657046097375387076507982673848430573754749554553794234945423901111974280859817600907619255722739374513108613738135872066592727564964404002462119084702]\npubkeys = &#91;\n    &#91;13, 16966923273393034574368601955241184391111444785998466710722972275633988040568029224272430397635357872449163107278928804572765398970752644900568552514020294813546024733050135082024292481598322682990045855877556853392263676715734911232910368712575738786450510156105046776600566496799942574786503183241332740784997363514285857446938222302824964396227964711868412832852194845619628366554904150230665043909281603861298992421759553638135733037244888585600075655017766713763334284974682754159767494437867386464788270392548503256135412609157993954349845981674000072937143857040970855382655304911806719316346552101453584266121],\n    &#91;13, 13636547774903694433910615288816366243965221147245493790443257513469643051508482519945160993497983268746607032666514024577996510214003878851754244812785830861056511467944880656887067183093022088006603023892079757597903932697728395729605528467171403935076011715369931494813762896302405865063013876978950952553183445737415893862580946529557997177862386840671940665891984463553509323759394863514802662045074793125218445076375294720405008157895103559623204523371691063630903658360461001806917018298844432738514873530829540084732665560723768831816785580126848217585494349751859982707295270194451027637908966488433591336079],\n    &#91;13, 13422209706853784863425138450444393536114566510977689013118842078064352816867606066548879016746689784867031499069217146653949323203507755857385123653072875573743110808787259755688613540214185294636104765964080842615717180413731820679997453377899736419007193552970900617704671115646941207925636014254352661937769415565529244046272257822921740649781322893596978112103176487718960676212380426151079825140922318909470514158027009961239217428522970405297292867815726509360369236095377704967444339421311749405316999191339677904499413281713365474466679134722393111495793887387332928227905039036942450742103526490509249576159],\n    &#91;13, 21746430662648628292439055708644436184530740821098010749514133474681581832957631729292681550968108122182841907644832479495695011213810971334153360397292385819609198743433956578966857749821825621262178208409227379634952172419748956184624505995106932133301461499473823229623656490844764958301835433668618062743327682117611417235819168865744757242990985069648255779083246816509593018812991050741917153961245784296647661659339041115118272068392627299499703962645966495325055378652176922700072734325787550811454984878236039742147547963385471101805136506286953288566035101103034341742923072819774753918471775281464739904101],\n    &#91;13, 16012920802348742413202394765537959589119609441428117329692661212660781149297315973073063954731746455220386673231725950116051390914388279415796378305381377822621647264088603927560119754278978906758212463937071494263575443156089509654950881813861479449401068535285885349738367249035960528895049222211387021733152221289202030407416118814341241382479971018611239102343929419190892133819275458474489856666791981711793637127167775551296403296397810821548297674986394286293380472089135564385129140069501205054853729781710604489652713172579677128036322403868618295553335257593973027194532512596143733434234439677513237984107]\n]\n\npads = 0x1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n\nn = &#91;]\nfor each in pubkeys:\n    n.append(each&#91;1])\n\nc = &#91;]\nfor index in range(len(package)):\n    c += &#91;int(package&#91;index] * pow(pads,-13,n&#91;index]) % n&#91;index])]\n\nhint = crt(c,n)\nprint(iroot(hint,13)&#91;0])<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u6c42\u51fa\u6765\u7684\u662f\u5c0f\u6307\u6570\u653b\u51fb\u8fc7\u7684hint\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>84152616749644009819335178014845195915060595584188870825938068471509777970442351973186379593722372184935335177670074210379972719587675942936580059181831559506610856227320757253679503009520239659504900718659202913750388481144274288640<\/p>\n<\/blockquote>\n\n\n\n<p>\u7136\u540e\u6211\u4eecpython\u91cc\u8d70\u4e00\u4e2along_to_bytes\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"260\"   class=\"lazyload\" data-src=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes-1024x260.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" class=\"wp-image-444\" srcset=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes-1024x260.png 1024w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes-300x76.png 300w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes-768x195.png 768w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure >\n<noscript><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"260\" src=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes-1024x260.png\" alt=\"\" class=\"wp-image-444\" srcset=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes-1024x260.png 1024w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes-300x76.png 300w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes-768x195.png 768w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/23\u6570\u636e\u5b89\u5168long_to_bytes.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/noscript>\n\n\n\n<p>\u770b\u7a0b\u5e8f\u8f93\u51fa\uff0c\u8fd9\u5c31\u662f\u6211\u4e0a\u9762\u8bf4\u4e0d\u788d\u4e8b\u7684\u539f\u56e0\uff0c\u53cd\u6b63\u54b1\u4eec\u53ef\u4ee5\u5220\u53bb\u561b<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>10x\u5177\u4f53\u591a\u5927\u6211\u4eec\u662f\u4e0d\u77e5\u9053\u7684\uff0c\u4e0d\u8fc7\u6211\u4eec\u53ef\u4ee5\u5c1d\u8bd5hint2\/hint1\u7b97\u4e00\u4e0b\u53d6\u5e73\u5747\u503c\uff0c\u4e0d\u788d\u4e8b\u7684\u3002<\/p>\n<\/blockquote>\n\n\n\n<p>\u597d\uff0c\u54b1\u4eec\u7ec8\u4e8e\u89e3\u51fa\u6765A\u4e86\u3002<\/p>\n\n\n\n<p>A = [646919678902,598613162045,90472013741,917100488664,838250498519]<\/p>\n\n\n\n<p>\u7136\u540e\u662f\u89e3\u51facore\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>A = &#91;646919678902,598613162045,90472013741,917100488664,838250498519]\nshell = 7450311459083436799013470526820816670296314417175130490433500468646960366746415074085735399822973890608046359739147553438015771999419943640758794686461655503899174274852006852675273759918109697488252918038788275865249305840107266839320745067341253227218580768443831238305064450748932813304412926315551102620477056031794884272260575749720364002093756539399717557808977458033683588388899534871439955606629530406662400672087729944642496842353084711242911328651341343429685261174338868058208644730980459845089948243884209259777439653298562832822410224626781415627048867272937969823329086437858777995321438386601575065665\n\nR.&lt;box&gt; = Zmod(n)&#91;]\nf = (A&#91;4] * box ** 4 + A&#91;3] * box ** 3 + A&#91;2] * box ** 2 + A&#91;1] * box ** 1 + A&#91;0]) - shell\ncore = f.monic().small_roots(X=2^80,beta=0.5,epsilon=0.03)&#91;0]\nprint(core)<\/code><\/pre>\n\n\n\n<p>beta\u662f\u63a7\u5236\u627e\u5230\u7684\u5c0f\u6839\u5927\u5c0f\uff0c\u4e00\u822c\u57280.1\u52300.5\u3002epsilon\u662f\u63a7\u5236\u641c\u7d22\u7cbe\u5ea6\uff0c\u4e00\u822c\u57280.01\u52300.1\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u89e3\u51fa\u6765core\u662f72398025613557274548283<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\"   class=\"lazyload\" data-src=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath-1024x409.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" class=\"wp-image-445\" style=\"width:613px;height:auto\" srcset=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath-1024x409.png 1024w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath-300x120.png 300w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath-768x307.png 768w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure >\n<noscript><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath-1024x409.png\" alt=\"\" class=\"wp-image-445\" style=\"width:613px;height:auto\" srcset=\"https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath-1024x409.png 1024w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath-300x120.png 300w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath-768x307.png 768w, https:\/\/jotaku.cn\/wp-content\/uploads\/2024\/08\/sagemath.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/noscript>\n\n\n\n<p>\u6700\u540e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from Crypto.Util.number import *\n\nn = 19628814650078845889624476490795800811418703155298421183649751922179289373872110164946485468758965499898659860381452920316689731813466611171330082419646032975535828938381971760997472673267667258345915647828047467420412766203712358122436358120743184983881044132767579608354023899206025747277296489890315455139161247982158229333619416375842911027431739437723838483131248360727904613423834627213036877579164949084954352768932164210879329537266501942223360207803513487189832308290555832923018589686990981697562750385892888271329399531648035355662276186237232094775404084845357101354614900716614704579902047366473325519851\nA = &#91;646919678902,598613162045,90472013741,917100488664,838250498519]\nshell = 7450311459083436799013470526820816670296314417175130490433500468646960366746415074085735399822973890608046359739147553438015771999419943640758794686461655503899174274852006852675273759918109697488252918038788275865249305840107266839320745067341253227218580768443831238305064450748932813304412926315551102620477056031794884272260575749720364002093756539399717557808977458033683588388899534871439955606629530406662400672087729944642496842353084711242911328651341343429685261174338868058208644730980459845089948243884209259777439653298562832822410224626781415627048867272937969823329086437858777995321438386601575065665\nciphertext = 18231770979476945075115454933498285687471248736331968136534439886998853983159878091479109027681230666670001308495054141682281492473521819495259722942633525843224223138121210743435008344491182811096997837681349401919300801071760448609909297020846949507707329708251861866061443743942558286917774317607571379516986051564317860557772153943821431899226380831989795907857566336085097807330399388077758869632230636727348278392968946952484442630549599469645903047917899063746000458656292320802815605327181346234519795519772619774175495201258591571744214020509439053957080210165266709953654561600989486386199867341092142358249\ncore = 72398025613557274548283\nbox = core\nx = shell - (A&#91;4] * box ** 4 + A&#91;3] * box ** 3 + A&#91;2] * box ** 2 + A&#91;1] * box ** 1 + A&#91;0])\np = int(GCD(x,n))\nq = int(n\/\/p)\nphi = (p-1)*(q-1)\ne = 65537\nd = pow(e,-1,phi)\nm = pow(ciphertext,d,n)\nprint(long_to_bytes(m))<\/code><\/pre>\n\n\n\n<p>\u89e3\u51fa\u6765\u660e\u6587\u662fflag{8d24d7d491106a7974d5afe9342b2834}<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u603b\u7ed3<\/h1>\n\n\n\n<p>\u8fd9\u662f\u6211\u505a\u8fc7\u7684\u6700\u96be\u7684\u4e00\u9053\u9898\u3002<\/p>\n\n\n\n<p>\u5305\u62ec\u4e00\u5927\u5806\u6ca1\u7528\u8fc7\u7684\u5e93\uff0chint\u7684\u5904\u7406\uff0c\u4ee5\u53ca\u5b66\u4e86\u534a\u6691\u5047\u90fd\u6ca1\u5b66\u4f1a\u7684coppersmith\u3002\u771f\u96be\u554a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u633a\u96be\u4e00\u9053\u9898<\/p>\n","protected":false},"author":3,"featured_media":338,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":5,"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":446,"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/posts\/318\/revisions\/446"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/media\/338"}],"wp:attachment":[{"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jotaku.cn\/index.php\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}