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
| sbox1 = [ 53, 241, 218, 25, 122, 246, 49, 156, 217, 44, 193, 252, 226, 216, 29, 141, 79, 151, 129, 38, 192, 184, 150, 39, 213, 91, 170, 24, 133, 250, 97, 228, 161, 188, 248, 164, 86, 55, 67, 88, 43, 201, 119, 100, 204, 107, 152, 101, 117, 56, 128, 9, 17, 61, 208, 230, 143, 169, 87, 153, 6, 16, 93, 197, 105, 189, 45, 104, 126, 227, 103, 209, 255, 94, 249, 245, 65, 140, 221, 33, 75, 167, 71, 134, 109, 195, 42, 154, 159, 32, 72, 187, 148, 185, 180, 146, 2, 116, 125, 27, 30, 95, 186, 73, 214, 231, 83, 4, 203, 40, 63, 232, 51, 62, 0, 155, 106, 253, 190, 28, 144, 237, 223, 77, 37, 111, 181, 19, 112, 60, 158, 22, 12, 5, 74, 115, 222, 177, 138, 81, 59, 84, 20, 224, 90, 220, 145, 98, 163, 149, 211, 58, 23, 238, 50, 242, 124, 175, 179, 136, 236, 14, 174, 157, 92, 13, 85, 78, 251, 70, 34, 68, 69, 191, 82, 18, 102, 7, 210, 54, 147, 110, 66, 26, 15, 233, 96, 202, 178, 108, 131, 240, 3, 118, 168, 31, 99, 239, 165, 205, 121, 123, 10, 11, 171, 219, 212, 127, 1, 52, 35, 89, 225, 41, 198, 172, 162, 64, 200, 173, 196, 137, 194, 182, 113, 160, 235, 47, 120, 243, 176, 254, 206, 247, 132, 114, 244, 207, 199, 215, 183, 142, 76, 130, 48, 80, 46, 36, 135, 8, 57, 229, 234, 166, 139, 21 ] sbox2 = [ 53, 241, 218, 25, 122, 246, 49, 156, 217, 44, 193, 252, 226, 216, 29, 141, 79, 151, 129, 38, 192, 184, 150, 39, 213, 91, 170, 24, 133, 250, 97, 228, 161, 188, 248, 164, 86, 55, 67, 88, 43, 201, 119, 100, 204, 107, 152, 101, 117, 56, 128, 9, 17, 61, 208, 230, 143, 169, 87, 153, 6, 16, 93, 197, 105, 189, 45, 104, 126, 227, 103, 209, 255, 94, 249, 245, 65, 140, 221, 33, 75, 167, 71, 134, 109, 195, 42, 154, 159, 32, 72, 187, 148, 185, 180, 146, 2, 116, 125, 27, 30, 95, 186, 73, 214, 231, 83, 4, 203, 40, 63, 232, 51, 62, 0, 155, 106, 253, 190, 28, 144, 237, 223, 77, 37, 111, 181, 19, 112, 60, 158, 22, 12, 5, 74, 115, 222, 177, 138, 81, 59, 84, 20, 224, 90, 220, 145, 98, 163, 149, 211, 58, 23, 238, 50, 242, 124, 175, 179, 136, 236, 14, 174, 157, 92, 13, 85, 78, 251, 70, 34, 68, 69, 191, 82, 18, 102, 7, 210, 54, 147, 110, 66, 26, 15, 233, 96, 202, 178, 108, 131, 240, 3, 118, 168, 31, 99, 239, 165, 205, 121, 123, 10, 11, 171, 219, 212, 127, 1, 52, 35, 89, 225, 41, 198, 172, 162, 64, 200, 173, 196, 137, 194, 182, 113, 160, 235, 47, 120, 243, 176, 254, 206, 247, 132, 114, 244, 207, 199, 215, 183, 142, 76, 130, 48, 80, 46, 36, 135, 8, 57, 229, 234, 166, 139, 21 ] print(len(sbox1)) print(len(sbox2))
key_bytes_1 = [ 53, 109, 53, 100, 53, 119, 53, 100, 53, 98, 53, 110, 53, 109, 53, 100, 53, 119, 53, 100, 53, 98, 53, 110, 53, 109, 53, 100, 53, 119, 53, 100, 53, 98, 53, 110, 142, 0 ]
import urllib.parse import base64
def RC4(s_box, enc=''): i = j = 0 res = [] for s in enc: i = (i + 1) % 256 j = (j + s_box[i]) % 256 s_box[i], s_box[j] = s_box[j], s_box[i] t = (s_box[i] + s_box[j]) % 256 k = s_box[t] res.append(chr(ord(s) ^ k))
return ''.join(res)
enc_flag = '+i&[@Y:g8[&l$f8S8v$Y&e>{' dec_flag = RC4(sbox2, enc_flag) dec_flag2 = RC4(sbox1, dec_flag)
for i in range(len(dec_flag2)): print(chr(ord(dec_flag2[i]) - key_bytes_1[i] + ord('p')), end='')
|