varMessages = { START: { title: getLevelString, text: function () {return'CLICK TO BEGIN';} }, CRASH: { title: function () {return'CRASHED';}, text: function () {return'CLICK TO RETRY';} }, GAME_OVER: { title: function () {return'GAME OVER';}, text: function () {return'CLICK TO START AGAIN';} }, FINISH: { title: function () {return'LEVEL COMPLETED';}, text: function () {if (mLevel === 6) {return'GOT F|L|A|G {y0u_w1n_th1s_!!!}';} else {return'CLICK TO CONTINUE';}}, } };
Crypto
大部分题实在是太简单了水一下,一些简单题我认为应该进misc充数。
Hex?Hex!
如果你也和我一样知道hex的话,那我觉得,这件事,太酷啦!
附件:4c69744354467b746169313131636f6f6c6c616161217d
直接hex解码得到flag。
梦想是红色的
自由友善公正公正敬业法治自由自由和谐平等自由自由公正法治诚信民主……
核心价值观编码。
原来你也玩原神
旅行者收到了一封奇怪的来信,是提瓦特大陆的语言!
提瓦特通用字母表,最后一行一眼flag,直接对照得到flag。
家人们!谁懂啊,RSA签到都不会
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
from Crypto.Util.number import * from secret import flag
m = bytes_to_long(flag) p = getPrime(512) q = getPrime(512) e = 65537 n = p*q c = pow(m,e,n) print(f'p = {p}') print(f'q = {q}') print(f'c = {c}') ''' p = 12567387145159119014524309071236701639759988903138784984758783651292440613056150667165602473478042486784826835732833001151645545259394365039352263846276073 q = 12716692565364681652614824033831497167911028027478195947187437474380470205859949692107216740030921664273595734808349540612759651241456765149114895216695451 c = 108691165922055382844520116328228845767222921196922506468663428855093343772017986225285637996980678749662049989519029385165514816621011058462841314243727826941569954125384522233795629521155389745713798246071907492365062512521474965012924607857440577856404307124237116387085337087671914959900909379028727767057 '''
给pq了,直接解就出。
yafu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
from Crypto.Util.number import * from secret import flag
m = bytes_to_long(flag) n = 1 for i inrange(15): n *=getPrime(32) e = 65537 c = pow(m,e,n) print(f'n = {n}') print(f'c = {c}') ''' n = 15241208217768849887180010139590210767831431018204645415681695749294131435566140166245881287131522331092026252879324931622292179726764214435307 c = 12608550100856399369399391849907846147170257754920996952259023159548789970041433744454761458030776176806265496305629236559551086998780836655717 '''
n由小质数生成,yafu能爆,但是实际上我觉得用totient直接出phi才是最快的方法。
factordb
1 2 3
e = 65537 n = 87924348264132406875276140514499937145050893665602592992418171647042491658461 c = 87677652386897749300638591365341016390128692783949277305987828177045932576708
flag=b'LitCTF{md5can3derypt213thoughcrsh}' n='496603d6953a15846cd7cc476f146771' book=string.ascii_lowercase+string.digits c1='LitCTF{md5can' c2='3de' c3='rypt213thoughcr' c4='sh}' for a in book: for b in book: for c in book: for d in book: k=c1+a+d+c2+b+c3+c+c4 m=hashlib.md5(k.encode()).hexdigest() if m==n: print('flag : ',k)
for i inrange(len(cipher)): if i % 2 == 0: cipher_code = ord(cipher[i]) plain_code = cipher_code - i flag += chr(plain_code) else: cipher_code = ord(cipher[i]) plain_code = cipher_code + i flag += chr(plain_code)
Ysexj lrk rzmkses os wilj hhks joa rtsy xzmktye yt xuim ehgy joa ofsz blnz yz pohv tnjx fxtx yuzc dxjlmy fyd nzr tnjx fuw cegq! Orkfx wnfe yuz haty eo jwpas;lz wnjce etf wgse tu lz;bk bsaz dzu cfyt zt me,hjnaaxp yuz sabj znrd znk qtfk fyd usp cnfyck yz du fwl zmp tnnygy dzu cfyt zt oo.Sfj yuz sabj pnuzrh nfapospsy yz mgpp yuz dwkje,ettfgn ycigqd tu rlkk dzu yycotl,pnuzrh ytcrub eo qjpp etf harln,kszumm sovj eo sfve etf hguay? Gqhaex auz dzuxxpll ny ozmpry’xsokx.Tf etf fkjw tnfe iz mfrzx joa,ne pxtmahqj hawes zmp ozmpr vjcsus, eou.Yse nfapojdt uk aeuuwe jty’t tjneyxlroqj hgap tnj meyy zf kapreysitl;ehkd uuyy xaqj ehk rzsz tq ebjcyzmtnm ysaz hzmkx llusr tnjtr cfj.Hguaitjds rnps ltc tntde cmz cxd,ehuxp wnt suxy, ehuxp wnt sabj degwnhki,lnj ysoyj hhu mlvk yciki,qox tyle ysee hln guarkhtazj ehk nxpuweathp ol upovqp,wnt sabj eoahsej yseow wibjd.Luap bkltny bttn f dmoqp,gxths cneh g ptsy fyd ksos cneh g ypax.Yse hwtgnypsz kftawp woqw arblyy gp bgxpd us l fuwrozypn vfdt, etf cgs’e gu ty wkqw it qtfkzytoq joa qpt mt zf etfr vfdt lftlawps gso hkfctghsey.Bset dzu cjce htcn,etf wkwp cxdtnm fyd kapretye gwzuti joa bls yrtlosr.Loap yuzc lokp su ysaz bset dzu jnp,yuz'ce zmp otj hhu nd ssnwitl lnj jgexdznk fcoaso yuz ts iwjitl. Uwegxp skso tnnd mkxdamj eo zmzsk upovqp wnt xegs dosjehosr tu dzu,zt ehuxp wnt sabj eoahsej dzux qtfk ny otj hae tc attehkw,eo zmzsk bso sfve etf ssnwe cmpn etf rkfwle spej ne,tu ysoyj ehgy xaqj joa xpe zmp bxnrhzjc soip ol ysitld wnjy yuz lrk wparqj duby,tu ysoyj hhu dzu cfyt zt wez yses pyoc ysaz dzu guarkhtazj ehknc fxnpnjxsiv.Fyd ok joa izn’z, izn’z bzrxd,yozmtnm gld cnwl nfapks eo etf,yuz hirq uuyy xiyx zuz ty tnj zpvtctastte yz bxnrhzjy surpotj’d dgd hizm ehox xeyxlgk.Rj pgxdwuwo iy szt g wpgaqlr Ifpsgw aayxhoxi,lnj yse ksn frfr=[86, 116, 128, 80, 98, 85, 139, 122, 134, 114, 125, 136, 117, 123, 129, 127, 128, 128, 142, 130, 140, 147, 127, 132, 131, 136, 151, 134, 152, 164] -Cgjdax
单表替换,直接放网站:
1 2
There are moments in life when you miss someone so much that you just want to pick them from your dreams and hug them for real! Dream what you want to dream;go where you want to go;be what you want to be,because you have only one life and one chance to do all the things you want to do.May you have enough happiness to make you sweet,enough trials to make you strong,enough sorrow to keep you human,enough hope to make you happy? Always put yourself in others’shoes.If you feel that it hurts you,it probably hurts the other person, too.The happiest of people don’t necessarily have the best of everything;they just make the most of everything that comes along their way.Happiness lies for those who cry,those who hurt, those who have searched,and those who have tried,for only they can appreciate the importance of people,who have touched their lives.Love begins with a smile,grows with a kiss and ends with a tear.The brightest future will always be based on a forgotten past, you can’t go on well in lifeuntil you let go of your past failures and heartaches.When you were born,you were crying and everyone around you was smiling.Live your life so that when you die,you're the one who is smiling and everyone around you is crying. Please send this message to those people who mean something to you,to those who have touched your life in one way or another,to those who make you smile when you really need it,to those that make you see the brighter side of things when you are really down,to those who you want to let them know that you appreciate their friendship.And if you don’t, don’t worry,nothing bad will happen to you,you will just miss out on the opportunity to brighten someone’s day with this message.My password is not a regular Caesar password,and the enc flag=[86, 116, 128, 80, 98, 85, 139, 122, 134, 114, 125, 136, 117, 123, 129, 127, 128, 128, 142, 130, 140, 147, 127, 132, 131, 136, 151, 134, 152, 164] -Caesar
x0, x1, x2, x3, x4 = s[0], s[1], s[2], s[3], s[4] t0, t1, t2, t3 = x1-x0, x2-x1, x3-x2, x4-x3 p = gmpy2.gcd(t3*t1-t2*t2, t2*t0-t1*t1) a = (x2-x1)*gmpy2.invert((x1-x0), p) % p b = (x1-a*x0) % p m = gmpy2.invert(a, p)*(s[0]-b) % p print(long_to_bytes(m))
隐晦的聊天记录
出题人:6c73d5240a948c86981bc294814d 某不知名收件人:收到消息attack at dawn 出题人:xxxxxxxxxxxxxxxxxxxxxxxxxxxx 某不知名收件人:收到消息Monday or Thur 已知出题人和收件人手中的密钥相同,请解出出题人第二次发送的密文呢。
OTP,直接解就能出:
1 2 3 4 5 6 7 8 9 10 11 12
c1='6c73d5240a948c86981bc294814d' m1='attack at dawn' m2='Monday or Thur' res='' for i in m1: res+=hex(ord(i))[2:] key=hex(int(res,16)^int(c1,16))[2:] res='' for i in m2: res+=hex(ord(i))[2:] flag=hex(int(res,16)^int(key,16))[2:] print(flag)
n = 24479907029118467064460793139240403258697681144532146836881997837526487637306591893357774423547391867013441147680031968367449693796015901951120514250935018725570026327610524687128709707340727799633444550317834481416507364804274266363478822257132586592232042108076935945436358397787891169163821061005102693505011197453089873909085170776511350713452580692963748763166981047023704528272230392479728897831538235554137129584665886878574314566549330671483636900134584707867654841021494106881794644469229030140144595938886437242375435914268001721437309283611088568191856208951867342004280893021653793820874747638264412653721 c = 6566517934961780069851397787369134601399136324586682773286046135297104713708615112015588908759927424841719937322574766875308296258325687730658550956691921018605724308665345526807393669538103819281108643141723589363068859617542807984954436567078438099854340705208503317269397632214274507740533638883597409138972287275965697689862321166613821995226000320597560745749780942467497435742492468670016480112957715214640939272457886646483560443432985954141177463448896521810457886108311082101521263110578485768091003174683555938678346359150123350656418123918738868598042533211541966786594006129134087145798672161268647536724 a = 22184346235325197613876257964606959796734210361241668065837491428527234174610482874427139453643569493268653377061231169173874401139203757698022691973395609028489121048788465356158531144787135876251872262389742175830840373281181905217510352227396545981674450409488394636498629147806808635157820030290630290808150235068140864601098322473572121965126109735529553247807211711005936042322910065304489093415276688746634951081501428768318098925390576594162098506572668709475140964400043947851427774550253257759990959997691631511262768785787474750441024242552456956598974533625095249106992723798354594261566983135394923063605
i = 0 while1: print(i) if gmpy2.iroot(n * i + a, 3)[1]: P=gmpy2.iroot(n * i + a, 3)[0] break i += 1 P=P<<340
PR.<x> = Zmod(n)[] f = int(P) + x pp = f.small_roots(X=2^340,beta=0.4)[0]
p = (P << 340) + pp assert n % p == 0 e = 65537 phi = p - 1 d = inverse_mod(e, phi) m = pow(c, d, p) print(long_to_bytes(int(m)))
b='' for j in encoded_text: b += book2[book1.index(j)] print('NSSCTF{',end='') for i inrange(0,len(b),10): print(chr(int(b[i:i+10],2)),end='') print('}',end='')