
BKISC LCG in LCG
1. Đề bài
from Crypto.Util.number import *
import random
FLAG = b"BKISC{REDACTED}"
SIZE = 10
p = getPrime(256)
list_ab = [(random.randint(1,p),random.randint(1,p)) for _ in range(SIZE)]
class LCG:
def __init__(self,seed):
self.p_shuffle = 100012367912491304950970537118525513361574730061518925742496715244134368935279
self.a_shuffle = 94671321777649901144236237096963884182038803186726157270932012072190410389427
self.b_shuffle = 64123254129311387582805351522310702500911175067175029340692470572851876649363
self.seed_shuffle = getPrime(256)
self.m = p
self.s = seed
self.curr = random.randint(0, SIZE - 1)
def next(self):
a,b = list_ab[self.curr]
self.s = (a * (self.s) + b) % self.m
self.seed_shuffle = (self.a_shuffle * self.seed_shuffle + self.b_shuffle) % self.p_shuffle
self.curr = self.seed_shuffle % SIZE
return self.s
s = getPrime(256)
c = LCG(s)
leak = [c.next() for _ in range(30)]
ct = [(c.next() & 0xFF) ^ FLAG[i] for i in range(len(FLAG))]
print(f"p = {p}")
print(f"leak = {leak}")
print(f"ct = {ct}")
# p = 109293690254125700593428833253859351747207544427596641988902897826726923108129
# leak = [90932320403583933388104590731426350182475714444529235922632654547630050547854, 7419001973708127101952065444933291168381819947297996667304118571827819593833, 67898657390352222099145776514702065237791087004192011316965425093842698547879, 59104346122377345147160947908393133350394990600375907640957883201712863161514, 65791268128235538218159841829641838780085430662646571477813528156670949468574, 30746596701904608663428779065775617660959514980181049138973990539351151163398, 90401086830823038866772268939325153317251259153444707025916388656856331751223, 58272077154494735088853274292736003691073242782827315949821851312399207553921, 2436351101341565181224132398898435947850914144805010798831033314744304065906, 60037930506906075080157529686240388137679026846211607176962484455269373425792, 94603418212790651171053589169233166073715690379203194716340883392985882958728, 40083135504675462463890729594467413366841384941611263958817813623602970950139, 87423735720908548570287620670610997539974220708226253072012896399717805881915, 90068696477808774338018715050496670423314532057245370376629814966590792334138, 85125353608712750771947916413431128173570267602118896397591754906948853457159, 103572197428666464527548288713740517562031762481709127346013361939366060409462, 43369712552829683498588001109740718097054089477610970275193450254188936367127, 93391039302254883112884682942395960326495980261895255005297213996980004965042, 106127175177601840953317451864979451638562623954667122658489723938111108742444, 57117890321834374388608137881909634607470441609846105637468499778163706812815, 108323133963731727447343134032705836190493323038407099159328543077938215447190, 46197978915634272286652335254378306194009148494353844230660614155269659323322, 61275120371350337137606775044861934316845211969342945868270767375887012067459, 105141796923903181156301351545814195231944808346151426835750813084215216036478, 63497969937675382864122605069019472859395334014001110878786173999903860090108, 103978872184469065639739458101313148437273147029754778075306257583387456083595, 88133118544204664892482510421866229283075324748199288179327177640559110484643, 105178940818406923446634762159331510677921686411620687829854838850860667935623, 84382472730499115614151805092165372226815632887388603663091724929767632086870, 46706679512967527627325203221385581068492266844734511449576209129559487807899]
# ct = [110, 209, 242, 199, 22, 17, 34, 12, 40, 226, 163, 109, 190, 116, 178, 134, 146, 192, 47, 29, 33, 240, 253, 185, 170, 139, 245, 74, 155, 16, 128, 167, 186, 75, 141, 100]
2. Phân tích
Hàm LCG với mục đích sinh ra các số ngẫu nhiên
$$s_{i+1}=a*s_i+b \pmod p$$Trong đó,
- $$p = 109293690254125700593428833253859351747207544427596641988902897826726923108129$$là một số nguyên tố

