21.05.2024, 08:19
Try disabling padding in km200_Encrypt and km200_Decrypt:
Code:
function km200_Encrypt(encryptData)
-- add PKCS #7 padding
encryptData = pad(encryptData)
local hash = { iv = string.rep('\0', 16) } -- no hashing method for key
local aes_256_ecb, err = aes:new(km200_crypt_key_private, nil, aes.cipher(256, 'ecb'), hash, nil, 0, false) -- no padding
Code:
function km200_Decrypt(decryptData)
local hash = { iv = string.rep('\0', 16) } -- no hashing method for key
local aes_256_ecb, err = aes:new(km200_crypt_key_private, nil, aes.cipher(256, 'ecb'), hash, nil, 0, false) -- no padding