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

minizip 2.7.2

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

License: Zlib

Maintained by Nathan Moinvaziri.

Branches

NameStateVersionDescriptionTravis CI
masterActive2.xModern refactoring 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.Master Branch Status
devActive2.xLatest development codeDev Branch Status
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 and had been contributed to by many people. As part of the zlib distribution, Mark Adler has maintained the original minizip project.

In 2006, I began working with the minizip project and started submitting bugs I found in the library to Gilles Vollant via e-mail. In 2010, I implemented some additional features like disk splitting, I/O buffering, and WinZip AES encryption. My continued work on the project necessitated setting up a public repository so I could share these and other improvements with the rest of the world. I have been maintaining and actively developing this fork of the library ever since. In 2017, I refactored and rewrote most of the code as version 2 because it had become difficult to maintain and code readability had 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.
  • 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.
  • 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 . -DBUILD_TEST=ON
cmake --build .

Build Options

NameDescriptionDefault Value
USE_COMPATEnables compatibility layerON
USE_ZLIBEnables ZLIB compressionON
USE_BZIP2Enables BZIP2 compressionON
USE_LZMAEnables LZMA compressionON
USE_PKCRYPTEnables PKWARE traditional encryptionON
USE_AESEnables WinZIP AES encryptionON
USE_LIBCOMPEnables Apple compressionOFF
USE_OPENSSLEnables OpenSSL encryptionOFF
USE_BRGEnables Brian Gladman's libraryOFF
COMPRESS_ONLYOnly support compressionOFF
DECOMPRESS_ONLYOnly support decompressionOFF
BUILD_TESTBuilds minizip test executableOFF

Contents

File(s)DescriptionRequired
minizip.cSample applicationNo
mz_compat.*Minizip 1.0 compatibility layerNo
mz.hError codes and flagsYes
mz_os*Platform specific file/utility functionsLikely
mz_crypt*Configuration specific crypto/hashing functionsEncryption, Signing
mz_strm.*Stream interfaceYes
mz_strm_buf.*Buffered streamNo
mz_strm_bzip.*BZIP2 stream using libbzip2No
mz_strm_crc32.*CRC32 streamYes
mz_strm_libcomp.*Apple compression streamNo
mz_strm_lzma.*LZMA stream using liblzmazlib or liblzma
mz_strm_mem.*Memory streamYes
mz_strm_split.*Disk splitting streamNo
mz_strm_pkcrypt.*PKWARE traditional encryption streamNo
mz_strm_os*Platform specific file streamYes
mz_strm_wzaes.*WinZIP AES streamNo
mz_strm_zlib.*Deflate stream using zlibzlib or liblzma
mz_zip.*Zip formatYes
mz_zip_rw.*Zip reader/writerNo

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 to Gilles Vollant on which this work is originally based on.

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 nearly as good without you.

The ZIP format was defined by Phil Katz of PKWARE.