- $a,b$ là các phần tử được lấy từ danh sách
list_abgồm 10 cặp $(a,b)$ là các số nguyên ngẫu nhiên nhỏ hơn $p$, theo quy luật xáo index:
self.seed_shuffle = (self.a_shuffle * self.seed_shuffle + self.b_shuffle) % self.p_shuffle
self.curr = self.seed_shuffle % SIZE
Ta có $leak$ là danh sách 30 số được tạo liên tiếp từ hàm LCG.
FLAG được mã hóa bằng cách XOR từng kí tự của FLAG với các số được sinh ngẫu nhiên từ hàm LCG ( liên tiếp với các số của tập $leak$ )
Để khôi phục được FLAG ta cần tìm ra quy luật sinh số của hàm LCG, hay tìm được 10 cặp (a,b) của list_ab và quy luật xáo index.
3. Khai thác
Ta có hàm LCG
$$s_{i+1}=a*s_i+b \pmod p$$
Vì có 10 bộ (a,b) được sử dụng mà leak cho biết được 30 giá trị khác nhau được sinh ra từ hàm, nên có tồn tại ít nhất 1 bộ (a,b) được sử dụng nhiều hơn 1 lần.
Với 1 bộ (a,b) được sử dụng 2 lần, ta lặp được mối quan hệ:
$$ \begin{aligned} \begin{cases} a*X_i+b \equiv X_{i+1} \pmod p\\ a*X_j+b \equiv X_{j+1} \pmod p \end{cases} \end{aligned} $$$\implies a*(X_i-X_j) \equiv (X_{i+1}- X_{j+1})\pmod p$
$\implies a\equiv (X_{i+1}- X_{j+1})*(X_i-X_j)^{-1}\pmod p$
Khi đó: $b \equiv X_{i+1} -a*X_i\pmod p$
Vậy với 2 cặp số liên tiếp được sinh ra từ hàm LCG với cùng 1 bộ (a,b) ta có thể khôi phục được bộ (a,b) đó.
Tính các bộ (a,b) từ 2 cặp số liên tiếp trong tập leak, sau đó duyệt lấy các bộ lặp lại
from collections import Counter
p = 109293690254125700593428833253859351747207544427596641988902897826726923108129
leak = [
90932320403583933388104590731426350182475714444529235922632654547630050547854,
7419001973708127101952065444933291168381819947297996667304118571827819593833,
67898657390352222099145776514702065237791087004192011316965425093842698547879,
59104346122377345147160947908393133350394990600375907640957883201712863161514,
65791268128235538218159841829641838780085430662646571477813528156670949468574,
30746596701904608663428779065775617660959514980181049138973990539351151163398,
90401086830823038866772268939325153317251259153444707025916388656856331751223,
58272077154494735088853274292736003691073242782827315949821851312399207553921,
2436351101341565181224132398898435947850914144805010798831033314744304065906,
60037930506906075080157529686240388137679026846211607176962484455269373425792,
94603418212790651171053589169233166073715690379203194716340883392985882958728,
40083135504675462463890729594467413366841384941611263958817813623602970950139,
87423735720908548570287620670610997539974220708226253072012896399717805881915,
90068696477808774338018715050496670423314532057245370376629814966590792334138,
85125353608712750771947916413431128173570267602118896397591754906948853457159,
103572197428666464527548288713740517562031762481709127346013361939366060409462,
43369712552829683498588001109740718097054089477610970275193450254188936367127,
93391039302254883112884682942395960326495980261895255005297213996980004965042,
106127175177601840953317451864979451638562623954667122658489723938111108742444,
57117890321834374388608137881909634607470441609846105637468499778163706812815,
108323133963731727447343134032705836190493323038407099159328543077938215447190,
46197978915634272286652335254378306194009148494353844230660614155269659323322,
61275120371350337137606775044861934316845211969342945868270767375887012067459,
105141796923903181156301351545814195231944808346151426835750813084215216036478,
63497969937675382864122605069019472859395334014001110878786173999903860090108,
103978872184469065639739458101313148437273147029754778075306257583387456083595,
88133118544204664892482510421866229283075324748199288179327177640559110484643,
105178940818406923446634762159331510677921686411620687829854838850860667935623,
84382472730499115614151805092165372226815632887388603663091724929767632086870,
46706679512967527627325203221385581068492266844734511449576209129559487807899,
]
AB = Counter()
for i in range(len(leak)-1):
for j in range(i+1,len(leak)-1):
a= (leak[i+1]-leak[j+1])*pow((leak[i]-leak[j]),-1,p)%p
b= (leak[i+1]-a*leak[i])%p
AB[(a,b)]+=1
list_ab = [ab for ab, cnt in AB.items() if cnt >= 2]
print(list_ab)
print(len(list_ab))
list_ab=[(82706704415414188354150349294664166659268852193707118721220574811483037134821, 57465858056096164589856300882070929859968379460910254001839822731670671964674), (45994193598761934945504940085567634526320669710586611941702331277047628423102, 73530239670608085721327211336674916720723230224835048497780807102618394263050), (64702578000992053513837753598836806328891156107512673956499631645524885550167, 57261972574476025918526457772935614105201216371647537829115891571625360105382), (26516898768098951538537004580010898043587981705886604305149700172550303687085, 105813669037626758429026513456768315990497484128455369631119933211539353233718), (10181932390606342984797619314056651327552025596130508844556750778309945230126, 78503692429730677142059750239398258877609501588065487476091196868671137924247)]
len(list_ab)=5
Ta duyệt thêm 1 vòng, lưu lại thứ tự áp dụng của từng bộ (a,b)
Vitri_ab=[]
for a,b in list_ab:
vitri=[ i for i in range(len(leak)-1) if (a*leak[i]+b)%p==leak[i+1]]
Vitri_ab.append((a,b,vitri))
Vitri_ab=
[(82706704415414188354150349294664166659268852193707118721220574811483037134821, 57465858056096164589856300882070929859968379460910254001839822731670671964674, [0, 7, 14, 21, 28]), (45994193598761934945504940085567634526320669710586611941702331277047628423102, 73530239670608085721327211336674916720723230224835048497780807102618394263050, [1, 4, 5, 8, 11, 12, 15, 18, 19, 22, 25, 26]), (64702578000992053513837753598836806328891156107512673956499631645524885550167, 57261972574476025918526457772935614105201216371647537829115891571625360105382, [2, 9, 16, 23]), (26516898768098951538537004580010898043587981705886604305149700172550303687085, 105813669037626758429026513456768315990497484128455369631119933211539353233718, [3, 10, 17, 24]), (10181932390606342984797619314056651327552025596130508844556750778309945230126, 78503692429730677142059750239398258877609501588065487476091196868671137924247, [6, 13, 20, 27])]
Ta thấy thứ tự áp dụng các bộ (a,b) có quy luật. Mỗi bộ được áp dụng lại sau 7 lượt. Cụ thể khi lấy dư cho 7:
- Bộ t1: (82706704415414188354150349294664166659268852193707118721220574811483037134821,57465858056096164589856300882070929859968379460910254001839822731670671964674)
[0, 7, 14, 21, 28] đồng dư với 0 khi chia cho 7 - Bộ t2:
(45994193598761934945504940085567634526320669710586611941702331277047628423102, 73530239670608085721327211336674916720723230224835048497780807102618394263050)
[1, 4, 5, 8, 11, 12, 15, 18, 19, 22, 25, 26] đồng dư với 1 hoặc 4 hoặc 5 khi chia cho 7 - Bộ t3: (64702578000992053513837753598836806328891156107512673956499631645524885550167, 57261972574476025918526457772935614105201216371647537829115891571625360105382) [2, 9, 16, 23] đồng dư với 2 khi chia cho 7
- Bộ t4: (26516898768098951538537004580010898043587981705886604305149700172550303687085, 105813669037626758429026513456768315990497484128455369631119933211539353233718) [3, 10, 17, 24] đồng dư với 3 khi chia cho 7
- Bộ t5(10181932390606342984797619314056651327552025596130508844556750778309945230126, 78503692429730677142059750239398258877609501588065487476091196868671137924247) [6, 13, 20, 27] đồng dư với 6 khi chia cho 7
Vậy khi xét số dư của số thứ tự 1 vị trí khi chia cho 7 ta có thể biết được bộ (a,b) được áp dụng cho hàm LCG ở lần sinh số tại vị trí đó.
Từ đó ta có thể hoàn toàn biết được quy luật, tính được các số sinh ra từ hàm LCG và khôi phục lại FLAG.
p = 109293690254125700593428833253859351747207544427596641988902897826726923108129
s = 46706679512967527627325203221385581068492266844734511449576209129559487807899
ct = [110, 209, 242, 199, 22, 17, 34, 12, 40, 226, 163, 109, 190, 116, 178, 134, 146, 192, 47, 29, 33, 240, 253, 185, 170, 139, 245, 74, 155, 16, 128, 167, 186, 75, 141, 100]
t1 = (82706704415414188354150349294664166659268852193707118721220574811483037134821, 57465858056096164589856300882070929859968379460910254001839822731670671964674)
t2 = (45994193598761934945504940085567634526320669710586611941702331277047628423102, 73530239670608085721327211336674916720723230224835048497780807102618394263050)
t3 = (64702578000992053513837753598836806328891156107512673956499631645524885550167, 57261972574476025918526457772935614105201216371647537829115891571625360105382)
t4 = (26516898768098951538537004580010898043587981705886604305149700172550303687085, 105813669037626758429026513456768315990497484128455369631119933211539353233718)
t5 = (10181932390606342984797619314056651327552025596130508844556750778309945230126, 78503692429730677142059750239398258877609501588065487476091196868671137924247)
cycle = [t1, t2, t3, t4, t2, t2, t5]
flag = bytearray()
for i, c in enumerate(ct):
a, b = cycle[(29 + i) % 7]
s = (a * s + b) % p
flag.append((s & 0xFF) ^ c)
print(flag.decode())
Flag:
BKISC{0h_n0_cycl1c_lc6_br34k_my_lc6}
DE XAM LOZ
1. Đề bài
from Crypto.Util.number import *
from functools import reduce
from operator import mul
flag = ?
target = bytes_to_long(flag)
def oracle(t):
return t[0](t[1], t[2], t[3])
def shadow(v, m):
return v % m
def lift(v):
return v - 1
def gate(e, p):
return inverse(e, lift(p))
def fold(arr):
return reduce(mul, arr, 1)
g = [
126256,
222182477,
5
]
h = [
2707559,
391208159,
18060998312408658853
]
sink = 7363377006095743807
u = ?
v = ?
w = ?
chain = [
(pow, g[0], u, h[0], v),
(pow, g[1], v, h[1], w),
(pow, g[2], w, h[2], sink)
]
for box in chain:
lhs = oracle(box[:4])
rhs = box[4]
if box[3] != h[2]:
assert lhs == shadow(rhs, box[3])
else:
assert lhs == rhs
assert fold([gate(u, h[0]), gate(v, h[1]), gate(w, h[2])]) == target
#hint = YsOgaSB24buhIGzDsm5nLCBj4bqnbiBjaMOzIGfDrCBoaW50LiBkbHAuLi4=
Agury
1. Đề bài
import hashlib
stored_data = {}
def generate_keystream(i):
return (i * 3404970675 + 3553295105) % (2 ** 32)
def upload_file():
print("Choose a name for your file")
name = input()
if name in stored_data:
print("There is already a file with that name")
return
print("Remember that your privacy is our top priority and all stored files are encrypted.")
print("Choose a password")
password = input()
m = hashlib.shake_128()
m.update(password.encode())
keystream = int.from_bytes(m.digest(4), byteorder="big")
print("Now upload the contents of your file in hexadecimal")
contents = input()
b = bytearray(bytes.fromhex(contents))
for i in range(0, len(b), 4):
key = keystream.to_bytes(4, byteorder="big")
b[i + 0] ^= key[0]
if i + 1 >= len(b):
continue
b[i + 1] ^= key[1]
if i + 2 >= len(b):
continue
b[i + 2] ^= key[2]
if i + 3 >= len(b):
continue
b[i + 3] ^= key[3]
keystream = generate_keystream(keystream)
stored_data[name] = b
print("Your file has been uploaded and encrypted")
def view_files():
print("Available files:")
for i in stored_data.keys():
print(i)
print("Choose a file to get")
name = input()
if name not in stored_data:
print("That file is not available")
return
print(stored_data[name].hex())
def main():
print("Welcome to Augury")
print("The best place for secure storage!")
while True:
print("Please select an option:")
print("1. Upload File")
print("2. View Files")
print("3. Exit")
choice = input()
match choice:
case "1":
upload_file()
case "2":
view_files()
case "3":
exit()
main()
Mandatory RSA
1. Đề bài
n = 30610867131545893573245403370929044810375908252345734515216335567761070674235240557970829245356614030481955825874376565524126172250295479286829004996105122106474627414932278394880727207687247106535964451736524423676062227917939094755601312619938974463767105253817030590414646900543888347805544511989816392901347341338737906837896070023751031260815782973250734600300683094949304509692321753534435264794596296780586539085130232106649876660029506699244567866816756904364396378546670735017278059889632347338673055259053699246622809620909022329749464060132071464884484682112534813343645706384624586841979729464134335809829
e = 13118943056376811531390887158969590633018246393862457649378429529040458860386531667701783962295691727349409639660447099510339788107269491122926716426902195188489126034970976454948883089008820188515413336458510467289740954821973897752400562551402417627328759394493013110177705814518809291916661933709921311243284600780240090861401353930215487292827235572235250164436683130292475464090785626013810206032736933354696930489144983575446495078404329829091193678240029445525658582548485531996972340914370823232033916046942293331266006647674886928834212203547468218609381456317192256524737280398698305720035095438106008915543
c = 18491889164810617543569456750416875989184817880137548014973592642069416208831086398288449741333647958301433206462225905089767171227296166302076329585813204145393998300807912284373441125769784091235480355305999860836226228064817001671079683866140595167104080925862489688205706558563994071054217252661751197090938128540101902284587959897970686920835999487758527543265902558413502613239565915919268373782402562042295965144636399280059309987259722405692758942811072888497222424752062745376152606372092707679048892146955016482797824514120865462676167840311292744307891590740707933408465096337716317714272609074408402855672
2. Phân tích
Ta để ý thấy public key $e$ là một số rất lớn, gần với $n$, suy ra private key $d=e^{-1} mod(phi_n)$ là một số nhỏ.
Ta có thể sử dụng Low Private Component Attacks: Wiener’s Attack
Tham khảo: https://cryptohack.gitbook.io/cryptobook/untitled/low-private-component-attacks/wieners-attack
3. Lời giải
from Crypto.Util.number import long_to_bytes
def wiener(e, n):
# Convert e/n into a continued fraction
cf = continued_fraction(e/n)
convergents = cf.convergents()
for kd in convergents:
k = kd.numerator()
d = kd.denominator()
# Check if k and d meet the requirements
if k == 0 or d%2 == 0 or e*d % k != 1:
continue
phi = (e*d - 1)/k
# Create the polynomial
x = PolynomialRing(RationalField(), 'x').gen()
f = x^2 - (n-phi+1)*x + n
roots = f.roots()
# Check if polynomial as two roots
if len(roots) != 2:
continue
# Check if roots of the polynomial are p and q
p,q = int(roots[0][0]), int(roots[1][0])
if p*q == n:
return d
return None
# Test to see if our attack works
if __name__ == '__main__':
n = 30610867131545893573245403370929044810375908252345734515216335567761070674235240557970829245356614030481955825874376565524126172250295479286829004996105122106474627414932278394880727207687247106535964451736524423676062227917939094755601312619938974463767105253817030590414646900543888347805544511989816392901347341338737906837896070023751031260815782973250734600300683094949304509692321753534435264794596296780586539085130232106649876660029506699244567866816756904364396378546670735017278059889632347338673055259053699246622809620909022329749464060132071464884484682112534813343645706384624586841979729464134335809829
e = 13118943056376811531390887158969590633018246393862457649378429529040458860386531667701783962295691727349409639660447099510339788107269491122926716426902195188489126034970976454948883089008820188515413336458510467289740954821973897752400562551402417627328759394493013110177705814518809291916661933709921311243284600780240090861401353930215487292827235572235250164436683130292475464090785626013810206032736933354696930489144983575446495078404329829091193678240029445525658582548485531996972340914370823232033916046942293331266006647674886928834212203547468218609381456317192256524737280398698305720035095438106008915543
c = 18491889164810617543569456750416875989184817880137548014973592642069416208831086398288449741333647958301433206462225905089767171227296166302076329585813204145393998300807912284373441125769784091235480355305999860836226228064817001671079683866140595167104080925862489688205706558563994071054217252661751197090938128540101902284587959897970686920835999487758527543265902558413502613239565915919268373782402562042295965144636399280059309987259722405692758942811072888497222424752062745376152606372092707679048892146955016482797824514120865462676167840311292744307891590740707933408465096337716317714272609074408402855672
d = wiener(e,n)
assert not d is None, "Wiener's attack failed :("
print(long_to_bytes(int(pow(c,d,n))).decode())
Flag: QnQSec{I_l0v3_Wi3n3r5_@nD_i_l0v3_Nut5!!!!}
RSA
1. Đề bài
n=989703043570445463469486943487458992469322682987398749837934876943920324463546542703927475017782753339534782263176270557157748270127933820627347205555887565121349238039486916840649690150950123001219761331478064359568734543564566491291374825379768659217818594729774324790140556588673996421631130095058585156110240175732123834247345114478225674519390976760220226564748683843416777702868966330062110577729370942732700112117012199377577031914674987484622887130155979964711529028928133723889885875232684486804769419759304689068182487095637841800961744168048878817025114756602390584079690739364616334089485875166284746138538243834164107893754869149604857368280500516782089537048642152263561330006733883108909888320204154578547336531639971029046942905499622380250717716533889901092458402842132812065382917678494027962363912900556900697544561037792700579625102597001823503133710589129784937686401986357976699628417873693600168671978173415972333179822783674816250289210405665892805747270838732390394103143071618399104102986827930459797855579869221127765721608008213485687325939134522223542030943504244236769204636948293692133305421239245314830819884299819631960290299332637877226965859133200427043646781982648031019004719844929163168411471179140377120057603149930635307509410961145644529699996018996900638925758128902466757993121291541258297348101770040578180436006481037181090168886867651144128466536237200157269643676605380465798536248266894803299345101581546176717014932741470912438757085887757038015249675819740295410156254532353
c=4790470457738950037547359485427039274750177827533395347822631762705571577482701279338206273472055558875651213492380394869168406496901509501230012197613314780643595687612644500027189129137482537976865921781859472977432479014055658867399642163113009505858515611024017573212383424734511447822567451939097676022022656474868384341677770286896633006211057772937094273270011211701219937757703191467498748462288713015597996471152902892813372388988587523268448680476941975930468906818248709563784180096174416804887881702511475660239058407969073936461633408948587516628474613853824383416410789375486914960485736828050051678208953704864215226356133000673388310890988832020415457854733653163997102904694290549962238025071771653388990109245840284213281206538291767849402796236391290055690069754456103779270057962510259700182350313371058912978493768640198635797669962841787369360016867197817341597233317982278367481625028921040566589280574727083873239039410314307161839910410298682793045979785557986922112776572160800821348568732593913452222354203094350424423676920463694829369213330542123924531483081988429981963196029029933263787722696585913320042704364678198264803101900471984492916316841147117914037712005760314993063530750941096114564452969999601899690063892575812890246675799312129154125829734810177004057818043600648103718109016888686765114412846653623720015726964367660538046579853624826689480329934510158154617671701493274147091243875708588775703801524967581974029541015625
e=18
2. Phân tích
Khóa công khai $e=18$ là một số nhỏ, nên nếu $plaintext$ không quá lớn $plaintext^e< n$, phép lấy $\pmod n$ sẽ không làm thay đổi giá trị của $plaintext^e$. Nếu vậy, ta có thể lấy căn trực tiếp $ciphertext$ để khôi phục $plaintext$.
Dùng hàm iroot của thư viện gmpy2 để kiểm tra phép lấy căn có trả về kết quả nguyên không, nếu có thì dịch bytes để lấy lại flag.
3. Lời giải
from gmpy2 import iroot
from Crypto.Util.number import long_to_bytes
n=989703043570445463469486943487458992469322682987398749837934876943920324463546542703927475017782753339534782263176270557157748270127933820627347205555887565121349238039486916840649690150950123001219761331478064359568734543564566491291374825379768659217818594729774324790140556588673996421631130095058585156110240175732123834247345114478225674519390976760220226564748683843416777702868966330062110577729370942732700112117012199377577031914674987484622887130155979964711529028928133723889885875232684486804769419759304689068182487095637841800961744168048878817025114756602390584079690739364616334089485875166284746138538243834164107893754869149604857368280500516782089537048642152263561330006733883108909888320204154578547336531639971029046942905499622380250717716533889901092458402842132812065382917678494027962363912900556900697544561037792700579625102597001823503133710589129784937686401986357976699628417873693600168671978173415972333179822783674816250289210405665892805747270838732390394103143071618399104102986827930459797855579869221127765721608008213485687325939134522223542030943504244236769204636948293692133305421239245314830819884299819631960290299332637877226965859133200427043646781982648031019004719844929163168411471179140377120057603149930635307509410961145644529699996018996900638925758128902466757993121291541258297348101770040578180436006481037181090168886867651144128466536237200157269643676605380465798536248266894803299345101581546176717014932741470912438757085887757038015249675819740295410156254532353
c=4790470457738950037547359485427039274750177827533395347822631762705571577482701279338206273472055558875651213492380394869168406496901509501230012197613314780643595687612644500027189129137482537976865921781859472977432479014055658867399642163113009505858515611024017573212383424734511447822567451939097676022022656474868384341677770286896633006211057772937094273270011211701219937757703191467498748462288713015597996471152902892813372388988587523268448680476941975930468906818248709563784180096174416804887881702511475660239058407969073936461633408948587516628474613853824383416410789375486914960485736828050051678208953704864215226356133000673388310890988832020415457854733653163997102904694290549962238025071771653388990109245840284213281206538291767849402796236391290055690069754456103779270057962510259700182350313371058912978493768640198635797669962841787369360016867197817341597233317982278367481625028921040566589280574727083873239039410314307161839910410298682793045979785557986922112776572160800821348568732593913452222354203094350424423676920463694829369213330542123924531483081988429981963196029029933263787722696585913320042704364678198264803101900471984492916316841147117914037712005760314993063530750941096114564452969999601899690063892575812890246675799312129154125829734810177004057818043600648103718109016888686765114412846653623720015726964367660538046579853624826689480329934510158154617671701493274147091243875708588775703801524967581974029541015625
e=18
m, is_correct= iroot(c,e)
if is_correct:
flag=long_to_bytes(int(m)).decode()
print(flag)
Flag:
tachyon{R$4_crypt0gr4phy_i$_e4sy!}
