How to Encrypt Files on Windows, Mac, and Linux

Learn how to encrypt files on Windows, Mac, and Linux step by step. Complete 2026 guide with examples, free tools, and security best practices.

Published on 27 May 2026
Reading Time 7
Number of Words 1351

How to Encrypt Files on Windows, Mac, and Linux

File encryption is an essential method for protecting confidential information by converting readable data into unreadable code that can only be decrypted with the correct key or password.

Whether you're protecting personal documents, business files, or sensitive information, encrypting files adds a crucial layer of security.

How Does File Encryption Work?

Encryption works by transforming the original content of a file (text, image, video, etc.) into unreadable characters using complex, random, and unbreakable algorithms. During this process, a decryption key is created, providing the only realistic means to restore the data to its original, readable form.

The most commonly used encryption methods today have never been compromised and include:

  • AES-256 bits: The industry standard for strong encryption

  • OpenPGP: Open source encryption protocol

  • SHA-3: Advanced cryptographic hash algorithm

Encryption in Windows

Method 1: Using EFS (Encrypting File System)

EFS is available in Windows Pro, Enterprise, and Education editions, and encrypts individual files using the user account certificate.

Steps to encrypt with EFS:

  1. Right-click on the file or folder you want to encrypt.

  2. Select  Properties  from the context menu.

  3. Click on  Advanced  under the General tab

  4. Check the box  to encrypt content to protect data

  5. Press  OK  and then  Apply

  6. Choose whether you want to encrypt only the file or the entire folder

  7. Back up your encryption key and certificate when prompted.

Method 2: Using BitLocker (Windows Pro/Enterprise)

BitLocker provides transparent, full-disk encryption that works automatically once enabled. Files are encrypted using your Windows account credentials and are automatically decrypted when you log in.

Steps to enable BitLocker:

  1. Go to  Control Panel > System and Security > BitLocker Drive Encryption

  2. Select the drive you want to encrypt

  3. Follow the wizard to activate BitLocker

  4. Choose your recovery method (iCloud account or unique keys)

  5. Confirm and begin encryption.

Encryption in macOS

Method 1: FileVault (Full Disk)

FileVault encrypts your entire startup disk using XTS-AES-128 encryption. Once enabled, all files are automatically and transparently encrypted and decrypted.

Steps to activate FileVault:

  1. Open the Apple menu and go to  System Settings

  2. Select  Privacy and Security

  3. Click on  FileVault  on the right

  4. Press the Activate button   and follow the instructions

  5. Sign in to your iCloud account if you haven't already.

  6. Choose your recovery method (iCloud or unique recovery keys)

  7. Confirm your choice to begin disk encryption

Method 2: Disk Utility (Individual Files)

This method allows you to create encrypted disk images for specific folders.

Steps to encrypt with Disk Utility:

  1. Open  Disk Utility  (press CMD + Spacebar and search for "Disk Utility")

  2. Go to  File > New Image > Image from Folder

  3. Select the folder that contains the files to encrypt

  4. Click on  Choose

  5. Select where to save the encrypted folder

  6. Choose the encryption level (recommended: AES-256 bits)

  7. Set a secure password

  8. The encrypted folder will be saved as a disk image file.

Encryption in Linux

Using LUKS (Linux Unified Key Setup)

LUKS is the disk encryption standard for Linux.

Encryption options in Linux:

  1. During installation: Choose "Encrypt my home folder" when prompted during system installation.

  2. Using GnuPG: Install GnuPG via terminal  sudo apt-get install gnupg and run  gpg -c filename to encrypt a file.

  3. With cryptsetup: Create an encrypted disk image using the cryptsetup command

Encryption with Third-Party Tools

7-Zip (Free - Cross-platform)

7-Zip is an open-source compression tool that provides strong AES-256 encryption.

Steps to encrypt with 7-Zip:

  1. Download and install 7-Zip from its official website

  2. Right-click on the files you want to encrypt

  3. Select  7-Zip > Add to archive

  4. In  File format , choose  7z  or  ZIP

  5. In the  Encryption section , enter your password

  6. Select  AES-256  as the encryption method

  7. Encrypt  filenames  (only available in 7z format)

  8. Click  OK  to create the encrypted file.

VeraCrypt (Free - Open Source)

VeraCrypt is a free, open-source software that creates encrypted virtual disks or encrypts entire partitions.

VeraCrypt Features:

  • It supports Windows, macOS, and Linux.

  • It uses AES, Serpent, and Twofish algorithms

  • It allows system partition encryption

  • It offers a portable mode for running from USB.

  • It supports cascading encryption of multiple algorithms.

AxCrypt Premium

AxCrypt makes encryption simple enough for anyone and offers public-key cryptography for securely sharing encrypted files.

