diff --git a/lib/helper.js b/lib/helper.js index 86fefde..56d8287 100644 --- a/lib/helper.js +++ b/lib/helper.js @@ -147,7 +147,8 @@ function decryptAudioData(data,audioAesKey,audioAesIv) { const encrypted_length = block_count * BLOCK_SIZE; const remainder = data.length - encrypted_length; - const decipher = crypto.createDecipheriv('aes-128-cbc',audioAesKey,audioAesIv); + var audioAesKeyBuffer = new Buffer(audioAesKey, 'binary'); + const decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKeyBuffer, audioAesIv); decipher.setAutoPadding(false); const encrypted_data = data.slice(0,encrypted_length); @@ -162,4 +163,3 @@ function decryptAudioData(data,audioAesKey,audioAesIv) { return output; }; -