fix: 对接 SQLBot 使用 AES 加密对短 IV 补充逻辑错误

This commit is contained in:
fit2cloud-chenyw
2025-09-11 16:15:07 +08:00
committed by fit2cloud-chenyw
parent 8edd3fb0fd
commit e01890b792
2 changed files with 2 additions and 2 deletions

View File

@@ -101,7 +101,7 @@ public class DatasetSQLBotManage {
iv = iv.substring(0, 16);
}
if (len < 16) {
iv = String.format("%-" + (16 - len) + "s", iv).replace(' ', '0');
iv = String.format("%-16s", iv).replace(' ', '0');
}
return AesUtils.aesEncrypt(text, aesKey, iv);
}