How to create an expandable encrypted folder?

2

2

I have a folder that contains documents that I'd like to encrypt. I know I can make an encrypted disk image with disk utility, but the problem is I regularly add files to this folder and it's inconvenient to either make the image huge so that it can hold potential future files or constantly recreate the image every time I need to make it a little bigger.

Is there anyway to store files in way that is securely password protected on my computer, but can otherwise be treated as a normal folder that I can add to and access files off of without a lot of extra effort? I'm on OSX 10.13.6.

Jim

Posted 2018-08-12T15:24:27.290

Reputation: 406

Use FileVault to encrypt your whole account. Just keep in mind, if you loose your password or hdd would failed, it practically almost impossible to recover your files

– Alex – 2018-08-12T15:54:03.790

I want others to be able to use my computer without accessing these files, so I don't think FileVault is the right choice. – Jim – 2018-08-12T16:10:41.827

tbh, though my answer will work to protect your files, you really ought to not allow others unlimited access to your machine. Set them up with their own, non-admin accounts if necessary. – Tetsujin – 2018-08-12T16:23:34.223

Just create a new non administrative account for "others" people and keep password to your account in a secret. Setting up FileFault will prevent to see content of your account even for advanced tech users – Alex – 2018-08-12T17:07:48.980

Who said anything about unlimited access? – Jim – 2018-08-12T18:20:11.893

Answers

3

You use a Sparse disk image.

This is an expanding format, which takes up as much room as it needs, yet is capable of storing less or more as required.

You need to make the original image as large as you think it can possibly ever need to be, but it will not use that space unless you fill it.

In Disk Utility, File > New Image > Blank Image...

enter image description here

I think there's a proviso that the drive you create it on initially must be large enough to hold it when full; but of course that can change if you move it.

This is the created image, mounted.

enter image description here

It does have some overhead, in this case 220MB, but that I think varies on your actual image capacity.

Tetsujin

Posted 2018-08-12T15:24:27.290

Reputation: 22 456

"an expanding format, which takes up as much room as it needs" – So it will expand. Will it ever shrink by itself? – Kamil Maciorowski – 2018-08-12T16:16:31.070

1

Ah... no, sorry. Not by itself - needs hdutil; see https://superuser.com/q/275148/347380

– Tetsujin – 2018-08-12T16:28:29.027

1

I personnally use encfs since several years, it is cross platforms (Win/Mac/Linux), and is a one to one file encryption, meaning that adding or removing a file is as light as it can be.

Encfs comes embedded in non-free software like Boxcryptor, but setting it up open source using command line is not very difficult, though you will have to set up Macports or Homebrew to get it.

After that the mounted counterpart of the ciphered folder behaves like a normal folder. Perhaps not very fast for large files (AES256 encryption) but very secure, and protected by a passphrase. All parameters are stored a the root folder of the ciphered folder encfs.xml file

Simple to mount:

encfs /Path/To/Ciphered/Folder /Path/To/Clear/Folder -o volname=Name_Of_Mount_In_Clear_Folder

Edit: I autocorrect myself, you can use encfsmp which is a nice implementation of encfs with GUI, and available cross platforms. Please check:

https://encfsmp.sourceforge.io/index.html

Lorenzo

Lorenzolamasse

Posted 2018-08-12T15:24:27.290

Reputation: 21