If you store any kind of confidential files on your Mac, It’s highly recommended that you add password protection to your files so they can’t be accessed by any unauthorized users. Password protection becomes more useful when you have other people accessing your Mac machine.

Your Mac provides you with an easy way to add password protection to your files. There are built-in tools that let you password protect your files from prying eyes with extreme ease. Once your files are protected, they’ll require a password before they can be accessed by anyone.

Table of Contents
    Lock with the word "Password" in the spaces

    Bear in mind though, if you ever forget the password for your files, you won’t be able to access them again. There’s simply no recovery method available for these locking tools.

    Password Protect Mac Files Using Disk Utility

    Disk Utility is actually there to help you play around with your Mac disks. However, it has an option for locking files as well to help you add a layer of password to your files.

    The way you password protect your files with this tool is to create an image file containing your files and then add a password to it. This locks your files down and these files can then only be unlocked by entering the correct password.

    Make sure to put all the files you want to lock in a single folder on your Mac.

    • Click on Launchpad in the Dock, search for and click on Disk Utility, and the tool will launch.
    • When the tool launches, click on the File menu at the top and select the option that says New Image followed by Image from Folder.
    Image from Folder in Disk Utility window
    • Navigate to the folder where the files to be locked are located, select the folder, and click on Choose.
    • You’ll get a dialog box on your screen asking you to input the information for your new image file. Enter a name for your image file and then select 128-bit AES encryption (recommended) from the Encryption dropdown menu.
    Save As window with 128-bit AES encryption selected

    A new dialog box will appear asking you to enter the password for your image file. Here type in the password you want to protect your files with and click on Choose.

    Create Password window

    You’ll be back to the first dialog box. Click on the dropdown menu for Image Format and select the value that says read/write. This will let you add new files to your password-protected image file at a later time. Click on the Save button to save your image file.

    Save As menu

    You’ll find the locked image file at the destination you specified in the dialog box.

    All of the files that have been put inside this image will be encrypted with a password.

    Keep in mind though that this procedure hasn’t modified any of your original files and those still remain unprotected. You may want to securely delete them from your Mac as those are now available in your locked image file.

    How To Access Password Protected Files

    To access the files that you’ve protected with a password, all you need to do is double-click on your image file.

    Enter password window

    You’ll be prompted to enter your password. Do so and click on OK. It’ll be mounted as a storage device in the Finder and you’ll be able to access as well as add new files to it.

    When you’ve finished, right-click on the mounted image file and select Eject to relock it.

    Eject "Lock" menu

    If you ever want to delete these locked files, you can delete the image file and all of the files in there will be deleted from your Mac.

    If you ever want to delete these locked files, you can do so by deleting the image file. It’ll delete all the files contained in the image.

    Terminal command window

    Password Protect Mac Files Using Terminal

    We talk quite a lot about the Mac Terminal app here on this website and it’s really because of all the great features it provides. From letting you easily access recent items from the Dock to helping you perform a number of other actions, Terminal has you covered for many tasks.

    You can use it to password protect your files as well. The way it works is that you create a ZIP file containing all of your files and then add a password to this ZIP. There’s nothing you need to download and all it takes is a few commands from the Terminal app to lock your files.

    • Launch the Terminal app using your preferred way on your Mac.
    • Type in the following command and hit Enter. Replace destination with where you want to save the resulting ZIP file and source with the folder you want to lock down.

      zip -er destination source
    • You’ll be asked to enter the password you want to add to your ZIP file. Type in the password and hit Enter.
    Terminal command window where you enter password
    • It’ll prompt you to enter the password again. Do so and hit Enter.
    Terminal command window where you verify password
    • Your files in the folder are now added to a ZIP archive with password protection.

    You can now delete the original folder from your machine.

    How To Access Password Protected ZIP Archive

    To access the files inside your archive, simply double-click on the archive and it’ll prompt you to enter the password.

    Enter password prompt

    You’ll then be able to extract the archive and view the files in it.

    How To Access The ZIP Archive From Terminal

    You can also extract the password-protected archive from Terminal by running the following command in it. Make sure to replace lock.zip with your actual ZIP file.

    unzip lock.zip

    Unzip command in terminal window

    Your files will be extracted and be available for your use.