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