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
|
enc_flag = [ 0xBF, 0xD7, 0x2E, 0xDA, 0xEE, 0xA8, 0x1A, 0x10, 0x83, 0x73, 0xAC, 0xF1, 0x06, 0xBE, 0xAD, 0x88, 0x04, 0xD7, 0x12, 0xFE, 0xB5, 0xE2, 0x61, 0xB7, 0x3D, 0x07, 0x4A, 0xE8, 0x96, 0xA2, 0x9D, 0x4D, 0xBC, 0x81, 0x8C, 0xE9, 0x88, 0x78, 0x00, 0x00, ] key = "congratulationstoyoucongratulationstoy"
for i in range(38): enc_flag[i] ^= ord(key[i])
c = [ 0x03, 0x12, 0x0C, 0x4C, 0xC6, 0x26, 0x8C, 0x63, 0xB6, 0x87, 0xB0, 0x6F, 0x1A, 0xCB, 0x9B, 0xFD, 0xBC, 0x52, 0x79, 0x93, 0x19, 0x6A, 0xDA, 0x4E, 0x7B, 0xF9, 0xC4, 0xBB, 0xF1, 0x7E, 0x9D, 0x1E, 0x44, 0xD6, 0xC5, 0x50, 0xBF, 0xEE, 0x00, 0x00, ] d = [ 0xDD, 0xB8, 0x4E, 0xB0, 0xCF, 0xCE, 0x3E, 0x65, 0xBB, 0x14, 0xD1, 0x9B, 0x3E, 0x82, 0x8E, 0xFC, 0x6B, 0xF9, 0x7D, 0x8B, 0xD6, 0x83, 0x0F, 0xD8, 0x48, 0x33, 0x3D, 0x91, 0xAF, 0x94, 0xB0, 0x22, 0xD0, 0xB9, 0xFD, 0xCD, 0xE7, 0x04, 0x00, 0x00, ]
xor_key2 = [0] * 38
for i in range(38): xor_key2[i] = c[i] ^ d[i]
for i in range(38): enc_flag[i] ^= xor_key2[i]
s_box = [ 0x12, 0x0E, 0x1B, 0x1E, 0x11, 0x05, 0x07, 0x01, 0x10, 0x22, 0x06, 0x17, 0x16, 0x08, 0x19, 0x13, 0x04, 0x0F, 0x02, 0x0D, 0x25, 0x0C, 0x03, 0x15, 0x1C, 0x14, 0x0B, 0x1A, 0x18, 0x09, 0x1D, 0x23, 0x1F, 0x20, 0x24, 0x0A, 0x00, 0x21, 0x00, 0x00, ]
flag = [0] *38
for i in range(38): flag[s_box[i]] = enc_flag[i]
a = r"flag{0123456789abcdef0123456789abcdef}" b = [ 0xBF, 0x63, 0x79, 0xDA, 0xBC, 0x26, 0xB0, 0x8C, 0xCB, 0x7E, 0x50, 0xC4, 0x6A, 0x93, 0x12, 0x52, 0xB6, 0xC6, 0x03, 0xFD, 0xF9, 0x4E, 0x1A, 0x6F, 0xF1, 0x9B, 0xBB, 0x0C, 0x7B, 0x9D, 0x4C, 0x44, 0xD6, 0xEE, 0x87, 0x1E, 0xC5, 0x19, 0x00, 0x00, ]
for i in range(38): xor_key1[i] = ord(a[i]) ^ b[i]
for i in range(38): flag[i] ^= xor_key1[i] xor_key1 = [0] * 38
for i in range(38): print(chr(flag[i]), end = '')
|