ArticleslgStudy

computer science

7z

7z is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand 7z rather than just read about it. In short: 7z is a compressed archive file format that supports several different data compression, encryption and pre-processing algorithms. The 7z format initially appeared as implemented by the 7-Zip archiver.

7z — main illustration
7z — illustration

Key takeaways

  • 7z belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect 7z to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of 7z from memory before moving on to harder problems.

Reference excerpt

7z is a compressed archive file format that supports several different data compression, encryption and pre-processing algorithms. The 7z format initially appeared as implemented by the 7-Zip archiver. The 7-Zip program is publicly available under the terms of the GNU Lesser General Public License. The LZMA SDK 4.62 was placed in the public domain in December 2008. The latest stable version of 7-Zip and LZMA SDK is version 26.00. The 7z file format specification is distributed with 7-Zip's source code since 2015. The specification can be found in plain text format in the "doc" sub-directory of the source code distribution.

Features and enhancements The 7z format provides the following main features:

Open, modular architecture that allows any compression, conversion, or encryption method to be stacked. High compression ratios (depending on the compression method used). AES-256 bit encryption. Zip 2.0 (Legacy) Encryption Large file support (up to approximately 16 exbibytes, or 264 bytes). Unicode file names. Support for solid compression, where multiple files of similar type are compressed within a single stream, in order to exploit the combined redundancy inherent in similar files. Compression and encryption of archive headers. Support for multi-part archives: e.g. xxx.7z.001, xxx.7z.002, ... (see the context menu items Split File... to create them and Combine Files... to re-assemble an archive from a set of multi-part component files). Support for custom codec plugin DLLs. The format's open architecture allows additional future compression methods to be added to the standard.

Compression methods The following compression methods are currently defined:

LZMA – A variation of the LZ77 algorithm, using a sliding dictionary up to 4 GB in length for duplicate string elimination. The LZ stage is followed by entropy coding using a Markov chain–based range coder and binary trees. LZMA2 – modified version of LZMA providing better multithreading support and less expansion of incompressible data. Bzip2 – The standard Burrows–Wheeler transform algorithm. Bzip2 uses two reversible transformations; BWT, then move to front with Huffman coding for symbol reduction (the actual compression element). PPMd – Dmitry Shkarin's 2002 PPMdH (PPMII (Prediction by Partial matching with Information Inheritance) and cPPMII (complicated PPMII)) with small changes: PPMII is an improved version of the 1984 PPM compression algorithm (prediction by partial matching). DEFLATE – Standard algorithm based on 32 kB LZ77 and Huffman coding. Deflate is found in several file formats including ZIP, gzip, PNG and PDF. 7-Zip contains a from-scratch DEFLATE encoder that frequently beats the de facto standard zlib version in compression size, but at the expense of CPU usage. A suite of recompression tools called AdvanceCOMP contains a copy of the DEFLATE encoder from the 7-Zip implementation; these utilities can often be used to further compress the size of existing gzip, ZIP, PNG, or MNG files.

Pre-processing filters The LZMA SDK comes with the BCJ and BCJ2 preprocessors included, so that later stages are able to achieve greater compression: For x86, ARM, PowerPC (PPC), IA-64 Itanium, and ARM Thumb processors, jump targets are "normalized" before compression by changing relative position into absolute values. For x86, this means that near jumps, calls and conditional jumps (but not short jumps and conditional jumps) are converted from the machine language "jump 1655 bytes backwards" style notation to normalized "jump to address 5554" style notation; all jumps to 5554, perhaps a common subroutine, are thus encoded identically, making them more compressible.

BCJ – Converter for 32-bit x86 executables. Normalises target addresses of near jumps and calls from relative distances to absolute destinations. BCJ2 – Pre-processor for x86-64 executables. BCJ2 is an improvement on BCJ, adding additional x86 jump/call instruction processing. Near jump, near call, conditional near jump targets are split out and compressed separately in another stream. BCJ-type filters for ARM64, ARM32, ARM-Thumb, PowerPC, SPARC. Delta encoding – delta filter, basic preprocessor for multimedia data. Swap2/Swap4 – endianess-swap filter.

Encryption The 7z format supports encryption with the AES algorithm with a 256-bit key. The key is generated from a user-supplied passphrase using an algorithm based on the SHA-256 hash function. The SHA-256 is executed 219 (524288) times, which causes a significant delay on slow PCs before compression or extraction starts. This technique is called key stretching and is used to make a brute-force search for the passphrase more difficult. Current GPU-based, and custom hardware attacks limit the effectiveness of this particular method of key stretching, so it is still important to choose a strong password. The 7z format provides the option to encrypt the filenames of a 7z archive.

Limitations The 7z format does not store filesystem permissions (such as UNIX owner/group permissions or NTFS ACLs), and hence can be inappropriate for backup/archival purposes. A workaround on UNIX-like systems for this is to convert data to a tar bitstream before compressing with 7z. But GNU tar (common in many UNIX environments) can also compress with the LZMA2 algorithm ("xz") natively, without the use of 7z, using the "-J" switch. The resulting file extension is ".tar.xz" or ".txz" and not ".tar.7z". This method of compression has been adopted with many distributions for packaging, such as Arch, Debian (deb), Fedora (rpm) and Slackware. (The older "lzma" format is less efficient.) On the other hand, tar does not save the filesystem encoding, which means that tar compressed filenames can become unreadable if decompressed on a different computer. The 7z format does not allow extraction of some "broken files"—that is (for example) if one has the first segment of a series of 7z files, 7z cannot give the start of the files within the archive—it must wait until all segments are downloaded. The 7z format also lacks recovery records, making it vulnerable to data degradation unless used in conjunction with external solutions, like parchives, or within filesystems with robust error-correction. By way of comparison, zip files also lack a recovery feature while the rar format has one.

See also Comparison of archive formats List of archive formats Open file format

References

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with 7z

Start with the simplest possible case. Write down what 7z claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to 7z before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about 7z ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of 7z

In research
7z appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses 7z in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
7z is common in secondary-school and first-year university syllabi. It links to neighbouring topics Archive formats, Computer-related introductions in 1999, Russian inventions, so understanding it makes those chapters shorter.
In everyday life
Look for 7z outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “7z” →

How to study 7z in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what 7z means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain 7z out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is 7z in simple terms?

7z is a compressed archive file format that supports several different data compression, encryption and pre-processing algorithms. The 7z format initially appeared as implemented by the 7-Zip archiver.

Why does 7z matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study 7z?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on 7z.

Tags

  • Archive formats
  • Computer-related introductions in 1999
  • Russian inventions

Keep exploring