Nepedia
Back to Discover
Advanced Reader
💻

7z

technology Maturity 7-9 Next article →

The 7z format is a versatile compressed archive file format. It acts as a digital container that holds multiple files together. This container uses various algorithms to shrink the size of data. This process is known as compression. 7z is important because it offers high compression ratios. This means it can make files much smaller than other formats. It also provides strong security through encryption. Because it is an open architecture, it is highly modular. This allows users to stack different compression and encryption methods together.

To understand how 7z works, we must look at its compression methods. One primary method is LZMA, which is a variation of the LZ77 algorithm. LZMA uses a sliding dictionary up to 4 GB in length. It finds duplicate strings and eliminates them to save space. After this, it uses entropy coding to finish the job. Entropy coding uses a Markov chain–based range coder and binary trees. Another method is LZMA2, which is a modified version of LZMA. LZMA2 provides better support for multithreading. It also prevents incompressible data from expanding too much.

There are several other distinct compression types available within the format. Bzip2 is a standard method that uses the Burrows–Wheeler transform. It uses two reversible transformations to reduce symbols. PPMd is another option based on Dmitry Shkarin's 2002 research. It uses prediction by partial matching to compress data. The format also supports DEFLATE, which is a standard algorithm. DEFLATE is found in many common files like ZIP and PDF. 7-Zip even includes a custom DEFLATE encoder. This encoder can sometimes beat the standard zlib version in size.

Before the main compression happens, 7z can use pre-processing filters. These filters help the compression algorithms work more efficiently. For example, the BCJ and BCJ2 filters are used for executables. These filters normalize jump targets in machine language. Instead of saying "jump 1655 bytes backwards," they say "jump to address 5554." This makes the code more predictable and easier to compress. There are also filters for different types of processors. These include ARM, PowerPC, and x86-64. Other filters include Delta encoding for multimedia and Swap filters for endianness.

The history of 7z is tied to the 7-Zip archiver. This program is available under the GNU Lesser General Public License. In December 2008, the LZMA SDK was placed in the public domain. This allows developers to use the compression technology freely. Since 2015, the 7z format specification has been included with the 7-Zip source code. This specification is written in plain text for anyone to read. The latest stable version of both 7-Zip and the LZMA SDK is version 26.00.

Security is a major feature of the 7z format. It uses AES-256 bit encryption to protect data. This means it uses a 256-bit key to lock the files. The key comes from a passphrase provided by the user. To make the password harder to crack, 7z uses key stretching. This process uses an algorithm based on the SHA-256 hash function. The computer executes this function 524,288 times. This creates a significant delay on slow computers. This delay makes brute-force attacks much more difficult for hackers.

Despite its strengths, the 7z format has some specific limitations. It does not store filesystem permissions like UNIX owner or group settings. This can make it difficult to use for certain backups. On UNIX systems, users often use a workaround. They convert data to a tar bitstream before using 7z. Another limitation is that 7z lacks recovery records. This means the data is vulnerable to degradation. If a file is part of a multi-part archive, you must have all segments. For example, you might need xxx.7z.001 and xxx.7z.002 to reassemble the archive.

7z connects to many other areas of computing and data management. Many Linux distributions use a similar method for packaging software. Systems like Debian, Fedora, and Arch use the .tar.xz format. This format uses the LZMA2 algorithm natively. While 7z is a specific format, its technology influences how we handle large-scale data. The ability to split massive files into smaller parts is essential for internet transfers. The 7z format remains a powerful tool for managing digital information efficiently.

712 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.