chore: 32 zero prefix
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user