How to encrypt a file on Windows and Mac

Key takeaways

  • Windows EFS is unavailable in Windows Home, needs an NTFS location, and uses your account's certificate rather than a separate password prompt.
  • Back up your EFS certificate and private key with the cipher /x command and keep the backup in a protected place away from the computer.
  • On a Mac, create an encrypted disk image in Disk Utility, copy documents into it, and eject it when finished.
  • To share files, create a password-protected 7z archive with AES-256 and filename encryption, and send the password through a different channel.

File encryption makes a document’s contents unreadable without the right password or encryption key. You can encrypt individual files on supported Windows editions, put sensitive documents inside an encrypted disk image on a Mac, or create a password-protected archive for sharing. This guide explains how to encrypt a file on Windows and Mac, choose the right method, and avoid leaving readable copies behind. (support.microsoft.com)

Which file encryption method should you use?

Use Windows Encrypting File System (EFS) for files you work with under your Windows account, an encrypted Mac disk image for a password-protected collection of documents, and an encrypted archive when someone else needs to open the files. Whole-drive encryption serves a different purpose: protecting data on a device rather than creating a portable, password-protected attachment. (microsoft.com)

Start with the situation you need to address:

  • Private documents on a Windows computer: Consider EFS if your Windows edition and storage support it.
  • A separate protected workspace on a Mac: Use Disk Utility to create an encrypted disk image.
  • Files moving between Windows and macOS: Consider a password-protected 7z archive, with compatible software at both ends.
  • A lost or stolen laptop: Check whole-drive protection, such as Windows Device Encryption, BitLocker, or Mac FileVault. (learn.microsoft.com)

Before starting, decide whether you need everyday access, occasional storage, or a handoff to another person. That decision matters more than choosing whichever encryption option appears first.

How do you encrypt files on Windows?

To encrypt files on Windows using EFS, open the file’s properties, select its advanced attributes, and enable Encrypt contents to secure data. This built-in feature is unavailable in Windows Home and requires a supported NTFS location. It protects files through your account’s encryption certificate rather than a separate password prompt. (support.microsoft.com)

Apply built-in file encryption

  1. In File Explorer, right-click the file or folder and select Properties.
  2. On the General tab, select Advanced.
  3. Check Encrypt contents to secure data.
  4. Select OK, then Apply.
  5. If Windows asks about scope, choose whether to include the containing folder or its files and subfolders.
  6. Confirm your selection to finish. (support.microsoft.com)

Your encrypted files still open normally while you are signed into the account with the correct certificate. That convenience is intentional; EFS is not a password-protected vault that asks you to unlock each document. Do not treat an unlocked Windows session as a barrier against someone using your account. (microsoft.com)

Back up the encryption certificate

Back up your EFS certificate and private key before relying on this method. Microsoft provides the cipher /x command for exporting them; keep the resulting backup in a protected location separate from the computer. Include this step in your recovery planning before reinstalling Windows or replacing the device. (learn.microsoft.com)

If the encryption checkbox is unavailable, check your Windows edition and storage location. For a file that needs its own shareable password, use the archive method below instead. (support.microsoft.com)

How do you protect files on a Mac?

To protect files on a Mac with a separate password, create an encrypted disk image in Disk Utility and copy your documents into it. The image acts like a virtual drive: open it to work with files, then eject it when finished. Apple supports AES encryption for these images. (help.apple.com)

Create an encrypted disk image

  1. Open Disk Utility from Applications > Utilities.
  2. Select File > New Image > Blank Image.
  3. Choose a filename and save location, then enter a name and sufficient size for the image.
  4. Choose a suitable format, such as APFS for use with modern Macs.
  5. Under Encryption, select an encryption option and set a strong password when prompted.
  6. Choose an image format that permits editing if you need to update the contents.
  7. Select Save, then Done.
  8. Copy your documents into the mounted image and eject it afterward. (support.apple.com)

Reopen the saved image whenever you need access. While mounted, its contents are available like files on a connected drive, so ejecting it is an important part of the workflow. The encrypted image protects the files inside it, not separate originals elsewhere on your Mac. (help.apple.com)

