Password Protect a Folder on the Mac

I was looking for a way to password protect a folder on the Mac. I needed to be able to backup a large collection of files onto a USB hard drive and then send it securely through the mail for safe off-site storage. For some reason, this functionality is not integrated directly into Finder.

Finally I stumbled upon a way to do it with built-in OS X software. That is perfect because I wanted to avoid using random 3rd-party trialware for something that an operating system ought to be able to do for free.

How to Password Protect a Folder on the Mac:

  • Open up the “Disk Utility” application
  • File -> New -> Disk Image from Folder…
  • choose a folder to protect
  • choose “AES-128″ encryption and press Save
  • Enter your desired new password twice (Do not forget it.)

This process creates an ordinary Macintosh disk image (.dmg) file. The disk image contains the entire contents of the folder, but cannot be opened unless the correct password is supplied. To open it, just double-click the .dmg file in Finder. A password dialog box will appear. Once you supply your correct password, Finder will automatically unencrypt your data and mount the image as a disk.

39 Responses to “Password Protect a Folder on the Mac”

  1. elasticgurl says:

    Can the network administrator get into the encrypted folder despite this?

  2. adam says:

    hi there
    thanks for this tip. I used it to password protect a folder with numerous Word files. However, this approach doesn’t allow me to alter and save the files in the folder as they are now read-only. Is there a way to password protect using disk utilily without making the files themselves read – only?
    thanks
    adam

  3. mike says:

    To answer that last persons question while creating the disk image from folder, where you select the encryption type.. above that it says “disk type” which by default is set to “compressed”, simply go to that and select “read / write”
    tah dah

  4. jj says:

    This is great info thanks.
    When I try to copy in more files I get a message that says there is not enough space to do so. Is there a way to increase the capacity of the disc image?

  5. Atchet says:

    And it goes without saying that the original folder can be erased?

  6. meakes says:

    Well, since you just said it, it does not go without saying. :) But seriously, something could go wrong with your disk image. For example, the password could be forgotten or the disk image file could be corrupted. Don’t delete the original files unless you fully understand the risks.

  7. c@tchy says:

    To increase the size of the image go to disk utility, select image and top right click Resize Image, then type in how much you want to increase the image by and click resize.

  8. Chris Vera says:

    Nice work! I wish Apple’s tech support pages were as straightforward ;-)

  9. Andonis says:

    This is such useful info guys thank you…I was trying for a long time to do it in my old windows laptop..but of course to no avail. As soon as I got my new mac..I typed my question as to how to do this…and there…found your answer…thank you once again…!!!

  10. Andonis says:

    Wait a minute….I think I was too quick to leave a comment..! I just finished doing the above process, got the disc image, but when I press on it, it opens the file no problem without asking for the password…is this normal…?? Or is the password required if anyone else with a different account in my mac tries to open it…??
    Please, any help with this will be appreciated. I’m a new user of Mac.!!!

  11. rpedgar says:

    Hi, I was interested in this and I tried it and it works when it is selected as compressed but when I change it to read and write it creates it but when I open it, it asks for the password though it does not open at all with no msg or anything. I can click on it as many times but will not open. I was wondering you knew what this may be?

  12. Andonis says:

    Ok..so…I didn’t know that un-ticking the “Key chain-Password reminder” had anything to do with it…as soon as I did it…it worked absolutely fine…!!
    Sorry and thank you for your tips…!!

  13. Mij says:

    I’ve tried this several times it creates the file however when opening it doesnt ask for a password. im using a mac leopard, does it work on this?

  14. mark says:

    can this be done to save files onto a memory stick/usb etc for cross platform

    eg save and encryt folder for both mac and pc

  15. GAZ says:

    cheers, been looking how to do this for ages

  16. If you are making a clone of your hard drive, will this be copied along with everything else? Then the problems of back-up would be solved.

  17. rich says:

    the dmg file that was created just opens. There doesn’t seem to be a password required

  18. john marc says:

    It seems that I cannot have a password protected folder that I can keep saving items into, is this correct, coming back to a problem raised earlier, what if I do not want to delete any of the files but want to add new

  19. Kate says:

    But what would be the point of leaving the unprotected folder on your computer if you are trying to create an encrypted file for a reason?

  20. jose says:

    is this the equivalent of a Briefcase in Windows? or it doesnt sync everytime you change something to the files inside the folder?

  21. jm says:

    Great tip, I have a few files that i’d like to secure. My question is if i save the file to an external hard drive if someone plugs it into a windows OS will it be seen or can it be opened? thanks in advance.

  22. Ronny says:

    PLEASE HELP !!!

    How come the password dialog box dies not appear when I double clic onthe dmg. file??

  23. Kaelan says:

    This is great, but is it possible to access the file through the terminal?

  24. simon says:

    hi there, maybe it’s a long shot but is there anyway to do the same thing for an app??
    Basically, i’d like to password protect “mail”, so that it can’t be accessed at all but with a password; it doesn’t seem to be doable using only built-in software, which is weird if you ask me..
    I know there are ways, like switching accounts etc.. but it takes forever..
    Thanks

  25. Atif says:

    I have the .dmg folder created but unfortunately forgotten the password for the same. Is there any way to recover the password?

  26. Dan says:

    I did this, but it still just allows me to open the folder without a password? What am I missing?

  27. nirav says:

    i used that the way you describe above how to create new disk image. i also set my password but when i open it, it wont ask me for password, that way anyone can open that folder. so give me answer to solve this problem..
    Thanks..

  28. Rob says:

    i tried this. i was able to make the disk image. but the password does not seem to work. i could still open the disk without asking for a password.

  29. Jake says:

    Is there any limitation on file size?

  30. c32077 says:

    I want to send a password protected folder to a PC user. Possible?

  31. Russell Gibson says:

    This does not work on my mac (Leopard). A file is created with .dmg. won’t open at all if read/write used and opens without need for password if compressed used.

  32. Rob T. says:

    mike wrote: “above that it says “disk type” which by default is set to “compressed”, simply go to that and select “read / write””.

    Yes, but then, when you are logged in, anyone can open the file. That’s what happens with me, at any rate. After creating a disc image in the way described above, and setting it to “read/write”, I don’t even get a password prompt when I mount the image. It just mounts and opens.

    It would be nice to be able to encrypt a file and still be able to read and write to it. Unless anyone has any suggestions as to what I am doing wrong, I guess I am just going to have to wait until next year when I can finally upgrade to an Intel machine with Snow Leopard and use the file encryption processes that Apple finally decided to build into the system. *sighs*

  33. ilikebananas says:

    I had a password protected DMG but now it just opens right up. Is there a way to put a password back on?

  34. Manyard says:

    This does not work for me at all. i did it as a trial on a folder i didnt really need on the desktop to see if it worked and i can still just double click the folder on the desktop and it allows me to still see everything in the folder and not ask for a password.

    plus when i search for it it still appears and being able to opened to anyone that came onto my computer. isnt there a simpler more basic way to actually protect folders without the hassle of deleting things etc

  35. asdf says:

    It didn’t work for me.
    The next time I tried to open it, it just opened and didn’t stop me or anything.

  36. Angie says:

    When I went through the steps and tried to open the folder a password dialogue box did not pop up. It let me just open up the folder

  37. Daniel says:

    WOW! This is awesome and I don’t understand why you guys are having so many troubles. Just make sure you uncheck the “Remember Password In My Keychain” option otherwise your computer will remember the password and defeat the purpose of protecting your folder. GREAT INFO!

  38. Chris says:

    Great tip, works like a charm. Many thanks.

  39. job ballard says:

    awesome, this has made my day. This is great.

Leave a Reply