You need to send a tax document over email. Or share a contract through a messaging app. Or upload financial records to a shared drive. The file contains sensitive data, and the channel you're using isn't end-to-end encrypted (email certainly isn't). File-level encryption solves this: encrypt the file before it leaves your machine, and only someone with the password can open it.
The problem isn't that encryption is hard — it's that most people use it wrong. They encrypt a ZIP with ZipCrypto (trivially broken), set a 4-character password (brute-forced in seconds), or password-protect a PDF without realizing that "PDF owner password" doesn't actually prevent access. This guide covers how file encryption actually works, which methods are secure, and which are security theater.
How File Encryption Works
File encryption takes plaintext (your file) and a key (derived from your password) and produces ciphertext (encrypted data) using a symmetric cipher. The standard cipher is AES-256 (Advanced Encryption Standard with 256-bit keys), adopted by NIST in 2001 after a 5-year public competition won by Belgian cryptographers Joan Daemen and Vincent Rijmen.
AES-256 is used by the U.S. government for TOP SECRET data. It's not going to be broken by someone trying to read your tax return. The weak link is always the password. A key derivation function (KDF) converts your human-memorable password into a 256-bit key. Good KDFs like PBKDF2, bcrypt, and Argon2 add computational cost to resist brute-force attacks. But a 4-character password has only ~10 million possibilities regardless of the KDF — breakable in seconds.
Rule of thumb: AES-256 encryption with a 12+ character passphrase containing mixed case, numbers, and symbols is unbreakable with current and foreseeable technology. The same encryption with "password123" is broken before lunch.
Archive Encryption: 7Z vs ZIP
Encrypting an archive is the most versatile approach — any file type can be encrypted by placing it in an encrypted archive.
7Z (AES-256) — Recommended
7-Zip's 7Z format uses AES-256 encryption with a key derived from the password via SHA-256 (262,144 iterations). This is the strongest archive encryption readily available. 7Z also supports encrypting filenames — without this, an attacker can see the names and sizes of files inside the archive even without the password.
How to create an encrypted 7Z:
- 7-Zip GUI: Right-click → 7-Zip → Add to archive → Set encryption to AES-256, enter password, check "Encrypt file names"
- Command line:
7z a -p -mhe=on archive.7z files/(-pprompts for password,-mhe=onencrypts headers/filenames)
The recipient needs 7-Zip or a compatible tool (p7zip on Linux, Keka on macOS) to decrypt. 7Z is convertible to ZIP but you'd lose the encryption in the process — encrypted archives must be decrypted by the recipient.
ZIP Encryption: ZipCrypto vs AES
ZipCrypto (the default ZIP encryption in many tools) uses a proprietary stream cipher that was broken in 2004 by Eli Biham and Paul Kocher. Known-plaintext attacks can recover the key in minutes if any file in the archive has a known header (and most files do — JPEG, PNG, PDF, DOCX all start with known bytes). Never use ZipCrypto for actual security.
AES-256 in ZIP (WinZip's extension, widely supported) is secure. But it's not part of the original ZIP specification, so compatibility varies. Windows Explorer can't extract AES-encrypted ZIPs natively; you need WinZip, 7-Zip, or similar tools.
Bottom line: if you need encryption, use 7Z with AES-256 and filename encryption. If you must use ZIP, ensure AES-256 is selected (not ZipCrypto).
PDF Encryption
PDF supports two types of password protection, and they are very different:
| Type | What It Does | Security Level |
|---|---|---|
| User password (open password) | Encrypts the document; must enter password to open/view | Strong (AES-256 in PDF 2.0) |
| Owner password (permissions password) | Restricts printing, copying, editing — but document opens without password | Weak (trivially bypassed by any PDF editor) |
The owner password is not security. It's a polite request that PDF viewers honor voluntarily. Any tool that ignores the flag (including many free PDF editors and all programming libraries) can copy text, print, and edit the document freely. If you need actual protection, use a user password.
PDF encryption has evolved through several versions:
- PDF 1.1-1.3: 40-bit RC4 — breakable in seconds, completely insecure
- PDF 1.4: 128-bit RC4 — outdated but not trivially broken
- PDF 1.6: 128-bit AES — adequate
- PDF 2.0: 256-bit AES — current standard, secure
When creating password-protected PDFs, ensure the tool uses AES-256 (PDF 2.0). Older tools default to RC4, which is insecure. Converting DOCX to PDF with password protection is a common workflow for sharing sensitive documents.
Microsoft Office Document Encryption
DOCX, XLSX, and PPTX files can be password-encrypted through File → Info → Protect Document → Encrypt with Password. Since Office 2016, this uses AES-256 with SHA-512 key derivation (100,000+ iterations). It's genuinely strong encryption — there's no backdoor.
The evolution matters:
- Office 97-2003 (DOC/XLS/PPT): 40-bit RC4. Crackable in under a minute with tools like hashcat. If you have encrypted DOC files, the password provides zero protection against a motivated attacker.
- Office 2007-2010: 128-bit AES with SHA-1 KDF. Adequate but the low iteration count (50,000) makes brute-force faster than ideal.
- Office 2013+: 256-bit AES with SHA-512 KDF (100,000 iterations). Secure against brute-force with a reasonable password.
Important: encrypted DOCX files can only be opened by Microsoft Office or compatible software (LibreOffice handles them). The encryption doesn't survive format conversion — converting encrypted DOCX to PDF requires entering the password first, and the output PDF is unencrypted unless you add PDF encryption separately.
GPG/PGP File Encryption
GNU Privacy Guard (GPG, the open-source implementation of the PGP standard) can encrypt any file using either symmetric (password) or asymmetric (public key) encryption.
Symmetric (password): gpg -c --cipher-algo AES256 file.pdf — produces file.pdf.gpg. Decrypt with gpg -d file.pdf.gpg > file.pdf. The recipient needs GPG installed and the password.
Asymmetric (public key): gpg -e -r recipient@email.com file.pdf — encrypts using the recipient's public key. Only their private key can decrypt it. No shared password needed. This is the gold standard for secure file sharing, but requires both parties to use GPG and manage keys.
GPG encryption is format-agnostic. The encrypted output is a binary blob that reveals nothing about the original file — not even its name or type. It's the most secure option but has the highest friction: both parties need GPG software, and key management is notoriously user-unfriendly.
Common Encryption Mistakes
- Using ZipCrypto instead of AES. Many tools default to ZipCrypto for ZIP encryption. It's broken. Always verify AES-256 is selected, or use 7Z instead.
- Short passwords. A 6-character password (lowercase only) has 308 million combinations — brute-forced in seconds with modern GPUs. Use 12+ characters with mixed types, or better yet, a passphrase like "correct horse battery staple" (xkcd 936).
- Sending the password through the same channel as the file. If you email an encrypted file and email the password, anyone who intercepts the email has both. Send the password through a different channel (text message, phone call, Signal).
- Relying on PDF owner passwords. The permissions-only password doesn't encrypt the document. It's a metadata flag that viewers are supposed to honor but don't have to.
- Not encrypting filenames in archives. Default ZIP and even some 7Z configurations leave filenames visible. An attacker sees "tax-return-2025.pdf" and "bank-statements-march.csv" in the archive listing, even without the password. Always enable header/filename encryption.
- Encrypting with obsolete algorithms. RC4, DES, and 40-bit encryption are all broken. Verify your tool uses AES-128 (minimum) or AES-256 (recommended).
Which Encryption Method to Use
| Scenario | Recommended Method | Why |
|---|---|---|
| Emailing a document to one person | 7Z with AES-256 + password via text/phone | Universal, strong, recipient just needs 7-Zip |
| Sharing a PDF with a client | PDF user password (AES-256, PDF 2.0) | Client opens normally in any PDF reader |
| Sending sensitive data to a technical recipient | GPG asymmetric encryption | No shared password, strongest security |
| Protecting files on a USB drive | 7Z encrypted archive or VeraCrypt volume | Protects against theft/loss |
| Restricting PDF printing/copying | PDF owner password (but understand it's not real security) | Only deters casual users, not determined ones |
| Encrypting a spreadsheet | XLSX built-in encryption (Office 2013+) | AES-256, opens normally in Excel |
File encryption is one of those tools that's either done right or provides false confidence. The difference between ZipCrypto and AES-256, between a PDF owner password and a user password, between "123456" and a 16-character passphrase — these aren't gradual differences. They're the difference between minutes-to-crack and centuries-to-crack.
For most file sharing scenarios, an encrypted 7Z archive with a strong passphrase, delivered separately from the file, is the right answer. It's secure, free, cross-platform, and doesn't require the recipient to learn GPG key management. Use it.