Create an encrypted archive for Windows and Mac

For a portable package, encryption software that creates password-protected 7z archives offers a practical option. Both 7-Zip on Windows and Keka on macOS support this format with AES-256 encryption. Confirm that the recipient has compatible extraction software before sending anything important. (7-zip.org)

An archive is particularly useful for an occasional handoff: you package the selected documents together, set one password, and send the resulting file. For a folder you edit throughout the day, consider the built-in storage methods instead.

On Windows with 7-Zip

Install 7-Zip from its official publisher, then use these settings:

  1. Select your files in 7-Zip and choose Add to open the archive dialog.
  2. Set Archive format to 7z.
  3. Enter and confirm a strong, unique password.
  4. Check that the encryption method is AES-256.
  5. Enable Encrypt file names to protect the internal file listing.
  6. Select OK to create the archive. (7-zip.org)

On Mac with Keka

Open Keka and select 7z as the archive format. Enter the password in the password and confirmation fields, and leave filename encryption enabled if the document names are sensitive. Drag your selected files into the Keka window to create the archive. (github.com)

Before sharing, test extraction with the password. Remember that extracted documents are readable files, not automatically password-protected documents; choose their destination accordingly. Filename encryption also does not disguise the outer archive’s name, so give that file a neutral label rather than a revealing description. (www2.gov.bc.ca)

Add whole-drive protection for secure file storage

For secure file storage, consider protecting the computer as well as selected documents. Windows Device Encryption is available on qualifying devices, including some running Windows Home. BitLocker Drive Encryption provides drive-management options on Windows Pro, Enterprise, and Education. (support.microsoft.com)

On Windows, check Settings > Privacy & security > Device encryption if that option is available. On a Mac, FileVault protects the system disk; it is separate from creating an encrypted image for selected files. Follow the recovery instructions and keep recovery information accessible somewhere other than only on the protected device. (support.microsoft.com)

Do not assume every backup preserves file-level encryption. Microsoft notes that ordinary backup operations can read EFS files as plaintext unless the backup software uses appropriate encrypted-file handling. Check your backup method rather than relying solely on the source file’s encryption status. (learn.microsoft.com)

Prepare files for secure file transfer

For secure file transfer, send the encrypted package rather than assuming local protection travels with an attachment. EFS gives authorized applications readable contents, so it should not be treated as portable attachment encryption. Create and test a password-protected archive before uploading or attaching sensitive documents. (learn.microsoft.com)

Use this final handoff checklist:

  • Verify the recipient: Confirm the destination address and agreed file format before sending.
  • Separate the password: Deliver it through a different channel, not alongside the attachment.
  • Test compatibility: Ask the recipient to confirm they can extract a harmless sample first.
  • Check the attachment: Select the encrypted archive, not the original document.
  • Plan readable-copy handling: Agree where extracted documents should be stored and when unnecessary copies should be removed.

Treat these as practical handoff steps, not a guarantee that encryption controls everything the recipient does afterward.

Keep protection simple and repeatable

Choose file encryption tools around how you actually use documents: local work, protected storage, or sharing. Make your routine include a unique password, recovery planning, and a test before transferring important files. A password manager can help generate and retain strong passwords without reusing one across multiple purposes. (nist.gov)

Sources

  1. How To Encrypt a File or Folder | Microsoft Support
  2. How to Encrypt a File in Windows 11 | Microsoft Windows
  3. File Encryption - Win32 apps | Microsoft Learn
  4. cipher | Microsoft Learn
  5. help.apple.com: Apple platform security guide
  6. Create a disk image using Disk Utility on Mac - Apple Support (IN)
  7. 7z Format
  8. Compressing with Keka · aonez/Keka Wiki · GitHub
  9. www2.gov.bc.ca: Zip user guide for clinics
  10. Device Encryption in Windows | Microsoft Support
  11. Backup and Restore of Encrypted Files - Win32 apps | Microsoft Learn
  12. How Do I Create a Good Password? | NIST