import
base64
class
RouterCrypto:
def
__init__(
self
):
from
Crypto.Cipher
import
AES
key
=
'3D A3 73 D7 DC 82 2E 2A 47 0D EC 37 89 6E 80 D7 2C 49 B3 16 29 DD C9 97 35 4B 84 03 91 77 9E A4'
iv
=
'D0 E6 DC CD A7 4A 00 DF 76 0F C0 85 11 CB 05 EA'
self
.cipher
=
AES.new(bytes(bytearray.fromhex(key)), AES.MODE_CBC, bytes(bytearray.fromhex(iv)))
def
decrypt(
self
, data):
output
=
self
.cipher.decrypt(data)
return
output[:
-
ord
(output[
-
1
:])]
encrypted
=
"这里是要解密的密文"
print
(RouterCrypto().decrypt(base64.b64decode(encrypted)).decode(
'UTF-8'
))