Code Monkey home page Code Monkey logo

Comments (6)

dillof avatar dillof commented on June 21, 2024

No, it currently does not.

We would probably need a new variant of zip_open() to allow providing a password, and a new archive flag like ZIP_AFL_ENCRYPTED_CENTRAL_DIRCTORY. You could then check if it is encrypted with zip_get_archive_flag() and set whether to encrypt with zip_set_archive_flag().

from libzip.

fdegros avatar fdegros commented on June 21, 2024

How does the current libzip 1.10 react when faced with an encrypted central directory? Does it fails with ZIP_ER_NOZIP or another error code?

For context, around 2% of all the ZIP archives that are opened by the ChromeOS Files App fail with ZIP_ER_NOZIP. This percentage is stable over time, and it looks quite high. I'm wondering what could be causing that, and if the "central directory encryption" could play a role in that.

from libzip.

0-wiz-0 avatar 0-wiz-0 commented on June 21, 2024

I think recognizing it as a ZIP archive might work (at least without the consistency check flag). The data in the central directory is zeroed out though, so it'll be useless (no file sizes etc.)
Do you have an example file for us?

from libzip.

fdegros avatar fdegros commented on June 21, 2024

Do you have an example file for us?

I wish I had one. Unfortunately, I don't even know how to create such a ZIP file with an encrypted central directory.

from libzip.

dillof avatar dillof commented on June 21, 2024

Thomas found that Central Directory Encryption is patented, accoring to PKWare developer Marius Volkhart, see https://stackoverflow.com/questions/58394110/pkware-zip-central-directory-encryption

Therefore, we can't implement it. If we can get an example zip archive, we'll make sure that it is recognised as a zip archive and that zip_open() returns an appropriate error code.

from libzip.

fdegros avatar fdegros commented on June 21, 2024

Interesting. That explains why such ZIPs aren't that common.

from libzip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.