Misc
signin
零宽度字符隐写+emoji-aes
py2
__import__('os').system('/bin/sh')
ezsteg
用stegsolve打开图片,在red plane 0通道发现G plane通道有东西。
保存Green plane 0的图片然后用stegsolve的Image Combiner功能进行对比。
发现了前一半flag还有后一半flag的提示是用QIM量化,步长为20。在github搜索QIM quantization搜到这个网址
https://github.com/pl561/QuantizationIndexModulation/blob/master/qim.py
仿照里面的test_qim进行函数重写,发现结果里的msg_detected全是1和0,把所有的0都改成255,再保存成新的图片,得到后一半flag。
def my_test_qim():
delta = 20
qim = QIM(delta)
y = cv2.imread('./ezsteg.png')
z_detected, msg_detected = qim.detect(y)
for i in tqdm(range(len(msg_detected))):
for j in range(len(msg_detected[i])):
for k in range(len(msg_detected[i][j])):
if msg_detected[i][j][k] == 1:
msg_detected[i][j][k] = 255
cv2.imwrite('flag.png', msg_detected)
babypcap
# f=open('usbdata.txt','r')
# fi=open('out.txt','w')
# while 1:
# a=f.readline().strip()
# if a:
# if len(a)==8: # 鼠标流量的话len改为8
# out=''
# for i in range(0,len(a),2):
# if i+2 != len(a):
# out+=a[i]+a[i+1]+":"
# else:
# out+=a[i]+a[i+1]
# fi.write(out)
# fi.write('\n')
# else:
# break
# fi.close()
nums = []
keys = open('out.txt','r')
f = open('xy.txt','w')
posx = 0
posy = 0
for line in keys:
if len(line) != 12 :
continue
x = int(line[3:5],16)
y = int(line[6:8],16)
if x > 127 :
x -= 256
if y > 127 :
y -= 256
posx += x
posy += y
btn_flag = int(line[0:2],16) # 1 for left , 2 for right , 0 for nothing
if btn_flag == 2 : # 1 代表左键
f.write(str(posx))
f.write(' ')
f.write(str(posy))
f.write('\n')
f.close()
forensic
Volatility hashdump
Crypto
checkin
from libnum import *
from gmpy2 import *
a = 96316700053619982349826498082259844895063380240567022005928513915204024844540469555622671378420860794984950658042831492783861955562369157151421516119461394776198481138414957948098639517961692333468639614643929505462336976740245087790881358621201910998692556309218648061409226131514631759925556900619868423867
p = 177239747994633072316370036717795850380946952732364574855526378691774946405888176887836729298576549186507345842031428239242107123560927684315092976659481316206341152868428190256155821018749939785354467611248296042929661619015242685527886041555723637417300791242768261681522882474858447747878003388616705422171
c = 31249810030340024867701516253216124873798373762921285160326678130373368708545564162489355490838932695325242212478465783024384459580684925642281202270189855386158713050116222890609403658664009085600847194989625233217765205670373759181021708443179634537090066546973252972859914381008999790882607671941093099299
ni = invert(a, p)
m = c * ni % p
print(n2s(int(m)))
base
s = 'zCN7zTIOntz8zCiPzsQQzCySltr8m9mJyCiMmsQMmPmRzwyPzdfBowzZ='
b_char = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+/'
b = ''
for i in s:
for j in range(len(b_char)):
if i == b_char[j]:
b += str(bin(j)).replace('0b', '').zfill(6)
flag = ''
for i in range(0, len(b), 8):
flag += chr(int(b[i: i+8], 2))
print(flag)
random1
# py2
import random
import gmpy2
from libnum import *
n = 144573683990296079611135474661197492569962285163118264304760128514378450625043070474838075626723354220121948920313400664358341070757676498630899262349227958025807395866103391135742530910291132519036950667849498017553807524999532071920009738654477379676790400942232810106883328105428161410721145229679023998881
c = 140936410048438311250552166359315531524717850408136878422422753861467709727494132943441793325459384490656351395836085596063714127829696538515364822908513326788824368390411397265861249839989684310498194231709180660320399728106109349119244510966442534818280589033645304725341767217060885195904689618851168472021
res = [
224, 32, 63, 37, 139, 9, 37, 205, 108, 41, 237, 68, 40, 206, 48, 112, 239,
85, 232, 0, 168, 105, 214, 13, 185, 107, 27, 176, 219, 55, 128, 25, 80,
249, 88, 86, 32, 6, 110, 20, 171, 220, 249, 251, 26, 52, 149, 234, 60, 145,
126, 25, 207, 5, 42, 0, 199, 155, 56, 142, 199, 37, 4, 76, 173, 138, 195,
112, 145, 123, 175, 178, 123, 73, 32, 223, 200, 254, 135, 94, 156, 97, 67,
252, 31, 179, 245, 231, 90, 60, 77, 63, 167, 33, 136, 40, 210, 219, 226,
164, 164, 45, 122, 85, 29, 59, 86, 123, 251, 126, 37, 9, 119, 45, 142, 187,
7, 57, 84, 169, 82, 192, 244, 191, 62, 62, 37, 25, 160, 141, 248, 147, 128,
236, 123, 64, 177, 110, 50, 39, 143, 73, 172, 35, 4, 15, 180, 101, 78, 46,
164, 35, 242, 70
]
seeds = [
9999, 1247, 5097, 7717, 7026, 8398, 961, 3156, 1271, 7473, 3669, 6716,
7550, 1426, 8065, 351, 738, 4057, 877, 4029, 7606, 1822, 7749, 7973, 9666,
5927, 7944, 1240, 8960, 443, 6349, 5949, 5913, 2332, 7255, 5185, 5504,
3499, 8855, 4183, 8812, 5865, 4147, 5091, 4556, 1968, 5589, 2481, 3411,
514, 589, 8078, 9590, 1765, 1009, 4415, 6603, 3978, 9215, 5307, 3804, 1141,
6691, 1760, 101, 7008, 6165, 9974, 1194, 3665, 7579, 1148, 5786, 6175,
1333, 7932, 8217, 9058, 5400, 6527, 6220, 1111, 4265, 208, 2191, 9706,
1019, 7249, 7644, 907, 5679, 3335, 3181, 5301, 4977, 2455, 724, 4447, 3566,
9161, 1289, 181, 3509, 6305, 8183, 4024, 2630, 131, 1822, 8918, 5595, 6849,
2555, 4221, 3023, 5828, 5622, 5812, 2378, 746, 3608, 822, 4856, 6987, 9977,
5289, 342, 5418, 9974, 5291, 6895, 9663, 3642, 2965, 8003, 5830, 6373,
3394, 8308, 6754, 4843, 2100, 1355, 5166, 601, 9987, 8921, 7563, 2250,
9056, 2873, 7479, 5508, 109
]
dp = ''
for i in range(len(seeds)):
random.seed(seeds[i])
rands = []
for j in range(4):
rands.append(random.randint(0, 255))
dp += chr(rands[i % 4] ^ res[i])
dp = int(dp)
e = 0x10001
n = 144573683990296079611135474661197492569962285163118264304760128514378450625043070474838075626723354220121948920313400664358341070757676498630899262349227958025807395866103391135742530910291132519036950667849498017553807524999532071920009738654477379676790400942232810106883328105428161410721145229679023998881
c = 140936410048438311250552166359315531524717850408136878422422753861467709727494132943441793325459384490656351395836085596063714127829696538515364822908513326788824368390411397265861249839989684310498194231709180660320399728106109349119244510966442534818280589033645304725341767217060885195904689618851168472021
for i in range(1, e):
if (dp * e - 1) % i == 0:
if n % (((dp * e - 1) // i) + 1) == 0:
p = ((dp * e - 1) // i) + 1
q = n // p
phi = (q - 1) * (p - 1)
d = gmpy2.invert(e, phi)
m = pow(c, d, n)
print(n2s(m))
random2
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]\xe7\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))
rsa1
from gmpy2 import *
from libnum import *
from sympy import Symbol, solve
n = 26305215103655644423271873654270896239286789695124090349749665534703077917412304839568833642664450313935099298310980853882272879981733372730292018544572625316902809164514982172181951319743072017697845536018391193871280565807620618786757590917994266113737303548654644579447152708491947981939693209377062932887079053535685222915049638973744785910187846488048054614595896905717548173503097932486976548606688284094985163387830871173351156872303901802063874643159872076045421856161697020709841563253543301088673347562874178275457662923268303751458373213379823091743254295392098852050657389100668196543581156089543387981749
s = 4323761888398018609852335503896306767680254689118307249919076945474100280053222216117890335097280655812579700210142850972114032619375512508094444700268269861295454361479936323488734938967486887087065985770337167952405916865514342667568344884512919390473013721005783345127779614050256684329541419938215219111638334871769224566807758669615177139619330644265349270609231736366888506999373399354453570974856230273436956657673552797254044789898850371608837651642705304346761776584170067536342839950077554921714223414452726231759701672899981770205900654174771977192152231671555687060576625055995576371428030016472160229195
c = 18524879875046454765780419291902161505187119049317257440202645362184543856980037891446139747396472606884190295519693050825702398302375035356073354030439092479076493350280491879942676232543272035009619776448668367631674751270025422471697604807309328948811730211796077194562605273068248003067084062604953180981092602825269082443194821795267533259542345280789423885313715011198756408238675212294964169231866750121782891392974982538883759460499654964916672646713561365268497621669918260512318121987464087203488943192447244656120553657904643768811055634526867642121977282747786019413676386087742587120310706285467632914627
s = invert(s, n)
p = Symbol('p')
q = Symbol('q')
p, q = solve([p*q-n, 1314*p-520*q-s], [p, q])[1]
p = int(p)
q = int(q)
e = 0x10001
d = invert(e, (p-1)*(q-1))
print(n2s(int(pow(c, d, n))))
rsa2
from gmpy2 import *
from libnum import *
n = 2387626545085756713585102877878108862015179080332961598635902226358817519910295819153349225103418927970241049968506375997
e = 65537
c_mod_p = 647648029783204084679833378591490303778808042166748545307033
c_mod_q = 716978243624820144982668239669070880505037391756433243913335
p = iroot(n, 2)[0]
for i in range(1000):
p -= 1
if is_prime(p):
q = next_prime(p)
if p * q == n:
break
d = invert(e, (p-1)*(q-1))
c = (c_mod_p*invert(q, p)*q + c_mod_q*invert(p, q)*p) % n
print(n2s(int(pow(c, d, n))))
rsa3
from gmpy2 import *
from random import *
from libnum import *
n = 18896787369812506729161146792420582463075195289705130332145125441873359008259477778705050612028016445531171582699463469223129134497144553118164991259539504187512021208315754514545996574862689888723728779368278057158884309498791988824815380906489884221955569016913002047690134495021638325076324337204120358289197345473645253964897309936634674685256494467965994763346209088569312900310384221856890129638589708704488570062170587822159840004471847429651335596065845176922611177484979368701185198370143451554032097774883881063941164928195206151285053023900417539545188981446823285592433963817981924569149446287916824382561
d = 5703031224919077324199739420591218709082873607810515782527403392203078685694557440606179655084946477198544985797529455998356213302699576058168444727748170549839026313064029609887624795981035801288838847172210685453187859645339376946854805971427795291607171515106310442975161667104581906887477593810523773846781119913091652230585316578697966956441025050411703279543735184615408372827086048067763849304020844971586419985599715291049252337301504847183917086038225366804009601071701854587257618991903027592792223359879103979050158387898497645317134119316587856020926045834487915948391807346208594166279941244305061329677
friend_keys = [111697, 106721, 116423, 88843, 119159, 70639, 80819, 74489, 121931, 101141]
c = 11994381627759026162899170243195205997473390753474105847444301599471367630328999329971554672898042711258332343414555886491105235450415874967500999777727188222201701790615800443999694661391161603608205580744046340685740132462956669428633202538875197708853419127000877908034155683418476839027176847825085191766500657063936087300707648173167638212184409940441341192494973780078520658057628747235702262261650533074207402665937459065342008813881483658655820794105733254390600096188629251786257035958039797032257689446780150685916517843665881340793492146980771808706103032498053602112046452376378597181639545983846067945876
e = 0x10001
def getpq(n, e, d):
while True:
k = e * d - 1
g = randint(0, n)
while k % 2 == 0:
k = k // 2
temp = pow(g, k, n) - 1
if gcd(temp, n) > 1 and temp != 0:
return gcd(temp, n)
p = getpq(n, e, d)
q = n // p
e = friend_keys[::-1]
for i in e:
d = invert(i, (p-1)*(q-1))
c = pow(c, d, n)
print(n2s(int(c)))
rsa4
from gmpy2 import *
from libnum import *
n = 18344208622226145563275332631675852812637974117269410580356372484730868630041087771967863177399468436907179629991713287958712918155881322973807806301979120718337971766642141160715457959104230009865832490334268400708057378872793969706058766934173901720807601381260226109710528613914848911497044918273137096903522367120819016923613011696956531078735040866726836147244627617752866449680818575750555372925099203864465221467261643732258403282300830500857008951036100240417305652712966271750963365056888669691476588673457169183575547654173584411488289083479722447529687480093984214874840116386641308648928664471249163053399
c = 5799835212682670854600787421394304700766812650929331808305024781919809808414116741938033087654173522429848434831011913540857883976763801585735031494044357475999623804769581806159695530735320829983994397494910262812269266183428964227240479098342185016875916463463869275180539449912347431388217372994987664171819970167145891087464365899986673967607036447794731478364868669512779723692729123522060403205286021628536236794321362684707698114447595523828110511521587142146690874947566042115081767036515192408523157587036063428678576881221634685127738856946514330198100929281963428110917369571549814920857266365740708152342
e = 0x10001
p = gcd(n, c)
q = n // p
d = invert(e, (p-1)*(q-1))
print(n2s(int(pow(c, d, n) // p // 2021 // 1211)))
rsa5
from gmpy2 import *
from libnum import *
n = 89114498420780604917531033169596392769455738343415866175560827716329038325885040230287167130153562721085218031290598924393710777384195303868086861588496841776165960494754159665639269842671254641757507534815336115279112577992964099982530678699389798633559364922445110277096686903849847611549099340416648410741
c1 = 5735952141642500488957438428695439035757844707618704182655499843027856939311070755815954816072248816712526137792678092545003791094632649549645878951707384683857212799418894784114432305066187852999119421690587457065466839964716069311139937099286027346944058896149918834128185367804403864368930212475453509851
c2 = 83661280370185647448453005460717066890991000188427326405001096935902371566724181207272659273801621639886691480155364009831593695466677783865595971645100536369801815619337129766823938463338128554716970036817952870569822208326583141745930557453969795334892493524974870629590649696998539807821542822600655060074
e1 = 65536
e2 = 270270
s = gcdext(e1, e2)
s1 = s[1]
s2 = s[2]
if s1 < 0:
s1 = -s1
c1 = invert(c1, n)
elif s2 < 0:
s2 = -s2
c2 = invert(c2, n)
m = pow(c1, s1, n) * pow(c2, s2, n) % n
m = iroot(m, gcd(e1, e2))[0]
print(n2s(int(m)))
rsa6
# sage
from Crypto.Util.number import *
c = 7925347972369425166024054435177230521701403766897655936389976238335255023323703665687524237012185378041937237193923196710161053156355234066441645319711183701842329620157704166371157650717222839619648271152128682372913126096365783687520564982937168484788081317675474463083132784582384187507869255885228857467817831476035971705449862080689947994230445839759775090629780928956469253251286916417455655651048075284914909735365261929381321728491210171149534927100638988443996951222567422983340301657352071004491710550791174969744159251674787486029098454525075603086354538724909971206057136959433644905534281024876827756696137754971560173166243058604302626662055704726217622510459832665465892627420770569017615057586162821398601805202941141301996106309483845544353310688985128566888120627304619788965507172962378342832673025236542745105311081361289182947417363008698994494622282298082815746490101801126669328319034060270856334194300252718523432106663273533374335697785044530801700554935518675122267487553622164033394485640597163056563842371857031514865235177157462198413279830879705708485929558610831286243249229145583827781884735083543818839971554442994288987473842873588257719658328581033891822672997846833635917945202914668666249069209
N = 327704199063655154339194866047748377300483661546348646619543042402260458534101350044000928583250118734194187256215886625771489682622806492392158515139856977282405831771426953889407535449903946471081769989651651591222623997395529035591781660724645156930487601579241488206427939500937938255588575188735472745545946966631822161787569690670592431700668322671046133380934851245111908808167859798212265435088714280150547423032692815776965063410936310739819923896759441335001874930520763236975226711207654895127866843378461328154795776319242290600812698882674645791266238574096744538101900116337068936957681128459670057096430909525261047967406584507167977208793797870831858199445206260549902066723878612723426168458993576999172766781960053959813246897054556640370355234535221471564607870502627719243185861171079980645221020435603883953809425799723857745727457620742919434348781413514988026742127568571934186958953140598517500511323011929458037325804993377002532922851586492715993738894057370890612824581248076082409851337738126905208244299232520865145447167051764102587067960512092944943632792165293701233755265831135001570237083525408605939160927853199431652266761149838259483979450360702066085191758469080084577999970704509262494734276631
e1 = 113093816717144841270493376736752441673022256694148583901036760385290294469429291287395932962657459627279948131588586212784590640516333875415213429718659370434377813079419901793552309461703882586527503420999488191213528380154291270445702806410792319417099800769397301837093257916765727595155732721396733301006197816845511287287300240373894663383088203656193754454195781571647148298850615901090657526494250418115895409707363373152838151538570469978232752856573089149548109243765929129792122940993776991512134978235283946198861884114007985343254462515565194689101887047325062995222232830812585485386335674066695574712424013748788932584416194906037669948036361191560447424191340446408227050317480535979753006991332324053550385053870295648784077492339350541225982286056281016618014141105366605422149895221611592416532345771815704307846206281439784932410973601384402414039900782254330313269415078960064305344681778478762050176778461863907418405687378915582516510150832198276943089812715818203025913800315465878924192853193803827276622946514235810979197716378589261982901063684489176009723390727783448898996904743318965120718829513279206531437783722261301609689797505310206968838386508504975439758618002450017650730285740872724819939789165
e2 = 52078480224223317668569462543933564802023331503631866060760905823225375689371194081168967121103174053841803074696022983040703342927472417376159406035704091279470236253461384492704221051191760736060554344469790547031831005280443071825906849136068345545676606027290833620827164313993131618431323752276734358952300945077463041766652124937491934577599675761171103129304421215868699904698815021459210815711145905970197203457821690991062538955208578611369077013345454745776462370445888778852408762328672347603381098296861114748964667016949680885383533471825896084968002739256577852020182053683898979088285241943075282763120057336283443785884582655033693855047579690620713987723203443968343939397180233749872965864492970538352607580127433388577728197382785447538830263277945571714749460381851739146671950305422054343439472788329964959190357803126824073890041111240661865272585084722373190936827940607158935817277773095693778187682594957687156914929123683762234852584982077245872009863739187381156755686726633110551567659009061033997083241163551489323473968854060108298085327929582165884662155874639976829347066561636002017516485007419416446064739412984229663151827434850017915971108388331662865610040555809970494140145365617095067391830661
a = 0.198 # 811./4097
M1 = N**0.5
M2 = N**(a + 1)
D = diagonal_matrix(ZZ, [N, M1, M2, 1])
M = matrix(ZZ, [[1, -N, 0, N**2], [0, e1, -e1, -e1 * N], [0, 0, e2, -e2 * N],
[0, 0, 0, e1 * e2]]) * D
L = M.LLL()
t = vector(ZZ, L[0])
x = t * M**(-1)
phi = int(x[1] / x[0] * e1)
d = inverse(0x10001, phi)
m = pow(c, d, N)
print(long_to_bytes(m))