How can I password protect files in macOS?

I want to start a private journal on my Mac, but I want to make sure that the file can only be opened by me.

How can I put password security on my file without it slowing down my computer?


Solution 1:

You could put it in an encrypted disk image.

You can create an encrypted disk image in Disk Utility:

  1. Open Disk Utility.
  2. Go to File > New Image > Blank Image (Cmd+N).
  3. Enter a filename, and choose a location. You can also choose the size of the disk image. Make sure to set Encryption to either 128 or 256 bit AES encryption (256 bit is more secure than 128 bit, but it's also slower.) You can keep all other settings the same.
  4. Enter a passphrase for your disk image.
  5. Ensure you have read/write disk image selected for Image Format (otherwise you won't be able to write to it)
  6. You can now create the image. Once it's created, the disk image will be mounted. Copy the files you want to keep safe to the new disk.
  7. Once you're done, eject the disk by dragging it to the Trash.

Now, whenever you want to access your encrypted files, just mount the image from wherever you saved it to earlier. Once you're done with your files, eject it as described earlier.

Solution 2:

You can encrypt any (individual) file using OpenSSL through Terminal. This is very useful if you are planning on doing a journal in a Word Document, or even a TextEdit file where it's just one long document. The benefit here is that it's lightening fast as you are only encrypting/decrypting a single file.

So, let's assume that on your Desktop we have your Journal conveniently named Journal.txt

To encrypt the file, in Terminal issue the command (assuming "Apple123" is your username):

openssl enc -aes-256-cbc -e -in /Users/Apple123/Desktop/Journal.txt -out /Users/Apple123/Desktop/Journal_encrypted.txt

You will be asked to type and verify a password to encrypt the file. When it's finished, you will see the new file on your desktop. It will look like a regular text file but when you double click on it, you will get an error message that it cannot be opened.

To decrypt the file, just issue the command:

openssl enc -aes-256-cbc -d -in /Users/Apple123/Desktop/Journal_encrypted.txt -out /Users/Apple123/Journal.txt

You will again be asked for the password; enter the one you used to encrypt it. Now, this time, when you double click on the file, you will be able to open your file.

What do those things mean?

enc - Use encryption cipher

-aes-256-cbc - Type of cipher to be used. AES256 is an industry standard.

-e or -d - Encrypt or Decrypt

-in - specifies the full path to the input file

-out - specifies the full path to the output file.

You can obtain more info about OpenSSL by typing man openssl from the Terminal prompt.


TL;DR

Use OpenSSL to encrypt/decrypt.

  • Encryption: openssl enc -aes-256-cbc -e -in [input path/file] -out [output path/file]

  • Decryption: openssl enc -aes-256-cbc -d -in [input path/file] -out [output path/file]

Remember your password and make a backup of the file. If you lose/forget the password you are going to be up the creek without a paddle.

Solution 3:

Specifically for journalling, you might find it easiest and most convenient to invest in a writing or note-taking app that offers password protection on a per-document basis. Some options include:

  • MacJournal
  • Note Case
  • Apple's own Pages
  • Notes (part of macOS)

Solution 4:

For the really paranoid, Keychain Access can be used to store Secure Notes.