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

Password madness #32

Open
zolex opened this issue Dec 3, 2018 · 1 comment
Open

Password madness #32

zolex opened this issue Dec 3, 2018 · 1 comment

Comments

@zolex
Copy link

zolex commented Dec 3, 2018

Q A
Library version(s) affected: 3.1.9
PHP version(s): 7.2
OS (with bit depth): Win 10 x64 (A) + debian stretch x64 (b)

Description
for sys A no traditional encrypted password is working at all when creating a new archive. it sets a password, and when then trying to extract the archive (with any tool like winrar, winzip, windows explorer ) the given password does not work.

for sys B the behaviour is quite similar, but here passwords without special hcars do work and passwords with special chars do not work when trying to extract the created archive.

How to reproduce
$password = 'whatever';
(new ZipFile) ->addFromString($path, $xml) ->setPassword($password, ZipFileInterface::ENCRYPTION_METHOD_TRADITIONAL) ->saveAsFile($zipPath) ->close();

@odan
Copy link
Contributor

odan commented Aug 22, 2021

Windows supports only PKWARE and ZipCrypto password encrypted ZIP files.

Try this:

use PhpZip\Constants\ZipEncryptionMethod;
// ...

$zipFile->setPassword('password', ZipEncryptionMethod::PKWARE);

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

2 participants