Currently I'm using EncFS to encrypt my directory "confidential" to ".encconfidential" and sync that encrypted directory using an online service (e.g. Dropbox, UbuntuOne etc). However my entire disk is already LUKS encrypted, so the double encryption takes a toll on performance.
I wonder is there an "inverted" EncFS option? An unencrypted directory gets mounted and in the mounted directory you only see encrypted files. So I could work with the unencrypted documents while the sync tool sees and read/writes the encrypted files only.
Clarification: My primary use case is sync not backup. I want to be able to securely keep machines in sync without the double encryption penalty when operating local (I have to wait when I hit save, compared to transmission time an encrypted operation is a minimal increment in time - and it is background time, not user time)
There actually is an Encfs "inverted" option. From the Encfs man page:
I have not tried it for syncing, but I think it would work as long as you use the same
.encfs5
config folder at the other end.Now for how to do exactly what you specify:
What you're asking for is a read-only filesystem view that automatically encrypts any file that is read through it:
The standard way to do this is to use FUSE (Filesystem in User-space).
For your use case, there already exists a FUSE filesystem that can do what you want,
fuseflt
.fuseflt
gives a read-only view of a filesystem with arbitrary user-specified filters applied to each file that is read.In your case, the filter you want is an encryption program like
gpg
.See the documentation for how to write your config file. Basically, use
flt_cmd = gpg --encrypt [... your chosen encryption settings]
as the filter command.Be careful; if you mess up your configuration it might expose plaintext data to your Internet service. I would recommend my other answer for general use.
Since you also need write support for syncing to work, it looks like you'll have to write your own FUSE filesystem. It probably won't be hard to modify the
fuseflt
sources to add write support; just fill in the write functions that aren't implemented. This would work the same way as the read support, calling a decryption filter instead of the encryption one.For writing your FUSE filesystem, several tutorials are available. Also see the FUSE wiki for more documentation.
Once you do this, add your FUSE filesystem mount command to your .profile so that it mounts automatically on login.
It's possible in principle (using a FUSE filesystem), but a simpler option is to use a ready-made encrypted backup program using your online service as as the backup target.
There are 2 suitable backup programs I know of. Both of these also give you the complete history of your files.
Duplicity / Deja-Dup
Duplicity (Ubuntu package) is a backup program that efficiently writes compressed, encrypted incremental backups to a remote location. The incremental backups are space-efficient because it uses the rsync algorithm to produce binary diffs.
You can also use the Deja-Dup front-end, which is included by default in recent Ubuntu versions.
Duplicity supports writing to many remote locations, or backends. In particular, Duplicity has an Ubuntu One backend. I don't think it directly supports Dropbox, but you can tell it to back up to the local directory that Dropbox syncs.
If you're backing up large quantities of data, Duplicity is not suitable. Due to limitations in how it stores incremental backups, it requires periodically running a full backup, which entails uploading all your data.
Obnam
For larger backups, look at Obnam. It stores encrypted data deduplicated in a backup repository. To use it with a remote storage service, tell Obnam to back up to a repository in a location that Dropbox/Ubuntu One will sync. Since Obnam uses a B-tree-based repository format that only needs to write new/changed data to the repository, syncing should be fast.
The disadvantage is that it requires storing 2 copies of your data on your hard disk (the canonical copy, and the copy in the backup repository).
Ubuntu package link. There is also a PPA.
Another ready-made sync tool is Seafile. It is a one server multiple clients solution like dropbox. In the latest version there is an option to share encrypted folders in a way that the server won't know the key.
See Seafile security features
Hint: Seafile calls a shared folder a "Library", for better understanding of the documentation.