1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
| from Crypto.Util.number import *
def dododo(c): sum = 0 for i in range(62): sum += c[i] * pow(47, 61 - i) m=long_to_bytes(sum) try: flag=m.decode() print(flag) exit(0) except: pass
enc=[0x52, 0xC3, 0x1A, 0xE0, 0x16, 0x5D, 0x5E, 0xE2, 0x67, 0x1F, 0x1F, 0x06, 0x06, 0x1F, 0x17, 0x06, 0x0F, 0xF9, 0x06, 0x67, 0x58, 0xB2, 0xE2, 0x8C, 0x0F, 0x2A, 0x06, 0x89, 0xCF, 0x2A, 0x06, 0x1F, 0x98, 0x1A, 0x3E, 0x17, 0x67, 0x1F, 0xF7, 0x3A, 0x44, 0xC3, 0x16, 0x33, 0x69, 0x1A, 0x75, 0x16, 0x3E, 0x17, 0xD5, 0x69, 0x7A, 0x1B, 0x44, 0x44, 0x3E, 0x67, 0xF7, 0x89, 0x67, 0xC3] table=[0x21, 0x43, 0x65, 0x87, 0x09, 0x21, 0x43, 0x65, 0xA2, 0x9B, 0xF4, 0xDF, 0xAC, 0x7C, 0xA1, 0xC6, 0x16, 0xD0, 0x0F, 0xDD, 0xDC, 0x73, 0xC5, 0x6B, 0xD1, 0x96, 0x47, 0xC2, 0x26, 0x67, 0x4E, 0x41, 0x82, 0x20, 0x56, 0x9A, 0x6E, 0x33, 0x92, 0x88, 0x29, 0xB5, 0xB4, 0x71, 0xA9, 0xCE, 0xC3, 0x34, 0x50, 0x59, 0xBF, 0x2D, 0x57, 0x22, 0xA6, 0x30, 0x04, 0xB2, 0xCD, 0x36, 0xD5, 0x68, 0x4D, 0x5B, 0x45, 0x9E, 0x85, 0x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x38, 0xFD, 0x8F, 0xC4, 0xF5, 0xFC]
tb2=[0xA7, 0x1C, 0x7E, 0xAF, 0xD9, 0xC2, 0xC0, 0xBE, 0x1F, 0x45, 0x9A, 0x85, 0x26, 0xE3, 0x87, 0xC3, 0x21, 0xE0, 0x95, 0x10, 0x71, 0x70, 0x02, 0x75, 0x35, 0xA5, 0x1D, 0x0D, 0x2F, 0xEE, 0x25, 0x7B, 0xB5, 0x82, 0x66, 0x8D, 0xDB, 0x53, 0x3A, 0x29, 0xD4, 0x43, 0x99, 0x97, 0x9D, 0xE8, 0x49, 0x00]
c=[]
for i in range(61): temp=[] for j in range(47): tmp=tb2[j] tmp=tmp^table[tmp] if tmp==enc[i]: temp.append(j) if len(temp)==1: c.append(temp[0]) else: c.append(temp) c.insert(0,0) print(c) for i in c: if isinstance(i,int): pass else: print(i) c[3]=45 tblen=[] l=1 index=[] for i in range(len(c)): try: tblen.append(len(c[i])) l*=len(c[i]) index.append(i) except: tblen.append(1)
print(tblen) print(index)
sum=0 t1=[7, 11, 22] t2=[34, 37] t3=[19, 20, 43] t4=[4, 31] t5=[33, 45]
for a1 in range(3): c[9]=t1[a1] for a2 in range(2): c[10]=t2[a2] for a3 in range(2): c[11]=t2[a3] for a4 in range(3): c[12]=t3[a4] for a5 in range(3): c[13]=t3[a5] for a6 in range(2): c[14]=t2[a6] for a7 in range(3): c[16]=t3[a7] for a8 in range(2): c[17]=t4[a8] for a9 in range(3): c[19]=t3[a9] for a10 in range(3): c[20]=t1[a10] for a11 in range(2): c[25]=t4[a11] for a12 in range(3): c[27]=t3[a12] for a13 in range(3): c[31]=t3[a13] for a14 in range(2): c[32]=t2[a14] for a15 in range(2): c[34]=t5[a15] for a16 in range(3): c[37]=t1[a16] for a17 in range(2): c[38]=t2[a17] for a18 in range(2): c[46]=t5[a18] for a19 in range(3): c[58]=t1[a19] for a20 in range(3): c[61]=t1[a20] dododo(c)
|