Format Overview
FromDOC/7zFormat.txt:
7z archive can contain files compressed with any method. The format supports:
- Solid compression
- Multiple compression methods
- Strong AES-256 encryption
- Large file support (16 EB limit)
- Unicode filenames
- File attributes and timestamps
Archive Structure
A 7z archive consists of:Signature Header
From7z.h (lines 11-14):
Header Types
FromDOC/7zFormat.txt (lines 100-150):
Compression Methods
FromDOC/Methods.txt, method IDs:
Common Methods
Filters
Folder Structure
From7z.h (lines 42-51):
- Can contain multiple files (solid compression)
- Defines the compression method chain
- Stores coder properties
Coder Information
From7z.h (lines 24-30):
File Information
File Item
From7z.h (lines 56-66):
File Attributes
Windows attributes:Encryption
7zAES
Method ID:06 F1 07 01
From DOC/Methods.txt (lines 172-173):
- Concatenate: Password + Salt
- Hash with SHA-256, repeated 2^NumCycles times
- Result: 32-byte AES key
Header Encryption
When-mhe=on is used:
- Archive headers are compressed
- Compressed headers are encrypted with AES-256
- Only signature header remains unencrypted
- Password required to list files
Archive Database
From7z.h (lines 79-96):
Format Limits
Reading 7z Archives
Opening Archive
FromDOC/7zC.txt (lines 93-107):
Extracting Files
Creating 7z Archives
Archive Handler
FromCPP/7zip/Archive/7z/7zHandler.h:
Update Operations
Format Advantages
High Compression
LZMA2 provides excellent compression ratios
Solid Compression
Compress similar files together for better ratios
Strong Encryption
AES-256 encryption with SHA-256 key derivation
Large File Support
Support for files and archives up to 16 EB
Unicode Names
Full Unicode support for filenames
Extensible
Support for custom compression methods
Format Comparison
Implementation Files
Key source files:- Format handler:
CPP/7zip/Archive/7z/7zHandler.cpp - Archive reader:
C/7zArcIn.c - Decoder:
C/7zDec.c - Header structures:
C/7z.h - Format constants:
CPP/7zip/Archive/7z/7zHeader.h
Format Documentation
Complete format specification:DOC/7zFormat.txt- Full format specificationDOC/Methods.txt- Compression method IDsDOC/7zC.txt- ANSI-C decoder documentation