Information leakage from the ecryptfs filesystem I'm wondering what information might be leaked from the ecryptfs filesystem. This is what Ubuntu uses if you check the box for "encrypted home directory" when using the desktop installer, so is probably quite widely used. Key characteristics of it:


each file is encrypted individually and stored in the underlying filesystem
each file is padded in size to be a multiple of 4096 bytes, with a minimum of 12288 (except for directories and soft links)
file and directory names are encrypted
the directory structure is maintained


(Note I haven't found a spec about the above, this is worked out from observing my own filesystem - it's stored in /home/.ecryptfs/USERNAME/.Private if you want to examine your own).

So assuming you can't break the encryption keys then you can't examine the contents of the files. However there is still some information left to examine, and just as traffic analysis can deduce useful information from encrypted communications data, I'm wondering how much someone might be able to work out from the directory structure and approximate file sizes. 

Certainly you could work out which directories and files contained music, video and photographs from file size. You might even be able to work out what music and videos existed. You could probably work out some of the applications in use due to their pattern of config/cache directories - firefox vs chrome etc.

Is there anything else? Is there a standard analysis of what could be deduced? Does anything else spring to mind?

(I must admit I assumed there was no padding of file sizes when I started writing this question - I'm reassured that there is).
(Disclosure: I'm the author of the functionality that you're asking about (good question!).)

Ubuntu's Encrypted Home Directory feature uses eCryptfs as the filesystem encryption technology.  eCryptfs is a layered filesystem built directly into the Linux kernel.  It mounts one directory on top of another.  The top directory is really just a "virtual" mountpoint.  Applications (and humans) can operate within that directory and read and write data without needing to know or be bothered by the encryption that's happening underneath.  The lower directory is where the actual encrypted files are stored on disk.

This approach has several advantages.  Unlike dmcrypt or full disk encryption, you don't have to pre-allocate a fixed amount of space dedicated to encryption.  You can also limit what gets encrypted a bit more to the information that's truly unique to you (improving overall system performance and power consumption).  There is some privilege separation between users, with each user having their own unique mount point and encryption keys.  And this particular feature is hooked into PAM, so that your directory is mounted automatically when you login, and unmounted when you logout.  Also, each and every file is encrypted with a unique, randomly generated key called the 'fek' (which is stored in the header of the file, and wrapped with the MOUNT passphrase).  What this means is that two cleartext files that are binary equivalent encrypt to two completely different ciphertexts!

On the flip side, there are a few things that you should be aware of -- now to the meat of your question!


The upper and lower file structure is pretty much identical, and some file names might be deduced (based on the default Ubuntu home directory skeleton)
File permissions, file ownerships, and file timestamps are not encrypted (so files with weird permissions, like 0123 might stand out)
Encrypted filenames limit the upper cleartext filename to about 160 characters (as the filename encryption requires some padding)
Swap should absolutely be encrypted, if you're using Ubuntu Encrypted Home, as anything in memory can be swapped to disk at any time (and certainly is, if you hibernate a system)
When the filesystem is actively mounted, only Unix run time Discretionary Access Controls  protect you from other users on the system (note that the home directory is permission 0700)
When the filesystem is actively mounted, eCryptfs does NOT protect you from the root user
Unless you move your ~/.ecryptfs/wrapped-passphrase off the local system and onto removable media (like a usb stick or flash disk), your LOGIN passphrase is the weak point of the encryption


Now, all that said, I still believe that Ubuntu's Encrypted Home delivers an outstanding balance of security and usability.  It's trivial to setup, and with a good login password, it provides extremely strong protection of all of your data in $HOME against off line attacks.  In other words, if someone physically steals your laptop, boots a live CD and starts digging around your $HOME/.Private encrypted data, they might glean some information about your filenames, directory structure, and timestamps.  But to obtain the contents of any particular file, they will need one of:


your LOGIN passphrase and your wrapped-passphrase file
the cleartext, 128-bit long, random MOUNT passphrase (stored inside of the wrapped-passphrase file)
enough time to brute force the 128-bit key in 2.
flaws in AES256


For more information, I've written magazine articles and a running series of blog posts on eCryptfs.