Zip Archive Library decompression with AES-256 - c++

I am using Zip Archive library for compressing and decompressing files, i needed to enable AES encryption so by Uncommenting
#def ZIP_AES
in the _features.h file included with the library and recompiling I got CZipException for decompression
"WinZip AES encryption has not been enabled for the library, but is required to decompress the archive."
Am i missing something? please any guide would so much appreciated.

Thanks to Oli Charlesworth; there was a conflict between the lib file produced from the free library and the one i bought thanks a lot.

I strangely got this error when the program in question needed Pkzip encryption, not AES encryption as the message suggested.
(While this isn't OP's problem, I'm mentioning it for future readers)

Related

Libarchive: how to compress an archive on windows?

I am trying to create a compressed archive on windows with libarchive and at the moment it is not working. I can create zip or pax_restricted(tar) archives without compression, without any problems.
To add compression I've tried some combinations of the following:
archive_write_set_compression_lzip(lWriteArchive);
archive_write_add_filter_lzip(lWriteArchive);
archive_write_set_compression_gzip(lWriteArchive);
archive_write_add_filter_gzip(lWriteArchive);
archive_write_set_format_zip(lWriteArchive);
archive_write_set_format_pax_restricted(lWriteArchive);
I've mainly tried using lzip compression with the zip format and gzip compression with the pax_restricted format.
First I'm not sure whether I should use archive_write_set_compression_* or archive_write_add_filter_*.
When I try add lzip compression and I step into the function I see it returns ARCHIVE_FATAL with the error message "lzma compression not supported on this platform".
When I try to add gzip compression and I step into the function I see it returns ARCHIVE_WARN with the error message "Using external gzip program". If I let the process go on the resulting archive has a size of zero.
I get the feeling like on unix systems there are system libraries for lzma and gzip that libarchive uses for compression and that these are not available on windows.
I built libarchive using the latest stable release, following the the instructions to use CMake etc. I didn't notice any errors in the CMake configuration like I was missing lzma or gzip.
Thanks for any help.

How to binary read 7z archive

I need help for reading the number of files in the archive and their properties (weight, date etc). SDK can not be used. Only binary reading.
Read the source code for 7-Zip and implement the parts you need. Here's the link: http://sourceforge.net/projects/sevenzip/files/

Create a zip archive in c++

Is there a way to create a zip archive with the full folder content or multi-files.
I actually looked the example on the web but each time it's a compression of file only based on a buffer like for example : gzip_compressor() or gzwrite()
I can't give a full path in input but only a file buffer.
=> Then no folder compression nor multi-file compression ???
Please note that I would like to use zlib/gzip or boost (the only library i can link)
I think I missed something there...
Can you please help me ?
Marc.
There are several libraries out there to handle zip files. They use zlib for the compression, decompression, and crc32 operations. You should look at libzip and DotNetZip.
It looks like this will work. If you are on a Unix environment you may have to run the Java version:
http://www.7-zip.org/sdk.html

There is no phonenumber.pb.h in libphonenumber

There is no phonenumber.pb.h and phonemetadata.pb.h in the libphonenumber(CPP) lib
So is there any way to find them out?
Thanks!
These are files generated by Google protobuffers library from a simple .proto file that describes the protocol messages.
Check out the library sources, there should be phonemetadata.proto and phonenumber.proto

Good free lib for compression

I need compress library for following needs:
1) Packing directory in one file with extension of my choice ( .pack for example )
2) Work with content in this file (directory) without unpaking it
3) Mechanism for encrypting
I already know about zlib, but for me it is ugly documented and not written anywhere what features are support from it
Packing directory in one file with extension of my choice ( .pack for example )
Most archivers don't require you to use a particular file extension. Regardless, one can still invoke file on a file to guess its content type.
Work with content in this file (directory) without unpaking it
It's possible to create a file list manually and prepend any archive file with that. Often, .sh installers for Linux contain a shell script in the beginning, followed by some magic line like __ARCHIVE_START__ followed by a binary archive. Hence it is possible to read lines from a file until __ARCHIVE_START__ line has been read. The rest of the file is an archive file.
Mechanism for encrypting
One easy way is to use different libraries for archiving and encrypting:
Bundle the files into one .tar.
Archive .tar into say .tar.xz.
Prepend the .tar.xz with file list followed by __ARCHIVE_START__ line.
Encrypt the file with any encryption library you please.
What you want is not a compression library. You want a compression, archiving, and encryption library or libraries. You need archiving to put a directory of files into a single file.
You can use zlib to do the compress part, but not archive or encrypt. zlib is documented in zlib.h and you can see a usage example there, as well as many examples in the source distribution package.
You can construct your own archiving format, or you can use existing ones for which there are libraries such as zip or tar, both of which use or can be directed to use zlib.
You can use OpenSSL for strong encryption.