diff --git a/deemix/utils/crypto.js b/deemix/utils/crypto.js index 50cd4a9..4623d3d 100644 --- a/deemix/utils/crypto.js +++ b/deemix/utils/crypto.js @@ -8,11 +8,13 @@ function _md5 (data, type = 'binary') { function _ecbCrypt (key, data) { let cipher = crypto.createCipheriv("aes-128-ecb", Buffer.from(key), Buffer.from("")); + cipher.setAutoPadding(false) return Buffer.concat([cipher.update(data, 'binary'), cipher.final()]).toString("hex").toLowerCase(); } function _ecbDecrypt (key, data) { let cipher = crypto.createDecipheriv("aes-128-ecb", Buffer.from(key), Buffer.from("")); + cipher.setAutoPadding(false) return Buffer.concat([cipher.update(data, 'binary'), cipher.final()]).toString("hex").toLowerCase(); }