ZIP archive file format

Typical file name extensions
.zip
Magic bytes
0x50 0x4b at offset 0x00
MIME types
application/zip
Compression types
Deflate (specified in RFC 1951)
A couple of others, which usually don't get used because Deflate is superior.
Popularity
Very high; quasi standard under Windows.
Meta data
Optional archive comment.
Optional comment per entry.
All kinds of system-specific data (like file attributes) can be added per file using so called extra fields.
Limitations
Internal offset values are 32 bits large, so only files up to 4 GB can be stored (the format was extended to use 64 bit integers, but not all programs support that).
No support for extended character sets in file names.
Data recovery
PKZIPFIX is a tool that creates a new ZIP archive from any damaged archive, putting all non-damaged file entries into that new archive.
Checksums (CRC32) are created on each included file to identify data corruption, but no error correction codes are used.
Encryption
Supported by the file format, but there is a known plain-text attack (Biham and Kocher).
ODP lists quite a few password recovery tools.
Solid archives possible?
No.
A work-around to improve compression ratio would be to create a ZIP archive with all entries being uncompressed, and putting that archive into another ZIP archive, using regular compression.
Support for multiple volumes?
Yes, the format provides signatures to identify archive files that are not the first volume. However, all parts of a multi-volume archive have the same name, so they cannot be put into one directory.
Libraries
The Java standard runtime library has code to access and create ZIP files in the package java.util.zip
Description
A file format created by PKWare for its pkzip / pkunzip shareware tools.
Specification
PKWare has designed the file format and offers an application note that describes it.
Other links
ODP list of Windows archivers, most support ZIP
Info-ZIP. Free port of ZIP utilities to almost any platform. Written in C.
WinZip. Arguably the most popular ZIP application (commercial).

Last modification 2002-02-06

nav
undefined
nav
undefined
More...
nav
undefined
[Close]
1