_hash ={"乾":"111","兑":"011","离":"101","震":"001","巽":"110","坎":"010","艮":"100","坤":"000"}encoded_text = "坤乾兑艮兑坎坤坤巽震坤巽震艮兑坎坤震兑乾坤巽坤艮兑震巽坤巽艮坤巽艮艮兑兑艮震兑乾坤乾坤坤兑艮艮坤巽坤坤巽坎坤兑离坎震艮兑坤巽坎艮兑震坤震兑乾坤乾坎坤兑坎坤震艮离坤离乾艮震艮巽震离震坤巽兑艮兑坎坤震巽艮坤离乾艮坎离坤震巽坎坤兑坤艮兑震巽震巽坎坤巽坤艮兑兑坎震巽兑"
__reverse_hash ={k: v for k, v in _hash.items()}decoded_text =""for i inrange(0, len(encoded_text)):try: decoded_text += __reverse_hash[encoded_text[i]]exceptKeyError: decoded_text +=" "print(decoded_text)list= []for i inrange(0, len(decoded_text), 10):list.append(int(decoded_text[i:i +10], 2))print(bytes(list).decode())# wh1ch_ag4in_pr0duced_the_3ight_Tr1grams
Crypto
Hex?Hex!
16 进制转字符串即可 LitCTF{tai111coollaaa!}
梦想是红色的
LitCTF{为之则易,不为则难}
家人们!谁懂啊,RSA签到都不会
from Crypto.Util.number import*# from secret import flag## m = bytes_to_long(flag)# p = getPrime(512)# q = getPrime(512)# c = pow(m,e,n)# print(f'p = {p}')# print(f'q = {q}')# print(f'c = {c}')# '''import gmpy2e =65537p = 12567387145159119014524309071236701639759988903138784984758783651292440613056150667165602473478042486784826835732833001151645545259394365039352263846276073
q = 12716692565364681652614824033831497167911028027478195947187437474380470205859949692107216740030921664273595734808349540612759651241456765149114895216695451
c = 108691165922055382844520116328228845767222921196922506468663428855093343772017986225285637996980678749662049989519029385165514816621011058462841314243727826941569954125384522233795629521155389745713798246071907492365062512521474965012924607857440577856404307124237116387085337087671914959900909379028727767057
# '''n = p*qphi = (p-1)*(q-1)d = gmpy2.invert(e,phi)m =pow(c,d,n)print(long_to_bytes(m))
原来你也玩原神
YUANLAINIYEWANYUANSHENWWW
(校外)Euler
已知 n c
m^2 mod n = c
当e=2 可以认为是低指数,进行低指数加密攻击
n = 115140122725890943990475192890188343698762004010330526468754961357872096040956340092062274481843042907652320664917728267982409212988849109825729150839069369465433531269728824368749655421846730162477193420534803525810831025762500375845466064264837531992986534097821734242082950392892529951104643690838773406549
c = 406480424882876909664869928877322864482740577681292497936198951316587691545267772748204383995815523935005725558478033908575228532559165174398668885819826720515607326399097899572022020453298441
i =0while1:if(iroot(c+i*n,2)[1]==1):print(iroot(c+i*n,2)[0])print(i)break i=i+1print(long_to_bytes(637558173724466424603436405558898119893812260428714378729778210205931322986773019220025930769021))
LitCTF{a1a8887793acfc199182a649e905daab}
(校外)md5的破解
list= ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9']for i inlist:for j inlist:for p inlist:for q inlist: temp ="LitCTF{md5can%(0)s%(1)s3de%(2)srypt213thoughcr%(3)ssh}"%{'0': i,'1': j,'2': p,'3': q} tempp =md5(temp.encode()).hexdigest()if tempp =='496603d6953a15846cd7cc476f146771':print(temp)
from gmpy2 import*from Crypto.Util.number import*e =65537n = 50612159190225619689404794427464916374543237300894011803225784470008992781409447214236779975896311093686413491163221778479739252804271270231391599602217675895446538524670610623369953168412236472302812808639218392319634397138871387898452935081756580084070333246950840091192420542761507705395568904875746222477
dp = 5892502924236878675675338970704766304539618343869489297045857272605067962848952532606770917225218534430490745895652561015493032055636004130931491316020329
c = 39257649468514605476432946851710016346016992413796229928386230062780829495844059368939749930876895443279723032641876662714088329296631207594999580050131450251288839714711436117326769029649419789323982613380617840218087161435260837263996287628129307328857086987521821533565738409794866606381789730458247531619
for i inrange(1, e):if (dp * e -1) % i ==0:if n % (((dp * e -1) // i) +1) ==0: p = ((dp * e -1) // i) +1 q = n // (((dp * e -1) // i) +1) phi = (q -1) * (p -1) d =invert(e, phi) m =pow(c, d, n)print(long_to_bytes(m))