node-unzipper icon indicating copy to clipboard operation
node-unzipper copied to clipboard

Add AES-256 decryption

Open Dowhanych opened this issue 6 years ago • 12 comments

System not understand passwords whitch put to open zip. unzipper.Open.file('test123_3/lol.zip') .then(function(d) { return new Promise(function(resolve,reject) { console.log(d.files[0]); d.files[0].stream("qqq") }); }); password_not_working

Dowhanych avatar Oct 24 '18 13:10 Dowhanych

Thank you for flagging this. We only support basic encryption from the original spec. This error might be due to unsupported encryption method, or it could be an error in the stream method.

Can you share a zip file with password qqq that doesn't work? Also can you try the other methods (for example .buffer('qqq')?

ZJONSSON avatar Oct 24 '18 14:10 ZJONSSON

Yes encryption was AES-256. Buffer don`t work too. With ZipCrypto work perfect.

Dowhanych avatar Oct 25 '18 06:10 Dowhanych

Is it possible to make AES-256 in next version?

Dowhanych avatar Oct 25 '18 07:10 Dowhanych

It's not on my radar right now, but would really appreciate any PR with improvements!

ZJONSSON avatar Oct 25 '18 15:10 ZJONSSON

Missing the feature for AES-128 and AES-256

christopherney avatar Sep 11 '20 14:09 christopherney

Nothing?

emiliosanches avatar Jun 15 '22 03:06 emiliosanches

try this:

const filePath = YOUR_FILE_PATH const decryptPass = YOUR_PASSWORD const outputPath = YOUT_OUTPUT_PATH

return new Promise( (resolve, reject) => { var exec = require('child_process').exec; var cmd = '7z x ' + filePath + ' -p"' + decryptPass + '" -y -o"' + outputPath + '"'; exec(cmd, function (err){ if (err){ reject(err); } else { resolve(outputPath); } }); }

MrKong224 avatar Jun 18 '22 10:06 MrKong224

try this:

const filePath = YOUR_FILE_PATH const decryptPass = YOUR_PASSWORD const outputPath = YOUT_OUTPUT_PATH

return new Promise( (resolve, reject) => { var exec = require('child_process').exec; var cmd = '7z x ' + filePath + ' -p"' + decryptPass + '" -y -o"' + outputPath + '"'; exec(cmd, function (err){ if (err){ reject(err); } else { resolve(outputPath); } }); }

Thank you! I used python and could do it. But it seems to work also (didn't test) and will definitely help other people.

emiliosanches avatar Jun 18 '22 22:06 emiliosanches

Any update on this feature? Or at least someone that had solved this using javascript?

ZivotSen avatar Aug 25 '22 21:08 ZivotSen

Also looking for this feature for nodejs! Any alternatives?

mzawalski-vilisoft avatar Aug 31 '22 17:08 mzawalski-vilisoft

I managed to do it using minizip-asm.js:

const mz = new Minizip(buffer);
data = mz.extract('file.xml', {password});

lapo-luchini avatar Jun 25 '23 17:06 lapo-luchini

I managed to do it using minizip-asm.js:

const mz = new Minizip(buffer);
data = mz.extract('file.xml', {password});

Though a solution, Minizip's latest version is >8yrs old. AES256 would still be nice to have on here which seems a pretty complete package otherwise.

LuisBoto avatar Sep 12 '24 08:09 LuisBoto