chore: 32 zero prefix

This commit is contained in:
mokurin000
2025-07-30 12:54:35 +08:00
parent 89e096bac6
commit 05d7c1305b

View File

@@ -15,9 +15,8 @@ LITE_AUTH_IV = bytes.fromhex("00000000000000000000000000000000")
def auth_lite_encrypt(plaintext: str) -> bytes:
# 构造数据16字节头 + 16字节0前缀 + 明文
header = bytes(16)
content = bytes(16) + plaintext.encode("utf-8")
data = header + content
content = bytes(32) + plaintext.encode("utf-8")
data = content
# 填充并加密
padded_data = pad(data, AES.block_size)
cipher = AES.new(LITE_AUTH_KEY, AES.MODE_CBC, LITE_AUTH_IV)