[HOW TO ENCRYPT A FILE]

Four practical methods, and how to choose between them without over-thinking it.

Encrypting a file means transforming it so that only someone with the key can read it. The mechanics are straightforward; the decision that matters is which method fits what you are actually trying to do — send a file to someone, protect a folder on your laptop, or archive something long-term.

[PICK THE METHOD THAT MATCHES THE GOAL]

Goal Best method Why
Send one file to someoneBrowser encryption or 7-ZipThe recipient needs no special software beyond a common tool
Protect a working folder on your own machineVeraCrypt containerMounts as a drive; files stay encrypted at rest without re-encrypting each time
Protect everything if the laptop is stolenBitLocker or FileVaultFull-disk, automatic, no per-file effort
Archive something for years7-Zip or GnuPGOpen formats with implementations that will still exist in a decade
Encrypt on a machine you cannot install software onBrowser encryptionNothing to install and nothing uploaded

[THE METHODS, STEP BY STEP]

In your browser (no install)

Open the file encryption tool, choose your file, pick a password or generate a random 256-bit key, and download the encrypted result. Everything runs locally, so the file is never uploaded. Best for sending a single file or working on a locked-down machine.

7-Zip (Windows, free)

Right-click the file → 7-Zip → Add to archive. Set the archive format to 7z, enter a password, and tick Encrypt file names — without that, anyone can still read the list of files inside. It uses AES-256. Widely installed, which makes it a safe assumption for a recipient.

macOS encrypted disk image

Open Disk Utility → File → New Image → Image from Folder. Choose 256-bit AES encryption and set a password. You get a .dmg that mounts as a drive when unlocked. Built in, so nothing to install.

VeraCrypt (cross-platform)

Create a container file, mount it as a drive letter, and put files inside. Everything written to it is encrypted automatically. The right choice for a set of files you work with regularly rather than a one-off transfer.

Windows EFS — use with caution

Right-click → Properties → Advanced → Encrypt contents to secure data. It is transparent and requires no password entry, because it is tied to your Windows account. That convenience is also the catch: files become unrecoverable after a Windows reinstall unless you exported the EFS certificate first, and it is unavailable on Home editions. Export the certificate immediately if you use it.

[MISTAKES THAT UNDO THE ENCRYPTION]

  • Sending the password with the file. An encrypted attachment and its password in the same email provide no protection whatsoever. Use a different channel for the password.
  • A weak password. The cipher is never the weak point; the password is. A short or reused password can be attacked offline at high speed. Use a long passphrase or a generated one.
  • Leaving the original in place. Encrypting a copy while the unencrypted original sits in the same folder, in the recycle bin, or in cloud sync history achieves nothing.
  • Not testing the decryption. Decrypt the file once, immediately, before deleting the original. This catches a mistyped password while it still costs nothing.
  • Not saving the key. Put it in a password manager at the moment you create it, not later.
  • Assuming the filename is private. Most methods leave the filename visible. Name the encrypted file neutrally if the name itself is sensitive.

[HOW TO ENCRYPT A FILE]

Encrypt a file with a password so only someone holding the key can read it.

  1. Choose a method. Pick browser-based encryption for sending a single file, 7-Zip or a macOS disk image for local archives, or VeraCrypt for a folder you work with regularly.
  2. Select a strong password or key. Use a long passphrase or a generated random key. The cipher is never the weak point — the password is.
  3. Encrypt the file. Run the encryption. If the tool offers to encrypt filenames as well as contents, enable it.
  4. Test the decryption. Decrypt the file once immediately to confirm the password works, before deleting or overwriting the original.
  5. Store the key separately. Save the password or key in a password manager, and never send it through the same channel as the file.

[FREQUENTLY ASKED QUESTIONS]

What is the easiest way to encrypt a file?

For a single file, browser-based encryption is the fastest route — there is nothing to install and, with a client-side tool, nothing is uploaded. On Windows, right-clicking and creating a password-protected 7-Zip archive is equally quick if 7-Zip is already installed.

How do I encrypt a file with a password?

Every method above accepts a password. The tool converts it into an encryption key using a key-derivation function — this site uses PBKDF2 with 600,000 iterations, which makes each guessing attempt expensive. Your password's own strength still sets the ceiling, so use a long passphrase.

Is encrypting a file online safe?

It depends entirely on whether the file is uploaded. A service that encrypts on its own servers sees your plaintext and your key. A client-side tool performs the encryption in your browser so nothing is transmitted — you can verify that in the Network tab of your browser developer tools.

Can I encrypt a folder rather than a single file?

Compress the folder into an archive first and encrypt the archive, or use a VeraCrypt container that mounts as a drive. On Windows, 7-Zip encrypts an entire folder in one step — enable the encrypt-file-names option so the folder structure is hidden too.

Does encryption change the file size?

Only slightly. Encryption adds a small fixed overhead for the header, initialisation vector and authentication tag — typically a few hundred bytes. If you compress before encrypting, the result is usually smaller than the original. Compressing after encrypting achieves nothing, because encrypted data is statistically random.

Which is better: AES or ChaCha20?

Both are secure and neither has a practical attack against it. AES-256 is usually faster on desktop and laptop CPUs because of dedicated hardware instructions; ChaCha20-Poly1305 is faster in pure software, which favours older phones and low-power devices. If you have no specific reason to choose, take the default.