BtrFS should support this really, but it doesn't. So ECryptFS looks like it will fill the gap. The only thing is, how would I layer compression on top of this?
Reasons for compression on top of encryption:
- intentionally, the converse (encryption on top of compression) doesn't compress, because encryption ideally tries to make the ciphertext indistinguishable from random data;
- encryption of denser information is more secure.
I'm looking for a filesystem-level solution such that files can be encrypted with different keys as appropriate (such as for users/groups) on an ad-hoc basis (i.e. can be changed without major reconfiguration that you have with block-level encryption).
.gz
or.xz
files and then encrypt them, a good solution might be an encrypted dm-crypt/LUKS container, formatted with a compressing filesystem like btrfs. LUKS should be able to use multiple keys and "can be changed without major reconfiguration" you're concerned about, but then the LUKS container is a large fixed size, hmmm. I've noticed a disappointing lack of compressing filesystems... ntfs & btrfs. Or there's squashfs but it's read-only.