ZJONSSON / node-unzipper

node.js cross-platform unzip using streams
Other
441 stars 116 forks source link

Add AES-256 decryption #86

Open Dowhanych opened 6 years ago

Dowhanych commented 6 years ago

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

ZJONSSON commented 6 years ago

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')?

Dowhanych commented 6 years ago

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

Dowhanych commented 6 years ago

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

ZJONSSON commented 6 years ago

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

christopherney commented 4 years ago

Missing the feature for AES-128 and AES-256

emiliosanches commented 2 years ago

Nothing?

MrKong224 commented 2 years ago

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); } }); }

emiliosanches commented 2 years ago

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.

ZivotSen commented 2 years ago

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

mzawalski-vilisoft commented 2 years ago

Also looking for this feature for nodejs! Any alternatives?

lapo-luchini commented 1 year ago

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

const mz = new Minizip(buffer);
data = mz.extract('file.xml', {password});
LuisBoto commented 2 months ago

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.