MacOS – What’s the simplest way to password protect a text file

macospassworduti

I'd like to password protect a text file. Not necessarily a .txt file – just a file that's got text in it that I can edit with a standard text editor. I'd like to set a password and be prompted for it every time I open the file in any app. What's the best way?

Best Answer

You can put the file into an encrypted disk image.

  1. Open "/Applications/Utilities/Disk Utility"
  2. File > New > New Blank Image...
  3. In the new image dialog make sure to choose:

    • Encryption = 128 or 256-bit AES
    • Image Format = read/write disk image
  4. Because you chose encryption, you will be prompted to set a password for the disk image

You now have a password-protected disk image that you can save any kind of file in.