Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not unzip file with password #467

Open
mqliutie opened this issue Jan 5, 2024 · 3 comments
Open

Can not unzip file with password #467

mqliutie opened this issue Jan 5, 2024 · 3 comments

Comments

@mqliutie
Copy link

mqliutie commented Jan 5, 2024

import archiver from 'archiver';

archiver.registerFormat('zip-encrypted', require('archiver-zip-encrypted'));

const archive = archiver.create('zip-encrypted', {
  zlib: { level: 8 },
  encryptionMethod: 'aes256',
  password: 'n.ddsadc3ch',
});
const entry = path.join(process.cwd(), 'app/dist/sourcemaps');
const output = fs.createWriteStream(path.join(process.cwd(), 'app/dist/sourcemaps.zip'));
archive.pipe(output);
archive.directory(entry, 'sourcemaps');
archive.finalize();

Above codes show how can I zip files with password

I want to unzip this file named sourcemaps.zip. I used unzipper and adm-zip. all of them tell me the password 'n.ddsadc3ch' is bad password. but I can use it unzip this file on Finder macOS. so How can i unzip this file?

@lukemalcolm
Copy link
Contributor

@mqliutie Give this a go with 0.5.12 (which includes pull #472) and see if the issue is now resolved.

@KurtMar
Copy link

KurtMar commented Mar 16, 2024

@lukemalcolm I tested the latest adm-zip@0.5.12, but was unable to decrypt AES265 Deflate. https://www.npmjs.com/package/@zip.js/zip.js does work. Do you have any idea why this would be the case? Is it @cthackers in fact so that adm-zip does not support AES at all?

@lukemalcolm
Copy link
Contributor

@KurtMar As far as I'm aware, adm-zip does not support AES decryption, only ZipCrypto method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants