Friday, January 4, 2013

Syncing Encrypted Files Between Multiple Platforms

This is going to be a fairly short and quick how-to on syncing encrypted files between different systems running different operating systems. The software we will be using is EncFS (on Linux) and Boxcryptor (on everything else).

First thing we need to do is choose what we're going to use as the common storage point for the encrypted files. Boxcryptor supports Dropbox, Google Drive, SkyDrive, WebDav and SD card. Since Google hasn't gotten their act together on a Google Drive application for Linux and I don't have anything running WebDav, I chose to use Dropbox.

Download Boxcryptor to your device (I chose to use my Android phone) and select to connect it to your drop box account. Once connected, click the button to create a new encrypted folder. Once you have done this, we can move on to setting up your Linux desktop with EncFS. If you don't have any Linux systems (shame on you) you can stop here and repeat this process of setting up BoxCryptor on your other close source platforms. The only difference being that instead of creating a new folder, you'll be selecting the one you created from your first device.

Setting up EncFS on Linux can be a bit tricky. This is mainly due to the fact that a lot of tutorials I found around the web recommended that you use the "CryptKeeper" application as a front end. I tried this and it was terrible. I would recommend skipping it all together and just using the command line utility "encfs". To do this, use your package manager to download fuse-encfs. "apt-get install fuse-encfs" on Ubuntu and "yum install fuse-encfs on RHEL/Fedora". Next, download and install the dropbox build for your distribution. Sign in to your account and let it sync your files. Once it finishes synchronizing we're ready to set-up the encfs mount. Run "encfs ~/Dropbox/path/to/folder.bc ~/mount/point/for/encfs". This will prompt you if you want to create the mountpoint (if it does not yet exist) and then your encryption passphrase.

Thats it! It's important to note that in order for files to be encrypted, you must access the directory via the mount point, not the raw directory within dropbox. To demonstrate this, you can create a text file within the "~/mount/point/for/encfs" and put some random jibberish in it. Save the file and then try to read the file from the raw directory, in this case, ~/Dropbox/path/to/folder.bc. You'll notice that the contents of the file when viewed outside of the mountpoint is scrambled.

Please feel free to ask any question in the comments section, I'll be happy to help you out if you get stuck or send me a message on Google+ if that's more convenient.