Home » Encryption » Encryption Guides » 2 Best Ways To Encrypt Your Files And Folders In macOS 

2 Best Ways To Encrypt Your Files And Folders In macOS 

Disclosure: All of our articles are unbased, well researched, and based on a true picture of the story. However we do sometimes get commissions from affiliate sites. Our readers get the best discount from buying from our links. Here is our complete affiliate disclosure.
How To Encrypt Folder In Mac

Encrypt your sensitive file and folder in macOS easily – quick steps to be encrypted

Your Mac might be one of the most securest and the most personal device you have, containing a ton of personal information. But are you really content with the “Mac privacy and security” that Apple boasts about? Is it a risk you're willing to take with your personal information?

What is there to say that Mac security won't fail and your data will remain secure? Well, you can either contemplate the risks involved or take matters seriously into your hands by encrypting your files on Mac. This article contains some of the best practices and tools you can opt for to encrypt files and folders on Mac, so if you're interested in staying secure, read along. 

Encrypt File and Folder In macOS – 2 Best Ways

macOS is the most privacy-oriented operating system with dedicated privacy and encryption tools. In macOS, you don't need any third-party tools or software to encrypt files or folders. The two most popular ways you can encrypt files and folders in your Mac are as follows:

  • Using Terminal  
  • Using Disk Utility

These two methods are the best-known ways you can encrypt files and folders within your Mac. These versatile and user-friendly tools offer robust security to Mac users through secure encryption protocols. 

1- Encryption Through Terminal:

Terminal offers two types of encryption to your files and folders: the AES-CBE-128 bit encryption or the AES-CBE-256 bit encryption ciphers. AES, encryption is the industry-standard encryption cipher and by far one of the most robust encryption ciphers currently available. Additionally, Terminal uses the SSL encryption protocol to encrypt your files. 

In the following demonstration, I will use 256 bits to encrypt the file; you can choose its alternative.

Terminal Command:

openssl enc -aes-256-cbc -e -in {from path} -out {desire location}


openssl enc {using OpenSSL encryption protocol}
-aes-256-cbc {Encryption level of 256 bit}
-e : {Encrypt}
-in: {file location path}
  1. Open >Terminal from Launchpad or applications
  2. Here is the code to encrypt openssl enc -aes-256-cbc -e -in
  3. In my case, I have created a text file named “information” on the desktop and put some information in it. It should look like this /Users/macbook/Desktop/information.rtf  
  4. Add [-out /Users/macbook/Desktop/encrypted.txt ] in this; I declared the location where it should be saved, the name of the file and what the format of the file will be. Hit Enter
  5. Set the password> It will not show anything when you are typing, so enter the password and confirm the password.
  6. File is been created on our desktop by named “ecnrypted.txt”
  7. It will open with a chipper text format, you cannot be able to read it, it will look like this.

Here is my complete command after everything

openssl enc -aes-256-cbc -e -in /Users/macbook/Desktop/information.rtf -out /Users/macbook/Desktop/encrypted.txt

Decrypt through Terminal:

It's effortless to decrypt the file and folder as long as you remember the password; otherwise, there is no way you can ever decrypt it. As mentioned above, the AES encryption cipher is the strongest cipher that is not vulnerable to brute force attacks. 

It is nearly impossible to break an AES encryption file, so you should remember your password if you don't want to lose your data forever.  A supercomputer would take 1 billion years to decrypt the AES 128-bit file. 

Along with your password, to decrypt your files on Mac, you will need to tweak the original code a bit, such as follow:

  1. Open> Terminal
  2. openssl enc -aes-256-cbc -d -in Just change -e to -d  means “d=decrypt” 
  3. Here is the complete command in my case openssl enc -aes-256-cbc -d -in /Users/macbook/Desktop/encrypted.txt -out /Users/macbook/Desktop/decrypted.rtf
  4. Enter your password and hit Enter

2-Encrypt File from Disk Utility:

In the disk utility option, you may be unable to pick a particular file to encrypt. You need to make a folder, put everything in it, and then encrypt with AES 128-bit or AES 256-bit encryption ciphers. As mentioned above, both of these ciphers are impossible to decrypt. However, 128-bit is slightly faster to encrypt and decrypt. 

  1. Open>Disk Utility
  2. >File>New Image>Image from Folder
  3. Select the folder in my case, its “personal” folder on the Desktop, then Click on Choose
  4. Rename the document, I call it “encrypted,” then choose the encryption type you want to use from the bottom. I’m going with 256-bit AES encryption and hitting Save
  5. Next, you need to put your password to encrypt it
  6. It will take time to complete, depending on size of the file
  7. After compilation, your folder will look like this, it's basically an image for your folder.

This is how you can Encrypt the whole folder In macOS by using Disk Utility. Just put your password and decrypt the drive, the encrypted image will stay as it is, but it will create another folder on the same spot. You can download stuff from it and put it in others if you want. But the encrypted image will contain the same thing which you put in the first place. 


How to encrypt a file for email on a mac

You can choose both options discussed above, whether using the Disk Utility option or the Terminal. You need to encrypt a file and attach it with an email to secure a transaction.

How to open encrypted files on a mac

If you created the image through the Disk utility, the password is enough to open it. If you used Terminal to encrypt it, you must follow the steps above the “decrypt mac file” heading.

Why do I have to encrypt folders on Mac?

Whether you want to encrypt a folder is purely your choice. However, encryption offers much-needed protection from hackers and snoopers. After all, who wants anyone sneaking a peek into their personal data

How to add files to encrypted folder mac:

You can access all files from an encrypted image file by decrypting that folder to another, you can copy files from it, but you cannot add new files. If you want to add files to another encrypted folder, you need to delete that folder, create another one, put everything in that then again go through the process from Disk Utility. 


Encrypting your files on Mac is a crucial step to attaining privacy and security. With hackers and data snoopers prowling to harm your data, it is best to maintain the utmost privacy and secrecy that you can achieve. 

If you did everything correctly, your files and folders will be encrypted!

Photo of author
Waqas is a cybersecurity journalist and writer who has a knack for writing technology and online privacy-focused articles. He strives to help achieve a secure online environment and is skilled in writing topics related to cybersecurity, AI, DevOps, Cloud security, and a lot more. As seen in: Computer.org, Nordic APIs, Infosecinstitute.com, Tripwire.com, and VentureBeat.

Leave a Comment