Encrypt Folders with Password Protection in Mac OS X the Easy Way
Encrypting folders and requiring passwords for access is an excellent way to store and protect private data on a Mac. Now, there is a new means of password protecting folders and sensitive files introduced in Mac OS X that lets you create a new encrypted disk image directly from a specified folder.
Though you can still create a blank disk image and fill it as you see fit by using the older trick, this new option in Disk Utility is easier to use and extremely quick, making it the preferred method to add a very strong layer of encryption to a folder, securing itself along with all of its contents.
How to Encrypt a Folder in Mac OS X
This specific “Image from Folder” trick requires a modern MacOS release, anything from Mac OS X 10.8 or later will have this as an option to use:
- Open Disk Utility, found in /Applications/Utilities/
- Pull down the “File” menu and select “New” and then “Disk Image from Folder”
- Navigate to the folder you wish to turn into an encrypted drive and click “Image”
- Set the Image Format to “read/write” and the Encryption to “128-bit AES”
- Choose a strong password (or generate one by pressing the black key icon) and – this is important – uncheck the box saying “Remember password in my keychain”, then click OK
If you do not intend on using the encrypted image as a working folder that you can add and remove documents from, you can choose an Image Format other than “read/write”.
An encrypted disk image will be created based on the folder you specified, it may take a while if the folder is large or your Mac is slow.
Accessing the Encrypted Folder & Contents
After the encryption procedures is finished, you’ll now be able to access and use the encrypted folder. To summarize steps of accessing the encrypted folder and how to properly use it to maintain security:
- Open the encrypted folder image with a double-click, treating it as a normal disk image
- Enter the password used during the initial encryption setup – do NOT check “Remember password”
- Access the encrypted folder and the contents as a mounted virtual disk, you can modify, copy, edit, delete, and add to it
- When finished, close the files and eject the virtual image to re-secure the folder and files and require a password for future access
You will want to locate the encrypted dmg file and store it somewhere accessible enough, since you will be using a double-click to try to mount the folder image in the Finder when it needs usage, and of course you will need the password to access the files.
Just as when creating the disk image password, always uncheck the box saying “Remember password in my keychain” or else you will store the password and lose the security benefit of the encrypted image since anyone with access to your user account could open it. This also applies to transferring the encrypted folder image to another Mac.
With a readable and writable encrypted disk image, you can treat it as a normal folder and copy, delete, or move files from the image. Anything brought into the image while mounted will become encrypted automatically under the same protective layer with the same password.
When you are finished working with the folder and want it password protected again, simply unmount the disk image.
Regaining access again will require the password before it can be mounted and available.
The short video below demonstrates the entire process, in less than a minute you can encrypt a folder with password protection and mount it for access.
Remember, do not forget the password, or else you will lose access to the data stored within the encrypted folder for good. This is important, because the security level of the encryption format is so strong that it’s virtually impossible to break, thus a lost password means lost data.
Note: This will only encrypt and password protect the folder specified, if you are looking for full disk encryption for literally every single thing on the Mac, you would want to enable FileVault instead. FileVault applies similar encryption methodology to the entire hard drive automatically.
Creating the encrypted disk image works fine. But, you are creating a new folder, not encrypting the present one. So, if you want to keep the contents private you’ll need to trash the old folder.
I’ve completed all the tasks however I’m never prompted to enter a password to access the disk image, after it’s created.
I’m prompted, and I enter a password to use during the creation process. But that’s the last I see of it.
You saved the password to your keychain, you are not supposed to save the password to your keychain otherwise it won’t ask for the password when you open the encrypted image. You’ll need to ‘forget’ the password, then when entering it again, do not check the box to save the password.
In Mojave the option not to save in the Keychain does not exist. Kinda negates the use of an encrypted folder. Some steals your note and your password and can then decrypt all your documents. Groan!
i want to ask the same question as nagash asked ! anyone there ?
I followed the instructions and created the secure folder, but… when I mount it, the folder appear as READ ONLY and I can’t modify the content. anyone knows why it happens? And yes, I selected image format: read/write :\
Hi!
Can anyone please tell me how to change the password of an encrypted folder/ password protected folder.
Thx!
hello,
i followed all the steps and everything worked perfect for me, i was able to put in my password and see the content. and everything.., now, couple weeks later i cannot access the folder. i put the right password and the folder does not mount on the desktop! it keeps asking me to introduce the password. it doesnt even say it is incorrect! how can i open my folder. i am not gonna be able to access my stuff ever??
please help
thanks
Unmount the disk image and remount it, be sure to enter the proper password. Unless the file was somehow corrupted (by a drive failure or otherwise) it makes no sense for the image file to suddenly reject a correct password.
I wonder if anyone can help. I’ve created a .dmg file from a folder. It’s stored on an external hard drive. The problem I’m going to have is that the .dmg folder opens onto my desktop but the SSD drive on my Mac is getting full and the .dmg folder will soon be larger than the free space on the MacBook. Can I set the .dmg folder to open on another external drive instead of the MacBook? If so how? Cheers
I did all of this awhile back and i forgot my password⦠is there anyway to recover the file at all?
Question, I created an encrypted file about a year ago and used to access it by typing the file name in spotlight. I have now forgotten what the file was name and can’t find it. Is there an easy way to view all encrypted files? I remember the password so once I find it I should be able to open it just fine. Thanks!
I’ve gone through the process in the tutorial step-by-step, several times and it all goes fine. Once the dmg and disc image were created, I copied my files over, unmounted the disc image, then re-opened the dmg. Click on the disc image, and it opens, no password required. I’m running OS X Yosemite. Help!
Nevermind. Last try, did everything the same, I think, and it worked.
I have a tremendous problem. I created a .dmg in order to put some special stuff in there. It had a strong password, but today I tried to open it and it says that the password is wrong. I don’t know where this come from. The password I’m using is the correct oneβ¦ I need those files so bad. What can I do?
Thanks.
so i made one but when i put things into the trash it dosent let me delete it says. “The operation canβt be completed because you donβt have permission to access some of the items.”
Upon trying to create the image with the encryption I receive a message saying: “Unable to create “Storage B.” (Permission denied)” Any idea what is wrong?
I was able to create and mount the DMG, but I can’t move anything into it, even though the sharing and permissions on the DMG say I can read and write. When I’m in the mounted drive in Finder, it won’t let me create a new folder in it. Any suggestions?
Im mediocre with computer terms so dont kill me:
I made a ‘disk image from folder’ called “Scotty’s Folder” and placed the link into another folder “Business Folder”.
In order to access “Scotty’s Folder” I had to:
1)Open Business Folder on desktop
2) double click blahblahbah.disksparseimage (or something like this)
3)enter password
4)Then “Scotty’s Folder” appeared
…..But I recently deleted “Business Folder”. I my secret “Scotty’s Folder” gone?!?
I’ve used this to make an encrypted file… however when I try to add more files to the encrypted folder it doesn’t work… theres not enough room.
anyone know how I can add to my encrypted file or make it larger? i just want to avoid having to redo this process every time i want to add to the file.
Thanks!
This works great with one exception. It appears that anyone can delete the DMG file even if they can’t access it. So if the point is to protect it not only from other users accessing it but also deleting it then this doesn’t work. Any suggestions? I have one user name and other user occasionally use my computer. Even though they couldn’t see the contents in the directory with the password they could drag the image file to the trash and empty it.
Would love any advice.
this is very very helpful in keeping privacy and very good. this can actually lessen your burden if you have any doubt that someone might see your files.
You cannot use a crypted folder that way since you cannot add new files to the folder. The folder size is fixed and CAN’T BE EXPANDED.
You can add new files to the encrypted folder by unlocking the DMG and then copying files to it. If you intend on placing a lot of files in there, make sure to account for the growth in file size when creating the original disk image. You can also use Disk Utility after the fact to resize an image if necessary.
You can think of the encrypted disk image folder as a little virtual hard drive partition, it is set in size just like a partition but can be shrunk or expanded if necessary.
This is a terrific tutorial. I’ve been looking for a simple tool to encrypt work files, and this is it! I’m so happy I don’t have to download some application… Thank you!
Hey what am I doing wrong. I followed all the instructions to password encrypt a folder on my Mac It creates the dmg folder, but when I click on the dmg folder it does not open & as for password. IT actually does nothing. WHat did I do wrong ? Also can you use the same process to change the password on a protected folder.
Thanks
This article is very interesting! However, beside “Documents” folder, how we can put security password to another folder? Thanks.
Ok. so if i make disk image and place it on my desktop. I use it for a wile. Then i want to delete it/ free the space from my computer. How do i delete or free the reserved space? Do i only drop the disk image in the trash? Does that free my hard drive from the disk image? Or does it only delete the img and the space is still reserved on my hdd??
I have been using encrypted disk image for long time; since OS Leopard. And I have no problem with it. Currently I’m using OS Mountain Lion and now I have problem with it. The Encrypted disc image which is created in this latest OS becomes so slow when I copy files to it. Does anybody have experienced this problem? Does anybody know what is the problem and how to solve it?
Thanks
I wonder why nobody uses an encrypted ZIP file from terminal anymore.
Just use this syntax:
zip -erm folder.zip folder where folder is the files you want to encrypt.
Strangely, I noticed once this is done, I cannot delete files inside the new dmg.
Yes, I have opened the .dmg using the password. Yes, I have checked permissions and have read/write access.
Like Dan as said I recommend using the sparse bundle. I have had success with this method, strangely I think it is easier and it is expandable and more importantly, shrinkable. Back to the old way.
Errrr….the title of this article says “…the Easy Way”. This is not easy. I have, for so long, wished theat crappy old Mac OSX would have a “right-click, select “encrypt folder”” option. Type in a password…the folder’s encrypted. To open it, you’re prompted to type in the password again. Is this beyond the capabilities of Apple programmers? Apparently so.
Are you reading what you are writing? You, in a very condescending manner, trash the post saying “This is not easy”, and then you trash Apple saying they are incapable of encrypting a file…but it’s right there in front of you AND this is easy. LOL That is the most ironic post I have ever read here.
Actually, he’s right. This whole thing could be made much easier and user-friendly. It’s a case of Apple dropping the ball, or, more likely, correctly assuming the bulk of its users are typically Homers who use iPhoto and Twitter but don’t bother with more arcane and complex operations.
If Apple wants to use some of its great wealth to simplify and streamline the process, the clunky Disk Utility should be removed from the equation. Additionally, little clumsy infelicities need cleaning up.
For example, it’s simply stupid to have to unclick the option to store the pw in one’s keychain every single time. How many times must I tell OS X this?
Additionally, you can’t see the password you’re typing as you create the encrypted file — an option to do so is only there when you decrypt. Again, this is too clever by half, since it’s obviously meant to hide the pw from prying eyes. But what genius at Apple decided only encryption, and not decryption, should be sooper-sekrit? Or as you would put it: LOL.
All goes well to the point where I click on the newly created .dmg (i.e. 0.56 secs on your video).
It ‘flashes’ but the box asking for the password does not appear so basically nothing happens and can’t proceed.
Obviously done something wrong but not sure what.
I had an idea to encrypt whole home directory. I created a new user “encuser” account, then I created an encrypted dmg image. I mounted it as root user by commandline “sudo hdiutil mount -mountpoint /Users/encuser”.
I swtiched user to encuser and it worked as I expected. However, when I was using the “encuser” acount for some time I realized, the encrypted disk was lagging. I/O time to time idled for even 10 secs. It was so much laggy so it was useless. Am I doing something wrong? On linux I can mount encrypted partition (or loopback file) and use it as my home directory with no problems. Why isn’t this possible on Mac?
I also realized, when I had logged-out the user some of his processes were still runing. I had to “killall -u encuser -9” to be able to umount the imege. WTF?
The built in File Vault feature turns the home directory into an encrypted disc image that is mounted and unmounted automatically.
This is only true of Snow Leopard. Lion and ML use Filevault2, which uses whole disk encryption, not just the Home folder.
Making your Home folder encrypted is a pain and causes numerous admin problems for OSX processes. Either turn on FileVault or use an encrypted image for your Documents. Don’t try to do it yourself; even Apple decided it wasn’t very good.
I can’t use FileVault since several people use my iMac. If I use FileVault all of them would have access to the whole disk.
Btw, there is a very basic security problem with dmg encrypted images. Consider your mac is confiscated in UK. They found encrypted *.dmg file on your disk and because of the law in UK they force you to reveal the password (keeping you in jail). You have a same problem with FileVault. IMO, truecrypt is much safer since there is no way how to prove the file named “random-data.dump” is encrypted disk image.
Good trick!
The problem is that if you create a dmg from a folder of 10MB, the dmg has a maximum capacity of 10 MB and it is not expandable, and so it is not possible to add new files to the dmg.
Or is there a way to do that?
No. The Create From Folder doesn’t let you do that. For an expanding disk image, you need to create a New Disk Image and specify the type as Sparse Bundle. You can choose to encrypt this and then you can copy stuff in to it. It will resize the image to hold the data.
How will you specify the type as a Sparse Bundle? I don’t see the option in Disk Utility.
Of course, you have to trash the original folder, otherwise it would be pointless. You don’t have to un-encrypt the dmg (you do know your password, right), just mount that thing, drag and drop your data out of it wherever you want it (erase it on the dmg, if this is what you want) and you’re done.
Okay, I’ve created an encrypted .dmg. The password works to mount a disk image. Great.
But the original folder is still there will all the content, and this original folder is NOT encrypted!
Am I supposed to trash the original folder?
Also, how do I un-encrypt the .dmg file?
Of course, you have to trash the original folder, otherwise it would be pointless. You donβt have to un-encrypt the dmg (you do know your password, right), just mount that thing, drag and drop your data out of it wherever you want it (erase it on the dmg, if this is what you want) and youβre done.
Agreed. I would think the target folder’s contents would be placed in the image. Why else go to the trouble of making this “from a folder?” Space issues are not good either. Wouldn’t you expect to need a folder larger in the future than it is now? I will make a fresh encrypted image from Disk Utility, as I don’t understand how it is any advantage to make it modelled on a folder.
Im just wondering what if I put the dmg to dropbox, this way i would able to store my company files securely in dropbox.
Store your files in a place that you don’t Β«physicallyΒ» own is never secure at allβ¦
Sorry if this is a bit late but the answer is yes. And whats more you can “mount” the encrypted .dmg on your desktop over the net securely.
So its a great way to keep stuff private if you have to use Dropbox
But don’t take my word here is what Apple says:
On page 164 of “SnowLeopard_Security_Config_v10.6.pdf” under the heading Restoring Backups from Secure Storage on point number 2 it says:
“If the image is on a network, you donβt need to copy it locally. It will securely mount across the network because the data is encrypted.”
That pdf is available from here”
https://ssl.apple.com/support/security/guides/
And a blog covers your idea too.
http://www.imore.com/encrypted-disk-images-dropbox-protect-sensitive-files
WOW!!! Thank you for this response. You gave the answer just the way Apple would! :p
Thanks Penny. Been looking for this solution.
Getting back on topic briefly :-)
Actually this is not new in Mountain Lion: works also in my Snow Leopard system, and I’m pretty sure it goes way back to the earliest days of OS X.
Whoop, you’re right
Its a standard creation of an encrypted disc image, a basic feature of Disk Utility.
I’ve been using it since 10.4. Very handy.
Good one Faraz! Since we’re venturing off topic, how do I get my Apple to grow fruit?
How can put an icon for folders as a default ? it means when I want to create a new folder , this icon come out!
for mac!!:|
tnx