from itertools import * import re ps='1234567890qwertyuiopasdfghjklxcvbnmQWERTYUIOPSDFGHJKLZXCVBNM\'` ;,.' ks='1234567890qwertyuiopasdfghjklxcvbnmQWERTYUIOPSDFGHJKLZXCVBNM' res='1e5d4c055104471c6f234f5501555b5a014e5d001c2a54470555064c443e235b4c0e590356542a130a4242335a47551a590a136f1d5d4d440b0956773613180b5f184015210e4f541c075a47064e5f001e2a4f711844430c473e2413011a100556153d1e4f45061441151901470a196f035b0c4443185b322e130806431d5a072a46385901555c5b550a541c1a2600564d5f054c453e32444c0a434d43182a0b1c540a55415a550a5e1b0f613a5c1f10021e56773a5a0206100852063c4a18581a1d15411d17111b052113460850104c472239564c0755015a13271e0a55553b5a47551a54010e2a06130b5506005a393013180c100f52072a4a1b5e1b165d50064e411d0521111f235f114c47362447094f10035c066f19025402191915110b4206182a544702100109133e394505175509671b6f0b01484e06505b061b50034a2911521e44431b5a233f13180b5508131523050154403740415503484f0c2602564d470a18407b775d031110004a54290319544e06505b060b424f092e1a770443101952333213030d554d551b2006064206555d50141c454f0c3d1b5e4d43061e453e39544c17580856581802001102105443101d111a043c03521455074c473f3213000a5b085d113c194f5e08555415180f5f433e270d131d420c1957773f560d11440d40543c060e470b55545b114e470e193c155f4d47110947343f13180c100f565a000403484e184c15050250081f2a54470545104c5536251325435302461a3b4a02484e12545c1b4265070b3b5440055543185b36231301025b084054220f4f42071b1554020f430b196f19564d4002055d79'#res=salt^output trlen= int(len(res)/2)
list1=[] for i in range(0,len(res),2): list1.append(res[i:i+2])
list2=[] #列出key全集 for j in range(0,trlen):
list3=[] for i in ks: if (chr(ord(i)^int(list1[j],16))in ps): list3.append(i) list2.append(list3)
for length in range(1,38): #根据key[0]不为空集来爆length x=set(list2[0]) for j in range(0,trlen,length): x &= set(list2[j]) if len(x)!=0: print(length)
y = [] for z in range(30): #爆key候选集 x=set(list2[z]) for j in range(z,trlen,30): x &= set(list2[j]) if len(x)!=0: y.append(x) print(str(y).replace("},","},\n"))
key='W3lc0m3tOjo1nu55un1ojOt3m0cl3W'
ki=cycle(key) #看结果 str1='' for each in list1: str1+=chr(ord(next(ki))^int(each,16)) print(str1)