Cloud Syncing Tricks

Given the many cloud-sync services available, I wanted something I could sync over the cloud, but be secure - not “secure” if you decide to trust the service provider, but “secure” as in “good luck, NSA.”

I know there’s TrueCrypt, but it suffers a fatal flaw: Its disk images are a single file. This means if you update part of that file, you’re likely going to be syncing the whole thing. Nothing like having to sync 1 GiB of data for a 1 kiB change.

However, OS X has a solution that’s really quite elegant: Sparse disk images. A sparse disk image is really a directory tree, where many files represent physical sections of the disk. It’s oversimplification, but the gist is the important part. The end result? A change of a few kiB on disk doesn’t require a sync of the whole disk image - just the parts of the disk image that changed. Apple did this so disk images would be compatible (and efficient) when backed up via Time Machine. It also makes it possible to efficiently backup over your cloud-sync service du jour - I’ve successfully used it with DropBox and Insync (which is a backend for Google Docs). Just don’t make the mistake of trying to mount the disk image from more than one place at a time. Bad things will happen.

Another feature of the disk images in OS X is along the same lines of TrueCrypt: the disk image is encrypted. So not only do you have a disk image that is mountable on the local machine, syncs to the cloud, but it can be encrypted with 128 or 256-bit AES. TrueCrypt does not, to my knowledge, have or support sparse images, so it’s not a viable option for a cloud syncing service.

An encrypted sparse disk image makes it far safer to backup, store, and sync important data to the cloud - the sync “just works”, it’s easy to setup, and it has its own encryption - which is important since I don’t trust anybody’s “guarantee” that the files stored in the cloud won’t be accessed by someone or something else. Naturally, I create a disk image whose size is the same as my available space on the cloud storage, mount the disk image, and use it as a normal drive - and copy all my data (sensitive or not) into the encrypted disk image. Easy for me to access, not so easy for anyone else.

I’m not aware of any OS other than OS X that has the ability to make a sparse disk image. It’d be pretty sweet if there were a cross-platform option that has all of the advantages of an Apple sparse bundle disk image - encryption, multiple disk and partition formats, resizable and scalable, and sparse files (so it can be synced efficiently over the cloud).