Free tech support / small logo


How can I password protect / encrypt a Mac OS X folder?

Hi Dave. I have a question that I don't think you've ever written about: I have a folder with confidential information and want to encrypt or password protect it. I can see how to create a ZIP file from it with the Archive feature, but that's not password protected either. Is there any way to accomplish this in Mac OS X Snow Leopard?


Dave's Answer:

I just finished working on my taxes - always a highlight of the year. Not. - and face the same dilemma: I want to have the files on my laptop in case I need to reference them, but at the same time, I also don't want them easily readable in case someone rips off my computer or otherwise finds it and starts poking around.

In fact, now that I think about it, there's a fair amount of information on my laptop that I wouldn't want posted to the Internet or perused by the public at large. Hmmm....

Turns out that while there's no way I'm aware of to add a password to the Archive ZIP file (which would really be cool, Apple. Hint, hint), there is an interesting way you can use Disk Utility to create a disk image that's encrypted and cannot be mounted - to gain access to the files and folders without knowing the password. Sound good?

Here's how I did it...

Go into your Applications folder, then within the Apple folder, and you'll find an app called Disk Utility. Launch it and here's what you'll see:

mac disk utility 1

Ya see along the top the icon for "New Image"? Click it. Now you'll be able to configure exactly what you want for your new disk image:

mac disk utility create new image 1

First things first, though. Find the folder that contains everything you want to protect and choose File --> Info. You'll see that among the many fields shown is the size of the folder and its enclosed information. Like this:

mac os x finder folder size

Here you can see that the data files I have require only 467KB, so I'll try to create a 500KB disk image. To do that, I click on the Size menu, showing me tons of options:

mac disk utility create new image 2

Choose "Custom..." and you can type in the value desired. I'll choose 500KB:

mac disk utility create new image 3

Click "OK" and uh ohhhh:

mac disk utility create new image 4

Not sure why 10.5MB is the minimum size, but that's okay. We'll run with that. Next up is to click on the Encryption menu:

mac disk utility create new image 5

128bit AES Encryption is probably just fine for your needs, so choose that. Add a name and here's what you'll have, something kinda sorta like this:

mac disk utility create new image 6

Ready? Click "Create" and it'll prompt you for the encryption password key:

mac disk utility create new image 7

I used "iHEARTtaxes" for mine (just kidding!). Enter your password, twice, then click on "OK". You might want to opt not to save the password in your Keychain, btw, so that there's no trail of the password anywhere on the computer. I opted out.

Now there's a new entry on the left side of Disk Utility:

mac disk utility new image 8

You can quit the Disk Utility now because we're done with it.

Now on your desktop is the new disk image as a ".dmg" file and as a mounted disk. Open it and drag your files and folders thereon:

mac disk utility new image 9

Nice. One more step: unmount the disk now that you've added that data by clicking on the eject button:

mac disk utility new image 10

You can test it by double-clicking on the ".dmg" file and you'll see:

mac disk utility new image 11

Yay! Ya got a password protected virtual disk where you can store anything you want. As soon as you unmount it, it sits safely on your disk. Now, once you're convinced it works, delete your secure files (after copying them over onto the encrypted virtual disk!!) and then empty the trash. Done!









Subscribe!
Never miss another Q&A article! Click to subscribe: Add to Google Reader Add to My Yahoo! Subscribe in NewsGator RDF XML
Comments

Faster way in Disk Utility. In the File menu, select New ->

Select Disk Image from Folder. Select the folder, set the image type and set the encryption.

No need to guess the image size and make the image ahead of time.

Posted by: rammjet at April 12, 2010 9:55 AM

Dave could you please mention a few words for those who have come from a windows environment, where deleting a file does not mean it is gone? Does deleting it from a Mac make it unrecoverable?

Posted by: Wayne at April 22, 2010 3:18 PM

Wayne, great question. Yes, the Mac operates similar to your Windows system, in that deleted files move into the "trash" rather than being deleted immediately. Look on your Dock: the trash can is conveniently located there, and you can click it to open it up.

Posted by: Dave Taylor at April 25, 2010 9:52 PM

THANK YOU!

Posted by: zotlot at March 31, 2011 1:56 PM

Dear Dave,

Thanks for the showing the process of protecting the file via disk utility.
but here is the question....... when i click on remember my password in keychain ......... then this doesn't work and while not clicking on the keychain option ....... it works perfectly as you said.

Answer me via email.

Posted by: Akash at April 8, 2011 6:08 PM

And, on the emptying the Trash bit ... . If you are feeling a bit paranoid (as forensic analysis of your disk may still be able to restore files after emptying the Trash ... ), use "Secure Empty Trash ..." on the Finder menu. Simply open a Finder window, and select that menu. That should reduce the chances of the file being forensically restored.

Posted by: Dayo at July 20, 2011 2:58 AM

Dave,
I created the folder using disc utility. All was ok but i forgot to Uncheck the "remember password in the keychain". So now whenever i open the folder it opens without asking me for the password. How can i modify the folder to make sure it asks me for the password before opening and showing the contents.

Many thanks,
Vipul

Posted by: vipul at July 24, 2011 12:23 PM

I think your fastest solution, Vipul, is to create a new folder with the keychain option unchecked, copy everything from the old folder into it, and delete the old folder.

Posted by: Dave Taylor at July 24, 2011 3:50 PM

Dave, thanks very much. That worked and it was painless.
Regards, Vipul

Posted by: Vipul at July 25, 2011 8:05 AM

This article has the wrong title, and QUITE MISLEADING. It is about creating a disk image, not about encrypting a folder.

Posted by: Lance at November 2, 2011 8:44 PM

Lance, the point of the article is that Mac OS X doesn't support encrypted folders, per se, but that if you create a virtual disk image and use that as your encrypted data store, it'll work great and is really easy...

Posted by: Dave Taylor at November 3, 2011 11:19 AM

Dave,

This is an excellent and -above all- clean solution to the problem of encrypting folders in Mac OS X. It does require, however, careful planning, as it is not possible either to rename the disk image or to increase its size. Disk utility has a way to do the latter, but I couldn't increase the size of the partition, so increasing the size of the image alone rendered useless.

Everything else worked just fine.

Thank you!

Posted by: Rodolfo at November 28, 2011 8:14 AM

One problem. Your secure disk image can be thrown in the trash and deleted without requiring a password! Apart from opening another user account or trying to hide it somewhere like in a .folder is there any way to keep it safe on the desktop?

Posted by: Dennis at December 12, 2011 9:20 PM

I have something to say, now that you mention it, but ...
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you for all your efforts on this Web site by buying you a cup of coffee!

I do have a comment, now that you mention it!











Remember personal info?


Please note that I will never send you any unsolicited email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Recent Entries


Search
I Need Help!
Need Help? Ask Dave Taylor!


© 2002 - 2012 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.