Advantages of AxCrypt:

  • Simple and intuitive interface

  • AES-256 encryption

  • Integration with cloud storage

  • Compatible with Windows, macOS, Android and iOS

  • It allows you to open and edit encrypted files directly

Cryptomator (For Cloud Storage)

Cryptomator specializes in encrypting files before uploading them to cloud storage services.

Cryptomator features:

  • Client-side encryption (AES-256)

  • Compatible with over 30 cloud storage services

  • Works with Dropbox, Google Drive, OneDrive

  • Open source and free

  • Available for Windows, macOS, Linux, Android and iOS

Word Document Encryption

On Windows

  1. Open the Word document you want to encrypt

  2. Click on  File  in the upper left corner

  3. Select  Information > Protect Document

  4. Choose  Encrypt with password

  5. Enter a password and confirm it

  6. The document is now protected with encryption.

On macOS

  1. Open the Word document

  2. Click on  Tools  in the top ribbon

  3. Select  Protect document

  4. Enter a password to open and/or edit the document

  5. Re-enter your password when prompted

  6. Click  OK

PDF encryption

You can protect PDF documents with passwords and access restrictions.

Options for encrypting PDFs:

  • Adobe Acrobat: Go to File > Password Protect

  • Online tools: iLovePDF, Smallpdf, PDF24 (be careful with sensitive documents)

  • Local software: LibreOffice, PDFtk, qpdf for greater security

Encryption on Mobile Devices

Most smartphones rely on PINs or biometric authentication, but for truly sensitive data you need an encryption app.

Recommended mobile apps:

  • AxCrypt: Available for Android and iOS

  • OpenKeychain: Free open source app for Android

  • Cryptomator: For iOS and Android

  • SSE - File/Text Encryption: For mobile devices

General steps with OpenKeychain:

  1. Create a key when you open the app for the first time

  2. Tap the 3 horizontal lines and select  Encrypt/Decrypt

  3. Tap  Encrypt files  and choose the files

  4. Set a password in the options menu

  5. Check  Delete files after encryption  if desired

  6. Save the encrypted file to the desired location.

Best Security Practices

Use Strong Passwords

Create passwords with at least 16 characters, mixing uppercase letters, lowercase letters, numbers, and special characters. Avoid dictionary words or personal information.

Perform backups

Always back up recovery keys or passwords to a secure location separate from your encrypted files. Consider using a password manager like 1Password or Dashlane to store keys.

Delete Original Files

Some encryption methods create a copy of the file, leaving the original intact. Remember to delete the originals to prevent unauthorized access.

Keep your software updated

Regularly update your encryption tools to ensure you have the latest security patches and improvements.

Verify that the encryption works

Verify that encrypted files cannot be opened without the correct password or key before relying on encryption for sensitive data.

Comparison of Encryption Methods

Method Encryption Fortress Ease of Use Best For
BitLocker/FileVault AES-128 or AES-256 Easy (automatic once enabled) Full disk protection, transparent encryption
7-Zip AES-256 Easy (right-click to encrypt) Individual files, sharing encrypted files
VeraCrypt AES-256 (multiple algorithms) Moderate (requires configuration) Advanced users, large encrypted containers
Cryptomator AES-256 Easy Cloud storage encryption
AxCrypt AES-256 Very easy Simple cross-platform encryption
PDF Encryption AES-128 or AES-256 Easy Document protection, PDF sharing

How to Decrypt Files

The correct way to decrypt files depends on how they were encrypted.

Common decryption methods:

  1. Using a decryption key: Files encrypted with a specific key can only be decrypted with the same key.

  2. Password-based decryption: Enter the correct password into the decryption software.

  3. Using digital certificates or IDs: In business environments, files are encrypted using digital certificates.

  4. Decryption software: Use software compatible with the encryption method used.

Frequently Asked Questions

What happens if I forget my encryption password?

You can lose access to the encrypted file completely if you forget your password. Some encryption methods allow you to recover files through other means, such as logging into a trusted account (for example, iCloud for macOS).

Can I encrypt files on my phone and access them on my computer?

Yes, you can access encrypted files on your phone from your computer if the encrypted file format is compatible with both operating systems. This is usually possible with third-party encryption software that works on both mobile and desktop devices.

What is the most secure encryption method for cloud storage?

The best method depends on your needs. Some cloud storage encryption options only secure data at rest, while others only encrypt your files in transit, and some can do both. Cryptomator and Boxcryptor are recommended options for client-side encryption.

What is the most secure way to store encryption keys?

The safest way is through a secure password manager like 1Password or Dashlane. It works on smartphones and desktop operating systems, making it easy to synchronize encryption passwords across different devices.