第一次公开测试的结果(还有一些未解决的问题)
This commit is contained in:
@@ -8,14 +8,13 @@ import zlib
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.Util.Padding import unpad, pad
|
||||
|
||||
# 密钥和 IV
|
||||
# CN 2024
|
||||
aesKey2024 = "n7bx6:@Fg_:2;5E89Phy7AyIcpxEQ:R@"
|
||||
aesIV2024 = ";;KjR1C3hgB1ovXa"
|
||||
AES_KEY_SDGB_1_40 = "n7bx6:@Fg_:2;5E89Phy7AyIcpxEQ:R@"
|
||||
AES_IV_SDGB_1_40 = ";;KjR1C3hgB1ovXa"
|
||||
|
||||
# 国际服 PRiSM
|
||||
aesKeyPrism = "A;mv5YUpHBK3YxTy5KB^[;5]C2AL50Bq"
|
||||
aesIVPrism = "9FM:sd9xA91X14v]"
|
||||
AES_KEY_SDGA_1_50 = "A;mv5YUpHBK3YxTy5KB^[;5]C2AL50Bq"
|
||||
AES_IV_SDGA_1_50 = "9FM:sd9xA91X14v]"
|
||||
|
||||
class AESPKCS7:
|
||||
# 实现了 maimai 通讯所用的 AES 加密的类
|
||||
@@ -24,9 +23,9 @@ class AESPKCS7:
|
||||
self.iv = iv.encode('utf-8')
|
||||
self.mode = AES.MODE_CBC
|
||||
# 加密
|
||||
def encrypt(self, content: bytes) -> bytes:
|
||||
def encrypt(self, content: str) -> bytes:
|
||||
cipher = AES.new(self.key, self.mode, self.iv)
|
||||
content_padded = pad(content, AES.block_size)
|
||||
content_padded = pad(content.encode(), AES.block_size)
|
||||
encrypted_bytes = cipher.encrypt(content_padded)
|
||||
return encrypted_bytes
|
||||
# 解密
|
||||
@@ -40,7 +39,7 @@ def main_sdga():
|
||||
# 填入你的想解密的数据的 base64 编码
|
||||
base64_encoded_data = "KSGm2qo7qVHz1wrK15PckYC5/kLjKcTtEXOgHeHt1Xn6DPdo3pltoPLADHpe8+Wq"
|
||||
|
||||
aes = AESPKCS7(aesKeyPrism, aesIVPrism)
|
||||
aes = AESPKCS7(AES_KEY_SDGA_1_50, AES_IV_SDGA_1_50)
|
||||
|
||||
# 首先解码 base64
|
||||
decodedData = base64.b64decode(base64_encoded_data)
|
||||
@@ -55,7 +54,7 @@ def main_sdgb():
|
||||
# 填入你的想解密的数据的 base64 编码
|
||||
base64_encoded_data = "eJyrTVvpuGwCR32OdodwtVXZ7/Ofmfhin7k/K61q3XNoad1rAPGwECU="
|
||||
|
||||
aes = AESPKCS7(aesKey2024, aesIV2024)
|
||||
aes = AESPKCS7(AES_KEY_SDGB_1_40, AES_IV_SDGB_1_40)
|
||||
|
||||
# 首先解码 base64
|
||||
decodedData = base64.b64decode(base64_encoded_data)
|
||||
Reference in New Issue
Block a user