11e9a6b47SJoerg Sonnenberger 21e9a6b47SJoerg Sonnenberger Frequently Asked Questions about zlib 31e9a6b47SJoerg Sonnenberger 41e9a6b47SJoerg Sonnenberger 51e9a6b47SJoerg SonnenbergerIf your question is not there, please check the zlib home page 6fe927c51SPeter Avaloshttp://zlib.net/ which may have more recent information. 7fe927c51SPeter AvalosThe lastest zlib FAQ is at http://zlib.net/zlib_faq.html 81e9a6b47SJoerg Sonnenberger 91e9a6b47SJoerg Sonnenberger 101e9a6b47SJoerg Sonnenberger 1. Is zlib Y2K-compliant? 111e9a6b47SJoerg Sonnenberger 121e9a6b47SJoerg Sonnenberger Yes. zlib doesn't handle dates. 131e9a6b47SJoerg Sonnenberger 141e9a6b47SJoerg Sonnenberger 2. Where can I get a Windows DLL version? 151e9a6b47SJoerg Sonnenberger 16fe927c51SPeter Avalos The zlib sources can be compiled without change to produce a DLL. See the 17fe927c51SPeter Avalos file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the 18fe927c51SPeter Avalos precompiled DLL are found in the zlib web site at http://zlib.net/ . 191e9a6b47SJoerg Sonnenberger 201e9a6b47SJoerg Sonnenberger 3. Where can I get a Visual Basic interface to zlib? 211e9a6b47SJoerg Sonnenberger 221e9a6b47SJoerg Sonnenberger See 23fe927c51SPeter Avalos * http://marknelson.us/1997/01/01/zlib-engine/ 241e9a6b47SJoerg Sonnenberger * win32/DLL_FAQ.txt in the zlib distribution 251e9a6b47SJoerg Sonnenberger 261e9a6b47SJoerg Sonnenberger 4. compress() returns Z_BUF_ERROR. 271e9a6b47SJoerg Sonnenberger 28fe927c51SPeter Avalos Make sure that before the call of compress(), the length of the compressed 29fe927c51SPeter Avalos buffer is equal to the available size of the compressed buffer and not 301e9a6b47SJoerg Sonnenberger zero. For Visual Basic, check that this parameter is passed by reference 311e9a6b47SJoerg Sonnenberger ("as any"), not by value ("as long"). 321e9a6b47SJoerg Sonnenberger 331e9a6b47SJoerg Sonnenberger 5. deflate() or inflate() returns Z_BUF_ERROR. 341e9a6b47SJoerg Sonnenberger 35fe927c51SPeter Avalos Before making the call, make sure that avail_in and avail_out are not zero. 36fe927c51SPeter Avalos When setting the parameter flush equal to Z_FINISH, also make sure that 37fe927c51SPeter Avalos avail_out is big enough to allow processing all pending input. Note that a 38fe927c51SPeter Avalos Z_BUF_ERROR is not fatal--another call to deflate() or inflate() can be 39fe927c51SPeter Avalos made with more input or output space. A Z_BUF_ERROR may in fact be 40fe927c51SPeter Avalos unavoidable depending on how the functions are used, since it is not 41fe927c51SPeter Avalos possible to tell whether or not there is more output pending when 42fe927c51SPeter Avalos strm.avail_out returns with zero. See http://zlib.net/zlib_how.html for a 43fe927c51SPeter Avalos heavily annotated example. 441e9a6b47SJoerg Sonnenberger 451e9a6b47SJoerg Sonnenberger 6. Where's the zlib documentation (man pages, etc.)? 461e9a6b47SJoerg Sonnenberger 47*712f98b7SJohn Marino It's in zlib.h . Examples of zlib usage are in the files test/example.c 48*712f98b7SJohn Marino and test/minigzip.c, with more in examples/ . 491e9a6b47SJoerg Sonnenberger 501e9a6b47SJoerg Sonnenberger 7. Why don't you use GNU autoconf or libtool or ...? 511e9a6b47SJoerg Sonnenberger 52fe927c51SPeter Avalos Because we would like to keep zlib as a very small and simple package. 53fe927c51SPeter Avalos zlib is rather portable and doesn't need much configuration. 541e9a6b47SJoerg Sonnenberger 551e9a6b47SJoerg Sonnenberger 8. I found a bug in zlib. 561e9a6b47SJoerg Sonnenberger 57fe927c51SPeter Avalos Most of the time, such problems are due to an incorrect usage of zlib. 58fe927c51SPeter Avalos Please try to reproduce the problem with a small program and send the 59fe927c51SPeter Avalos corresponding source to us at zlib@gzip.org . Do not send multi-megabyte 60fe927c51SPeter Avalos data files without prior agreement. 611e9a6b47SJoerg Sonnenberger 621e9a6b47SJoerg Sonnenberger 9. Why do I get "undefined reference to gzputc"? 631e9a6b47SJoerg Sonnenberger 641e9a6b47SJoerg Sonnenberger If "make test" produces something like 651e9a6b47SJoerg Sonnenberger 661e9a6b47SJoerg Sonnenberger example.o(.text+0x154): undefined reference to `gzputc' 671e9a6b47SJoerg Sonnenberger 681e9a6b47SJoerg Sonnenberger check that you don't have old files libz.* in /usr/lib, /usr/local/lib or 691e9a6b47SJoerg Sonnenberger /usr/X11R6/lib. Remove any old versions, then do "make install". 701e9a6b47SJoerg Sonnenberger 711e9a6b47SJoerg Sonnenberger10. I need a Delphi interface to zlib. 721e9a6b47SJoerg Sonnenberger 731e9a6b47SJoerg Sonnenberger See the contrib/delphi directory in the zlib distribution. 741e9a6b47SJoerg Sonnenberger 751e9a6b47SJoerg Sonnenberger11. Can zlib handle .zip archives? 761e9a6b47SJoerg Sonnenberger 771e9a6b47SJoerg Sonnenberger Not by itself, no. See the directory contrib/minizip in the zlib 781e9a6b47SJoerg Sonnenberger distribution. 791e9a6b47SJoerg Sonnenberger 801e9a6b47SJoerg Sonnenberger12. Can zlib handle .Z files? 811e9a6b47SJoerg Sonnenberger 821e9a6b47SJoerg Sonnenberger No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt 831e9a6b47SJoerg Sonnenberger the code of uncompress on your own. 841e9a6b47SJoerg Sonnenberger 851e9a6b47SJoerg Sonnenberger13. How can I make a Unix shared library? 861e9a6b47SJoerg Sonnenberger 87*712f98b7SJohn Marino By default a shared (and a static) library is built for Unix. So: 88*712f98b7SJohn Marino 89*712f98b7SJohn Marino make distclean 90*712f98b7SJohn Marino ./configure 911e9a6b47SJoerg Sonnenberger make 921e9a6b47SJoerg Sonnenberger 931e9a6b47SJoerg Sonnenberger14. How do I install a shared zlib library on Unix? 941e9a6b47SJoerg Sonnenberger 951e9a6b47SJoerg Sonnenberger After the above, then: 961e9a6b47SJoerg Sonnenberger 971e9a6b47SJoerg Sonnenberger make install 981e9a6b47SJoerg Sonnenberger 991e9a6b47SJoerg Sonnenberger However, many flavors of Unix come with a shared zlib already installed. 1001e9a6b47SJoerg Sonnenberger Before going to the trouble of compiling a shared version of zlib and 1011e9a6b47SJoerg Sonnenberger trying to install it, you may want to check if it's already there! If you 102fe927c51SPeter Avalos can #include <zlib.h>, it's there. The -lz option will probably link to 103fe927c51SPeter Avalos it. You can check the version at the top of zlib.h or with the 104fe927c51SPeter Avalos ZLIB_VERSION symbol defined in zlib.h . 1051e9a6b47SJoerg Sonnenberger 1061e9a6b47SJoerg Sonnenberger15. I have a question about OttoPDF. 1071e9a6b47SJoerg Sonnenberger 1081e9a6b47SJoerg Sonnenberger We are not the authors of OttoPDF. The real author is on the OttoPDF web 1091e9a6b47SJoerg Sonnenberger site: Joel Hainley, jhainley@myndkryme.com. 1101e9a6b47SJoerg Sonnenberger 1111e9a6b47SJoerg Sonnenberger16. Can zlib decode Flate data in an Adobe PDF file? 1121e9a6b47SJoerg Sonnenberger 113fe927c51SPeter Avalos Yes. See http://www.pdflib.com/ . To modify PDF forms, see 114fe927c51SPeter Avalos http://sourceforge.net/projects/acroformtool/ . 1151e9a6b47SJoerg Sonnenberger 1161e9a6b47SJoerg Sonnenberger17. Why am I getting this "register_frame_info not found" error on Solaris? 1171e9a6b47SJoerg Sonnenberger 1181e9a6b47SJoerg Sonnenberger After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib 1191e9a6b47SJoerg Sonnenberger generates an error such as: 1201e9a6b47SJoerg Sonnenberger 1211e9a6b47SJoerg Sonnenberger ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so: 1221e9a6b47SJoerg Sonnenberger symbol __register_frame_info: referenced symbol not found 1231e9a6b47SJoerg Sonnenberger 1241e9a6b47SJoerg Sonnenberger The symbol __register_frame_info is not part of zlib, it is generated by 1251e9a6b47SJoerg Sonnenberger the C compiler (cc or gcc). You must recompile applications using zlib 1261e9a6b47SJoerg Sonnenberger which have this problem. This problem is specific to Solaris. See 1271e9a6b47SJoerg Sonnenberger http://www.sunfreeware.com for Solaris versions of zlib and applications 1281e9a6b47SJoerg Sonnenberger using zlib. 1291e9a6b47SJoerg Sonnenberger 1301e9a6b47SJoerg Sonnenberger18. Why does gzip give an error on a file I make with compress/deflate? 1311e9a6b47SJoerg Sonnenberger 1321e9a6b47SJoerg Sonnenberger The compress and deflate functions produce data in the zlib format, which 1331e9a6b47SJoerg Sonnenberger is different and incompatible with the gzip format. The gz* functions in 134fe927c51SPeter Avalos zlib on the other hand use the gzip format. Both the zlib and gzip formats 135fe927c51SPeter Avalos use the same compressed data format internally, but have different headers 136fe927c51SPeter Avalos and trailers around the compressed data. 1371e9a6b47SJoerg Sonnenberger 1381e9a6b47SJoerg Sonnenberger19. Ok, so why are there two different formats? 1391e9a6b47SJoerg Sonnenberger 140fe927c51SPeter Avalos The gzip format was designed to retain the directory information about a 141fe927c51SPeter Avalos single file, such as the name and last modification date. The zlib format 142fe927c51SPeter Avalos on the other hand was designed for in-memory and communication channel 143fe927c51SPeter Avalos applications, and has a much more compact header and trailer and uses a 144fe927c51SPeter Avalos faster integrity check than gzip. 1451e9a6b47SJoerg Sonnenberger 1461e9a6b47SJoerg Sonnenberger20. Well that's nice, but how do I make a gzip file in memory? 1471e9a6b47SJoerg Sonnenberger 1481e9a6b47SJoerg Sonnenberger You can request that deflate write the gzip format instead of the zlib 149fe927c51SPeter Avalos format using deflateInit2(). You can also request that inflate decode the 150fe927c51SPeter Avalos gzip format using inflateInit2(). Read zlib.h for more details. 1511e9a6b47SJoerg Sonnenberger 1521e9a6b47SJoerg Sonnenberger21. Is zlib thread-safe? 1531e9a6b47SJoerg Sonnenberger 1541e9a6b47SJoerg Sonnenberger Yes. However any library routines that zlib uses and any application- 1551e9a6b47SJoerg Sonnenberger provided memory allocation routines must also be thread-safe. zlib's gz* 1561e9a6b47SJoerg Sonnenberger functions use stdio library routines, and most of zlib's functions use the 157fe927c51SPeter Avalos library memory allocation routines by default. zlib's *Init* functions 158fe927c51SPeter Avalos allow for the application to provide custom memory allocation routines. 1591e9a6b47SJoerg Sonnenberger 1601e9a6b47SJoerg Sonnenberger Of course, you should only operate on any given zlib or gzip stream from a 1611e9a6b47SJoerg Sonnenberger single thread at a time. 1621e9a6b47SJoerg Sonnenberger 1631e9a6b47SJoerg Sonnenberger22. Can I use zlib in my commercial application? 1641e9a6b47SJoerg Sonnenberger 1651e9a6b47SJoerg Sonnenberger Yes. Please read the license in zlib.h. 1661e9a6b47SJoerg Sonnenberger 1671e9a6b47SJoerg Sonnenberger23. Is zlib under the GNU license? 1681e9a6b47SJoerg Sonnenberger 1691e9a6b47SJoerg Sonnenberger No. Please read the license in zlib.h. 1701e9a6b47SJoerg Sonnenberger 1711e9a6b47SJoerg Sonnenberger24. The license says that altered source versions must be "plainly marked". So 1721e9a6b47SJoerg Sonnenberger what exactly do I need to do to meet that requirement? 1731e9a6b47SJoerg Sonnenberger 1741e9a6b47SJoerg Sonnenberger You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In 1751e9a6b47SJoerg Sonnenberger particular, the final version number needs to be changed to "f", and an 1761e9a6b47SJoerg Sonnenberger identification string should be appended to ZLIB_VERSION. Version numbers 1771e9a6b47SJoerg Sonnenberger x.x.x.f are reserved for modifications to zlib by others than the zlib 1781e9a6b47SJoerg Sonnenberger maintainers. For example, if the version of the base zlib you are altering 1791e9a6b47SJoerg Sonnenberger is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and 1801e9a6b47SJoerg Sonnenberger ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also 1811e9a6b47SJoerg Sonnenberger update the version strings in deflate.c and inftrees.c. 1821e9a6b47SJoerg Sonnenberger 1831e9a6b47SJoerg Sonnenberger For altered source distributions, you should also note the origin and 1841e9a6b47SJoerg Sonnenberger nature of the changes in zlib.h, as well as in ChangeLog and README, along 1851e9a6b47SJoerg Sonnenberger with the dates of the alterations. The origin should include at least your 1861e9a6b47SJoerg Sonnenberger name (or your company's name), and an email address to contact for help or 1871e9a6b47SJoerg Sonnenberger issues with the library. 1881e9a6b47SJoerg Sonnenberger 1891e9a6b47SJoerg Sonnenberger Note that distributing a compiled zlib library along with zlib.h and 1901e9a6b47SJoerg Sonnenberger zconf.h is also a source distribution, and so you should change 1911e9a6b47SJoerg Sonnenberger ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes 1921e9a6b47SJoerg Sonnenberger in zlib.h as you would for a full source distribution. 1931e9a6b47SJoerg Sonnenberger 1941e9a6b47SJoerg Sonnenberger25. Will zlib work on a big-endian or little-endian architecture, and can I 1951e9a6b47SJoerg Sonnenberger exchange compressed data between them? 1961e9a6b47SJoerg Sonnenberger 1971e9a6b47SJoerg Sonnenberger Yes and yes. 1981e9a6b47SJoerg Sonnenberger 1991e9a6b47SJoerg Sonnenberger26. Will zlib work on a 64-bit machine? 2001e9a6b47SJoerg Sonnenberger 201fe927c51SPeter Avalos Yes. It has been tested on 64-bit machines, and has no dependence on any 202fe927c51SPeter Avalos data types being limited to 32-bits in length. If you have any 2031e9a6b47SJoerg Sonnenberger difficulties, please provide a complete problem report to zlib@gzip.org 2041e9a6b47SJoerg Sonnenberger 2051e9a6b47SJoerg Sonnenberger27. Will zlib decompress data from the PKWare Data Compression Library? 2061e9a6b47SJoerg Sonnenberger 207fe927c51SPeter Avalos No. The PKWare DCL uses a completely different compressed data format than 208fe927c51SPeter Avalos does PKZIP and zlib. However, you can look in zlib's contrib/blast 2091e9a6b47SJoerg Sonnenberger directory for a possible solution to your problem. 2101e9a6b47SJoerg Sonnenberger 2111e9a6b47SJoerg Sonnenberger28. Can I access data randomly in a compressed stream? 2121e9a6b47SJoerg Sonnenberger 213fe927c51SPeter Avalos No, not without some preparation. If when compressing you periodically use 214fe927c51SPeter Avalos Z_FULL_FLUSH, carefully write all the pending data at those points, and 215fe927c51SPeter Avalos keep an index of those locations, then you can start decompression at those 216fe927c51SPeter Avalos points. You have to be careful to not use Z_FULL_FLUSH too often, since it 217fe927c51SPeter Avalos can significantly degrade compression. Alternatively, you can scan a 218fe927c51SPeter Avalos deflate stream once to generate an index, and then use that index for 219fe927c51SPeter Avalos random access. See examples/zran.c . 2201e9a6b47SJoerg Sonnenberger 2211e9a6b47SJoerg Sonnenberger29. Does zlib work on MVS, OS/390, CICS, etc.? 2221e9a6b47SJoerg Sonnenberger 223fe927c51SPeter Avalos It has in the past, but we have not heard of any recent evidence. There 224fe927c51SPeter Avalos were working ports of zlib 1.1.4 to MVS, but those links no longer work. 225fe927c51SPeter Avalos If you know of recent, successful applications of zlib on these operating 226fe927c51SPeter Avalos systems, please let us know. Thanks. 2271e9a6b47SJoerg Sonnenberger 228fe927c51SPeter Avalos30. Is there some simpler, easier to read version of inflate I can look at to 229fe927c51SPeter Avalos understand the deflate format? 2301e9a6b47SJoerg Sonnenberger 2311e9a6b47SJoerg Sonnenberger First off, you should read RFC 1951. Second, yes. Look in zlib's 2321e9a6b47SJoerg Sonnenberger contrib/puff directory. 2331e9a6b47SJoerg Sonnenberger 2341e9a6b47SJoerg Sonnenberger31. Does zlib infringe on any patents? 2351e9a6b47SJoerg Sonnenberger 2361e9a6b47SJoerg Sonnenberger As far as we know, no. In fact, that was originally the whole point behind 2371e9a6b47SJoerg Sonnenberger zlib. Look here for some more information: 2381e9a6b47SJoerg Sonnenberger 2391e9a6b47SJoerg Sonnenberger http://www.gzip.org/#faq11 2401e9a6b47SJoerg Sonnenberger 2411e9a6b47SJoerg Sonnenberger32. Can zlib work with greater than 4 GB of data? 2421e9a6b47SJoerg Sonnenberger 2431e9a6b47SJoerg Sonnenberger Yes. inflate() and deflate() will process any amount of data correctly. 2441e9a6b47SJoerg Sonnenberger Each call of inflate() or deflate() is limited to input and output chunks 2451e9a6b47SJoerg Sonnenberger of the maximum value that can be stored in the compiler's "unsigned int" 2461e9a6b47SJoerg Sonnenberger type, but there is no limit to the number of chunks. Note however that the 2471e9a6b47SJoerg Sonnenberger strm.total_in and strm_total_out counters may be limited to 4 GB. These 2481e9a6b47SJoerg Sonnenberger counters are provided as a convenience and are not used internally by 2491e9a6b47SJoerg Sonnenberger inflate() or deflate(). The application can easily set up its own counters 2501e9a6b47SJoerg Sonnenberger updated after each call of inflate() or deflate() to count beyond 4 GB. 2511e9a6b47SJoerg Sonnenberger compress() and uncompress() may be limited to 4 GB, since they operate in a 2521e9a6b47SJoerg Sonnenberger single call. gzseek() and gztell() may be limited to 4 GB depending on how 2531e9a6b47SJoerg Sonnenberger zlib is compiled. See the zlibCompileFlags() function in zlib.h. 2541e9a6b47SJoerg Sonnenberger 255fe927c51SPeter Avalos The word "may" appears several times above since there is a 4 GB limit only 256fe927c51SPeter Avalos if the compiler's "long" type is 32 bits. If the compiler's "long" type is 257fe927c51SPeter Avalos 64 bits, then the limit is 16 exabytes. 2581e9a6b47SJoerg Sonnenberger 2591e9a6b47SJoerg Sonnenberger33. Does zlib have any security vulnerabilities? 2601e9a6b47SJoerg Sonnenberger 261fe927c51SPeter Avalos The only one that we are aware of is potentially in gzprintf(). If zlib is 262fe927c51SPeter Avalos compiled to use sprintf() or vsprintf(), then there is no protection 263fe927c51SPeter Avalos against a buffer overflow of an 8K string space (or other value as set by 264fe927c51SPeter Avalos gzbuffer()), other than the caller of gzprintf() assuring that the output 265fe927c51SPeter Avalos will not exceed 8K. On the other hand, if zlib is compiled to use 266fe927c51SPeter Avalos snprintf() or vsnprintf(), which should normally be the case, then there is 267fe927c51SPeter Avalos no vulnerability. The ./configure script will display warnings if an 268fe927c51SPeter Avalos insecure variation of sprintf() will be used by gzprintf(). Also the 269fe927c51SPeter Avalos zlibCompileFlags() function will return information on what variant of 270fe927c51SPeter Avalos sprintf() is used by gzprintf(). 2711e9a6b47SJoerg Sonnenberger 2721e9a6b47SJoerg Sonnenberger If you don't have snprintf() or vsnprintf() and would like one, you can 2731e9a6b47SJoerg Sonnenberger find a portable implementation here: 2741e9a6b47SJoerg Sonnenberger 2751e9a6b47SJoerg Sonnenberger http://www.ijs.si/software/snprintf/ 2761e9a6b47SJoerg Sonnenberger 2771e9a6b47SJoerg Sonnenberger Note that you should be using the most recent version of zlib. Versions 278fe927c51SPeter Avalos 1.1.3 and before were subject to a double-free vulnerability, and versions 279fe927c51SPeter Avalos 1.2.1 and 1.2.2 were subject to an access exception when decompressing 280fe927c51SPeter Avalos invalid compressed data. 2811e9a6b47SJoerg Sonnenberger 2821e9a6b47SJoerg Sonnenberger34. Is there a Java version of zlib? 2831e9a6b47SJoerg Sonnenberger 2841e9a6b47SJoerg Sonnenberger Probably what you want is to use zlib in Java. zlib is already included 2851e9a6b47SJoerg Sonnenberger as part of the Java SDK in the java.util.zip package. If you really want 2861e9a6b47SJoerg Sonnenberger a version of zlib written in the Java language, look on the zlib home 287fe927c51SPeter Avalos page for links: http://zlib.net/ . 2881e9a6b47SJoerg Sonnenberger 2891e9a6b47SJoerg Sonnenberger35. I get this or that compiler or source-code scanner warning when I crank it 2901e9a6b47SJoerg Sonnenberger up to maximally-pedantic. Can't you guys write proper code? 2911e9a6b47SJoerg Sonnenberger 2921e9a6b47SJoerg Sonnenberger Many years ago, we gave up attempting to avoid warnings on every compiler 2931e9a6b47SJoerg Sonnenberger in the universe. It just got to be a waste of time, and some compilers 294fe927c51SPeter Avalos were downright silly as well as contradicted each other. So now, we simply 295fe927c51SPeter Avalos make sure that the code always works. 2961e9a6b47SJoerg Sonnenberger 2971e9a6b47SJoerg Sonnenberger36. Valgrind (or some similar memory access checker) says that deflate is 2981e9a6b47SJoerg Sonnenberger performing a conditional jump that depends on an uninitialized value. 2991e9a6b47SJoerg Sonnenberger Isn't that a bug? 3001e9a6b47SJoerg Sonnenberger 301fe927c51SPeter Avalos No. That is intentional for performance reasons, and the output of deflate 302fe927c51SPeter Avalos is not affected. This only started showing up recently since zlib 1.2.x 303fe927c51SPeter Avalos uses malloc() by default for allocations, whereas earlier versions used 304fe927c51SPeter Avalos calloc(), which zeros out the allocated memory. Even though the code was 305fe927c51SPeter Avalos correct, versions 1.2.4 and later was changed to not stimulate these 306fe927c51SPeter Avalos checkers. 3071e9a6b47SJoerg Sonnenberger 3081e9a6b47SJoerg Sonnenberger37. Will zlib read the (insert any ancient or arcane format here) compressed 3091e9a6b47SJoerg Sonnenberger data format? 3101e9a6b47SJoerg Sonnenberger 3111e9a6b47SJoerg Sonnenberger Probably not. Look in the comp.compression FAQ for pointers to various 3121e9a6b47SJoerg Sonnenberger formats and associated software. 3131e9a6b47SJoerg Sonnenberger 3141e9a6b47SJoerg Sonnenberger38. How can I encrypt/decrypt zip files with zlib? 3151e9a6b47SJoerg Sonnenberger 316fe927c51SPeter Avalos zlib doesn't support encryption. The original PKZIP encryption is very 317fe927c51SPeter Avalos weak and can be broken with freely available programs. To get strong 318fe927c51SPeter Avalos encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib 319fe927c51SPeter Avalos compression. For PKZIP compatible "encryption", look at 320fe927c51SPeter Avalos http://www.info-zip.org/ 3211e9a6b47SJoerg Sonnenberger 3221e9a6b47SJoerg Sonnenberger39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? 3231e9a6b47SJoerg Sonnenberger 3241e9a6b47SJoerg Sonnenberger "gzip" is the gzip format, and "deflate" is the zlib format. They should 325fe927c51SPeter Avalos probably have called the second one "zlib" instead to avoid confusion with 326fe927c51SPeter Avalos the raw deflate compressed data format. While the HTTP 1.1 RFC 2616 3271e9a6b47SJoerg Sonnenberger correctly points to the zlib specification in RFC 1950 for the "deflate" 3281e9a6b47SJoerg Sonnenberger transfer encoding, there have been reports of servers and browsers that 3291e9a6b47SJoerg Sonnenberger incorrectly produce or expect raw deflate data per the deflate 330*712f98b7SJohn Marino specification in RFC 1951, most notably Microsoft. So even though the 3311e9a6b47SJoerg Sonnenberger "deflate" transfer encoding using the zlib format would be the more 3321e9a6b47SJoerg Sonnenberger efficient approach (and in fact exactly what the zlib format was designed 3331e9a6b47SJoerg Sonnenberger for), using the "gzip" transfer encoding is probably more reliable due to 3341e9a6b47SJoerg Sonnenberger an unfortunate choice of name on the part of the HTTP 1.1 authors. 3351e9a6b47SJoerg Sonnenberger 3361e9a6b47SJoerg Sonnenberger Bottom line: use the gzip format for HTTP 1.1 encoding. 3371e9a6b47SJoerg Sonnenberger 3381e9a6b47SJoerg Sonnenberger40. Does zlib support the new "Deflate64" format introduced by PKWare? 3391e9a6b47SJoerg Sonnenberger 3401e9a6b47SJoerg Sonnenberger No. PKWare has apparently decided to keep that format proprietary, since 341fe927c51SPeter Avalos they have not documented it as they have previous compression formats. In 342fe927c51SPeter Avalos any case, the compression improvements are so modest compared to other more 343fe927c51SPeter Avalos modern approaches, that it's not worth the effort to implement. 3441e9a6b47SJoerg Sonnenberger 345fe927c51SPeter Avalos41. I'm having a problem with the zip functions in zlib, can you help? 346fe927c51SPeter Avalos 347fe927c51SPeter Avalos There are no zip functions in zlib. You are probably using minizip by 348fe927c51SPeter Avalos Giles Vollant, which is found in the contrib directory of zlib. It is not 349fe927c51SPeter Avalos part of zlib. In fact none of the stuff in contrib is part of zlib. The 350fe927c51SPeter Avalos files in there are not supported by the zlib authors. You need to contact 351fe927c51SPeter Avalos the authors of the respective contribution for help. 352fe927c51SPeter Avalos 353fe927c51SPeter Avalos42. The match.asm code in contrib is under the GNU General Public License. 354fe927c51SPeter Avalos Since it's part of zlib, doesn't that mean that all of zlib falls under the 355fe927c51SPeter Avalos GNU GPL? 356fe927c51SPeter Avalos 357fe927c51SPeter Avalos No. The files in contrib are not part of zlib. They were contributed by 358fe927c51SPeter Avalos other authors and are provided as a convenience to the user within the zlib 359fe927c51SPeter Avalos distribution. Each item in contrib has its own license. 360fe927c51SPeter Avalos 361fe927c51SPeter Avalos43. Is zlib subject to export controls? What is its ECCN? 362fe927c51SPeter Avalos 363fe927c51SPeter Avalos zlib is not subject to export controls, and so is classified as EAR99. 364fe927c51SPeter Avalos 365fe927c51SPeter Avalos44. Can you please sign these lengthy legal documents and fax them back to us 3661e9a6b47SJoerg Sonnenberger so that we can use your software in our product? 3671e9a6b47SJoerg Sonnenberger 3681e9a6b47SJoerg Sonnenberger No. Go away. Shoo. 369