Clone this repo:
  1. 3ecff07 Version 2.10.0. by Nathan Moinvaziri · 7 weeks ago master 2.10.0
  2. 33f151c Restore Windows delpoy in workflows by Grzegorz Rychlik · 7 weeks ago
  3. 41f6e44 Rename workflows. by Nathan Moinvaziri · 7 weeks ago
  4. 62d2620 Create codeql-analysis.yml by Nathan Moinvaziri · 7 weeks ago
  5. e410693 Do not link Apple's Security framework when no crypt feature by okhowang(王沛文) · 7 weeks ago

minizip 2.10.0

minizip is a zip manipulation library written in C that is supported on Windows, macOS, and Linux.

Master Branch Status Fuzzing Status Codacy Badge CodeFactor License: Zlib codecov.io

Developed and maintained by Nathan Moinvaziri.

Branches

|Name|Description| |:-|:-| |master|Modern rewrite that includes more advanced features, improvements in code maintainability and readability, and the reduction of duplicate code. Compatibility layer provided for older versions.| |dev|Latest development code| |1.2|Drop-in replacement for zlib's minizip that includes WinZip AES encryption, disk splitting, I/O buffering and some additional fixes.| |1.1|Original minizip as of zlib 1.2.11.|

History

Minizip was originally developed by Gilles Vollant in 1998. It was first included in the zlib distribution as an additional code contribution starting in zlib 1.1.2. Since that time, it has been continually improved upon and contributed to by many people. The original project can still be found in the zlib distribution that is maintained by Mark Adler.

My work with the minizip library started in 2006 when I fixed a few bugs I found and submitted them to Gilles Vollant. In 2010, I implemented WinZip AES encryption, disk splitting, and I/O buffering that were necessary for another project I was working on. Shortly after, I created this public repository so I could share my improvements with the community. In early 2017, I began the work to refactor and rewrite the library as version 2 because it had become difficult to maintain and code readability suffered over the years.

Features

  • Creating and extracting zip archives.
  • Adding and removing entries from zip archives.
  • Read and write raw zip entry data.
  • Reading and writing zip archives from memory.
  • Zlib, BZIP2, LZMA, and ZSTD compression methods.
  • Password protection through Traditional PKWARE and WinZIP AES encryption.
  • Buffered streaming for improved I/O performance.
  • NTFS timestamp support for UTC last modified, last accessed, and creation dates.
  • Disk split support for splitting zip archives into multiple files.
  • Preservation of file attributes across file systems.
  • Follow and store symbolic links.
  • Unicode filename support through UTF-8 encoding.
  • Legacy character encoding support CP437, CP932, CP936, CP950.
  • Turn off compilation of compression, decompression, or encryption.
  • Windows (Win32 & WinRT), macOS and Linux platform support.
  • Streaming interface for easy implementation of additional platforms.
  • Support for Apple's compression library ZLIB implementation.
  • Zero out local file header information.
  • Zip/unzip of central directory to reduce size.
  • Ability to generate and verify CMS signature for each entry.
  • Recover the central directory if it is corrupt or missing.
  • Example minizip command line tool.

Build

To generate project files for your platform:

  1. Download and install cmake (version 3.11 or later recommended).
  2. Run cmake in the minizip directory.
cmake . -DMZ_BUILD_TEST=ON
cmake --build .

Build Options

NameDescriptionDefault Value
MZ_COMPATEnables compatibility layerON
MZ_ZLIBEnables ZLIB compressionON
MZ_BZIP2Enables BZIP2 compressionON
MZ_LZMAEnables LZMA compressionON
MZ_ZSTDEnables ZSTD compressionON
MZ_PKCRYPTEnables PKWARE traditional encryptionON
MZ_WZAESEnables WinZIP AES encryptionON
MZ_LIBCOMPEnables Apple compressionOFF
MZ_OPENSSLEnables OpenSSL encryptionOFF
MZ_LIBBSDBuilds with libbsd crypto randomON
MZ_BRGEnables Brian Gladman's libraryOFF
MZ_SIGNINGEnables zip signing supportON
MZ_COMPRESS_ONLYOnly support compressionOFF
MZ_DECOMPRESS_ONLYOnly support decompressionOFF
MZ_BUILD_TESTBuilds minizip test executableOFF
MZ_BUILD_UNIT_TESTBuilds minizip unit test projectOFF
MZ_BUILD_FUZZ_TESTBuilds minizip fuzz executablesOFF
MZ_CODE_COVERAGEBuild with code coverage flagsOFF
MZ_PROJECT_SUFFIXProject name suffix for packaging
MZ_FILE32_APIBuilds using posix 32-bit file apiOFF

Third-Party Libraries

|Project|License|CMake Option|Comments| |-|-|-|-| |aes|license|MZ_BRG|Written by Brian Gladman. Compiled in when system crypto functions are unavailable.| bzip2|license|MZ_BZIP2|Written by Julian Seward.| |liblzma|Public domain|MZ_LZMA|Written by Igor Pavlov and Lasse Collin. Modifications were made to support the ZIP file format specification.| |sha|license|MZ_BRG|Written by Brian Gladman. Compiled in when system crypto functions are unavailable.| |zlib|zlib|MZ_ZLIB|Written by Mark Adler and Jean-loup Gailly. Not included in this repository. Or alternatively, zlib-ng by Hans Kristian Rosbach.| |zstd|BSD|MZ_ZSTD|Written by Facebook. Not included in this repository.|

This project uses the zlib license.

Acknowledgments

Thanks go out to all the people who have taken the time to contribute code reviews, testing and/or patches. This project would not have been as good without you.

Thanks to Gilles Vollant on which this work is originally based on.

The ZIP format was defined by Phil Katz of PKWARE.