-
Notifications
You must be signed in to change notification settings - Fork 1
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
Zip with password is not working #34
Comments
Sorry, it because I zip encrypted with an empty text file. If the file has value then it's working fine. But it's expecting it will require the password even if it's an empty file, isn't it? |
Maybe it depends on how you unzip the file (in other words, it depends on the unzip application), I think. 🤔 How did you unzip the file? Here is my procedure:
var fs = require('fs');
var archiver = require('archiver');
archiver.registerFormat('zip-encryptable', require('archiver-zip-encryptable'));
var output = fs.createWriteStream(__dirname + '/example.zip');
var archive = archiver('zip-encryptable', {
zlib: { level: 9 },
forceLocalTime: true,
password: 'test'
});
archive.pipe(output);
archive.append(Buffer.from(''), { name: 'test.txt' });
archive.finalize();
|
FYI. Even if the target file is empty, there is data named "encryption header" in the encrypted zip file and applications to unzip should be able to validate password with that. Please see "6.1 Traditional PKWARE Decryption" section in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT for details. |
I tried to use the example to zip files with the password
test
but can unzip without any password input. Please help to check. Thanks.The text was updated successfully, but these errors were encountered: