1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
| from Crypto.Util.number import * from Crypto.Cipher import AES from mt19937predictor import MT19937Predictor
keys = [74737492451949886796883447380, 51358027370976380985099489502, 412762483065178295255791439485932171376749700084, 910689806, 1149695904, 3104053370, 221975799, 3823412020, 958468189, 3586356097, 340817801, 2878068849, 2732757663, 2018092082, 1847897227, 1759748212, 1295396426, 2794984001, 4265922173, 3532941962, 3649453440, 1086966694, 2188196779, 1036830362, 3114332204, 2720067903, 3763019658, 4220680032, 1434665040, 2867449357, 327630472, 4028025891, 1107232876, 1341894502, 3410775936, 792029308, 2140406850, 618481849, 3329607978, 1024829298, 1620771375, 1042727260, 1141119170, 2850063412, 722634918, 109575186, 1993029882, 2096912385, 866181039, 827908342, 1718528485, 1617437693, 3893036959, 2846991704, 3366375532, 2763086122, 2690998389, 1148589641, 1571939581, 2933947318, 4121295833, 3030689848, 1790011374, 109272014, 121093659, 4007439172, 831512040, 978840109, 3000990210, 3025633350, 1335144143, 4107810622, 1035611013, 3925921218, 1398042454, 1123546694, 4161792772, 1177640646, 4066189210, 2240592239, 508327944, 839225012, 1605466793, 2875695963, 626270177, 1371375933, 11364760, 3470778132, 1706915094, 1458410373, 98854289, 1392252258, 1560427103, 3615589636, 147666569, 1045773025, 4263298490, 3895751869, 2691680307, 1699526232, 3685180876, 729503966, 554847696, 1562590775, 3563661002, 963617489, 3181526105, 2184215744, 2144648457, 1109270973, 3071342721, 2842429183, 668733579, 1262667392, 772190169, 1000365415, 3453506497, 412844225, 9975293, 919025159, 3317679250, 2335686357, 1608848888, 2579223536, 1816878070, 3734808856, 269077113, 2396885783, 1147867931, 2331502665, 2928315805, 908907677, 1009287219, 1017406485, 3870217028, 1835376973, 890949168, 671845795, 3380480668, 4171623559, 1662988401, 3709126631, 2520677766, 1660449390, 120494599, 907225530, 3665272463, 136171352, 1758076339, 3009587924, 2866084549, 3656368543, 1692972691, 714237605, 892521830, 1942496649, 4241764492, 930308540, 3340229942, 773043293, 3514688079, 1318180965, 1669012263, 3638042505, 3025395295, 226129302, 153479541, 2764571825, 3421587858, 334668853, 1330796170, 218556632, 972714166, 922603164, 4024647445, 4233196368, 1249046751, 3667925019, 2276336634, 3644888947, 1444996806, 413210699, 2208048223, 3813568258, 2345486173, 487998086, 477969329, 3409170127, 3568976035, 3460493127, 2697206478, 1262489351, 4011219190, 1419296521, 1307871567, 270455245, 4245043905, 687578193, 1070246561, 185531160, 2626503659, 3372671141, 3673238883, 2542194104, 4260369384, 67076509, 4164858072, 3344428349, 2674528215, 2352981085, 4188340133, 2490407345, 2277623345, 578009254, 589898778, 2257425250, 4264855682, 3217088425, 1918678675, 2409396248, 366216060, 2318262020, 2695905062, 1588352782, 1427064824, 470125313, 3305196643, 1839661592, 2584820258, 299694866, 4205679150, 3105720803, 2804340888, 3893613342, 733876896, 232917987, 2727309654, 1790439074, 1927738154, 4017472905, 1863059250, 655457188, 3759472447, 4183317773, 797877611, 2699417810, 803278050, 3877877653, 1586583099, 3875432289, 111221042, 233407522, 3347300855, 3873882496, 3741842610, 717425034, 2557158550, 876205693, 683472955, 3676324193, 758448123, 1995439610, 2943722151, 1610689376, 4230997558, 802060680, 2861576590, 960427169, 2361123516, 2886027757, 271492995, 3597341957, 1973308613, 687254699, 2103809719, 1260885931, 2906748062, 873332944, 3671891228, 2490863425, 274650518, 990260178, 989305697, 3765783495, 3579353903, 1372910559, 165320956, 896735304, 3564054930, 2374613969, 786938917, 3955168292, 2134822172, 1403480802, 1340392765, 3154014116, 1793814283, 1981841272, 1873394217, 4217089972, 3403224767, 111486932, 1370301502, 1137722044, 1454768737, 2817161685, 1373532601, 88198402, 1162901466, 1764878443, 3204368881, 764246346, 3192119660, 876165427, 4104033361, 2154934077, 1561430573, 826991304, 849458135, 4188058136, 1199351023, 2127952015, 2094038064, 300699273, 3378157804, 6679715, 559293910, 3028818176, 2490265745, 3646800433, 1746603729, 1531309519, 18564847, 3452425344, 1989426082, 2251367880, 1426356258, 2425736463, 1600248295, 955344576, 3502485031, 1323390407, 399691485, 1835777771, 1828335677, 3348082301, 3687268482, 2457400649, 3368374393, 1119303358, 1270433121, 3059691677, 2392910075, 591224638, 1311675618, 4122050325, 4014348903, 2095907405, 1519824911, 2825776887, 3354142321, 1098235797, 1481266867, 1051367302, 1263016096, 1336057651, 1683842359, 4054448354, 1491994207, 1160110019, 3222808831, 177510926, 423347477, 803602771, 2683641253, 2919035439, 2485161789, 3378544338, 1610409532, 1545641821, 546762619, 2395983270, 3838745031, 789177414, 2123719243, 3476088109, 1615713790, 1335041829, 4006963851, 1700197865, 73798124, 1251950799, 2448692292, 937465221, 2191277155, 2283183462, 3235943428, 1888733145, 1637420644, 2906472352, 538528848, 1787881095, 2527345959, 816324140, 780626095, 3958671235, 1060151404, 3939612973, 720163439, 3130037256, 868218434, 594717218, 2378649142, 630567292, 272416131, 2656750985, 2254309115, 398769631, 144191385, 3584257427, 2276368553, 4037163602, 2651140730, 2231274829, 1953622167, 4083152642, 3006733661, 929392152, 843949652, 2714951407, 810363743, 1283798592, 3121903325, 1988057118, 356119324, 1904222878, 4044843055, 112669104, 868692487, 1115920155, 1623439582, 488326378, 148287535, 3338996246, 2166938666, 3797453833, 1474427255, 1386753952, 3317126798, 2190807666, 4259624962, 3066765455, 2382942891, 4046402452, 3243966738, 1774858251, 3181254579, 2171453049, 905778132, 1409024919, 4082347550, 1308497825, 3944454243, 1681570359, 3622008213, 1130389974, 3937594426, 4193387111, 4156444245, 1665819644, 4099931325, 546382740, 3459524364, 3215392046, 628790677, 2460115724, 4154656625, 1738275004, 372632247, 3901053671, 1968302733, 1542557146, 954360221, 94489421, 2526265974, 3493620125, 227040704, 1966827767, 2710288704, 1777503765, 3060587047, 2922448684, 1818271608, 3774695159, 198891092, 1892315134, 1988189925, 1877360903, 176031450, 782372078, 2630033970, 222585085, 1784220674, 187019927, 3793161227, 275394451, 3620112924, 1046758031, 794695465, 4020417715, 1036350909, 1034143101, 130770292, 3376762604, 3099991375, 1317943524, 538393453, 1676278328, 3728445031, 2444153711, 1294577644, 3255702608, 382221508, 501348604, 1545416914, 4046130944, 1518955393, 3919525514, 1729967634, 2572204860, 3777225961, 1646036822, 475018472, 2247517569, 4257731164, 1111295866, 524303023, 3981652986, 4072216404, 3747688429, 1885894640, 833446526, 3955045968, 1703975805, 1141801012, 2437322873, 2732846667, 1371506834, 669098384, 1963802511, 1542039, 728580454, 4041454310, 1019581040, 3144560205, 1329189307, 1043039655, 1028345076, 3541168610, 2082983922, 1305525731, 1078333930, 556043109, 3570861415, 1623319076, 3514585273, 223719132, 4031808254, 2549094947, 3825858427, 3214724358, 1835103180, 2471774591, 2111554082, 2948121215, 1362405065, 3765638194, 491471279, 2479158340, 3749279021, 3306251008, 2577577664, 1245538106, 503105027, 139202844, 2287890849, 3563168099, 1467460138, 3922094655, 1903765924, 3858903218, 3343562703, 2145132444, 1134537221, 2942539446, 914603375, 2155053085, 2864704965, 1971547127, 1892432263, 2604528206, 3387176542, 361652931, 2305859318, 1345198505, 2416327840, 887059258, 3219763770, 316636299, 307065443, 431437125, 4279494318, 220513368, 2362459616, 3712600310, 2105434588, 2938672182, 3316109731, 850677909, 1593089633, 1448569654, 2885245137, 3269946753, 885150079, 2358168430, 1785698607, 1757002566, 197277094, 47259139, 2710959991, 710476854, 1929434500, 1732169408, 381305673, 2982171232, 486112880, 3651033563, 734915423, 27291312, 93262695, 3206874794, 1595912125, 643556702, 2929755197, 1043917347, 3181953869, 3059173850, 986850461, 947059764] c = b'\xd1\xfb\xd3\xf0U\x14\x18\xa9Yf=\xa6\x7fJ\xd0aZ=\xf7\xf6\x1e]\xe 7\x07\xbd\x0b\xc9\xf8\xe7k\xa7\x16\xc1Z:\xbf\xde\xea=3\xe0\x82\xf0 \xca\xd2R\x91\xf5\x0f\xd1\x06\x99G\xf6\x8dh\x9c\x14Wi\xaf\xdbFL' p = MT19937Predictor() for i in range(len(keys)): if i == 0 or i == 1: p.setrandbits(keys[i], 96) elif i == 2: p.setrandbits(keys[i], 160) else: p.setrandbits(keys[i], 32) key = long_to_bytes(p.getrandbits(128)) cipher = AES.new(key, AES.MODE_ECB) print(cipher.decrypt(c))
|