Version 2.8.7.
49 files changed
tree: ca6ae0a32152b615f2637e549dbbbb4c1a7319f2
  1. doc/
  2. lib/
  3. test/
  4. .lgtm.yml
  5. .travis.yml
  6. CMakeLists.txt
  7. LICENSE
  8. minigzip.c
  9. minizip.c
  10. minizip.pc.cmakein
  11. Minizip.podspec
  12. mz.h
  13. mz_compat.c
  14. mz_compat.h
  15. mz_crypt.c
  16. mz_crypt.h
  17. mz_crypt_apple.c
  18. mz_crypt_brg.c
  19. mz_crypt_openssl.c
  20. mz_crypt_win32.c
  21. mz_os.c
  22. mz_os.h
  23. mz_os_posix.c
  24. mz_os_win32.c
  25. mz_strm.c
  26. mz_strm.h
  27. mz_strm_buf.c
  28. mz_strm_buf.h
  29. mz_strm_bzip.c
  30. mz_strm_bzip.h
  31. mz_strm_libcomp.c
  32. mz_strm_libcomp.h
  33. mz_strm_lzma.c
  34. mz_strm_lzma.h
  35. mz_strm_mem.c
  36. mz_strm_mem.h
  37. mz_strm_os.h
  38. mz_strm_os_posix.c
  39. mz_strm_os_win32.c
  40. mz_strm_pkcrypt.c
  41. mz_strm_pkcrypt.h
  42. mz_strm_split.c
  43. mz_strm_split.h
  44. mz_strm_wzaes.c
  45. mz_strm_wzaes.h
  46. mz_strm_zlib.c
  47. mz_strm_zlib.h
  48. mz_zip.c
  49. mz_zip.h
  50. mz_zip_rw.c
  51. mz_zip_rw.h
  52. README.md
README.md

minizip 2.8.7

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

License: Zlib Code Quality: Cpp

Maintained by Nathan Moinvaziri.

Branches

NameStateVersionDescription
masterActive Master Branch Status2.xModern rewrite of 1.2 branch that includes more advanced features, improvements in code maintainability and readability, and the reduction of duplicate code. Compatibility layer provided for older versions.
devActive Dev Branch Status2.xLatest development code
1.2Stale1.xDrop-in replacement for zlib's minizip that includes WinZip AES encryption, disk splitting, I/O buffering and some additional fixes.
1.1Stale1.xOriginal 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, and LZMA 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.
  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_PKCRYPTEnables PKWARE traditional encryptionON
MZ_WZAESEnables WinZIP AES encryptionON
MZ_LIBCOMPEnables Apple compressionOFF
MZ_OPENSSLEnables OpenSSL encryptionOFF
MZ_BRGEnables Brian Gladman's libraryOFF
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

Contents

File(s)Description
minizip.cSample application
mz_compat.*Minizip 1.x compatibility layer
mz.hError codes and flags
mz_os*Platform specific file/utility functions
mz_crypt*Configuration specific crypto/hashing functions
mz_strm.*Stream interface
mz_strm_buf.*Buffered stream
mz_strm_bzip.*BZIP2 stream using libbzip2
mz_strm_libcomp.*Apple compression stream
mz_strm_lzma.*LZMA stream using liblzma
mz_strm_mem.*Memory stream
mz_strm_split.*Disk splitting stream
mz_strm_pkcrypt.*PKWARE traditional encryption stream
mz_strm_os*Platform specific file stream
mz_strm_wzaes.*WinZIP AES stream
mz_strm_zlib.*Deflate stream using zlib
mz_zip.*Zip format
mz_zip_rw.*Zip reader/writer

Third-Party Libraries

  • zlib written by Mark Adler and Jean-loup Gailly.
    • Not included in this repository
    • Or alternatively, zlib-ng by Hans Kristian Rosbach
  • BZIP2 written by Julian Seward.
  • liblzma written by Lasse Collin.
    • Modifications were made to support the ZIP file format specification
  • AES and SHA libraries of Brian Gladman.

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.