> I have a project and I want to open a locked zip file.
Do you know the password?
Because if you don't, just writing it in C++ (as opposed to say python, which will be using the C library under the hood anyway, so you're not buying a lot) isn't going to magically transform the performance of your password cracker.
zlib is the de facto open source library for compression - https://www.zlib.net/
Look for C++ wrappers if that's really important to you.
The zlib library is more general, for compression of streams. zlib is not directly responsible for the handling of the .zip file itself. Also, an archive file isn't necessarily compressed (although it usually is).
But if you want to see an example of actually using zlib in combination with handling zip files, see: https://github.com/madler/zlib/tree/master/contrib/minizip
The example code is written in C, but also can handle passwords. However, zlib is not a beginner-friendly library to use, so it probably isn't what joe wants.
_______________________
I have not used libzip, but it appears to be more user friendly.
What compiler do you use? libzip has some pre-built packages at https://libzip.org/packages/
Well, it's a simple exercise so yeah I think I need something simple. I'm thinking to write the code in python then. That library is more easy to to handle, right?
If I understood right, I have to use the zipfile library in python to open the locked file using the data that are stored in the other text file that I got. It sounds simple.
Yes I can use python but I'm more comfortable with c++
zlib is easy to use. In c++, I mean, its available ... its been in c++ longer than python has existed by probably decades.
is this a 'spam the file with the passwords in the other file' exercise or something?