Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

ecryptfs-setup-private will by default use an AES 128 bit key.

Can I make it use a 256 bit key (32 bytes key length)?

Of course, I could do the whole process manually as described here: https://wiki.archlinux.org/index.php/System_Encryption_with_eCryptfs#Setup_.28in_detail.29

But I want to have the convenience of using ecryptfs's easy to use tools but just with a stronger encryption key.

I tried modifying /usr/bin/ecryptfs-setup-private (changing KEYBYTES="16" to KEYBYTES="32" inside), but the process of creating the Private/.Private directories will fail.

share|improve this question
Note that there is no practical security benefit to using AES-256 over AES-128. Using a 256-bit key will make your system a bit slower, but it will not make it more secure. See e.g. Amount of simple operations that is safely out of reach for all humanity? –  Gilles May 12 '12 at 17:32
@Gilles That article makes a boatload of assumptions. Things can go wrong basically with each of his assumptions. My personal paranoia level requires all the security I can get. –  user12681 May 13 '12 at 16:34
Thomas Pornin is a professional cryptographer, he knows when your paranoia is misplaced. You're putting faith in having a bigger number without understanding what this number means. –  Gilles May 13 '12 at 17:37
@Gilles I'm actually a trained computer scientist myself, so I'm not totally clueless about this. The idea is that there are a lot of assumptions in his text and my personal paranoia level is high. So, in short, I just want the biggest number possible. The idea is that I'm not satisfied even with 256, but as I said, the idea is just all the security I can get. –  user12681 May 14 '12 at 18:34
@Gilles And he doesn't even mention potential flaws that might be found in AES in the future. Which could make (pie in the sky estimate) 256 bit just as safe as 64 bit is now thought of as. And my personal paranoia can find many other such quibbles if I get down to it. –  user12681 May 14 '12 at 18:52

1 Answer 1

up vote 4 down vote accepted

The short answer is 'no'. When I wrote ecryptfs-setup-private, I chose a set of defaults for eCryptfs that I considered sensible, secure and supportable for millions of Ubuntu users who wouldn't care much about tunables over the long haul. This limited the number of configuration combinations we had to test and support.

As you've noted, eCryptfs is very configurable if you read the docs and mount manually, while the Ubuntu Encrypted Private/Home feature has a consistent set of options everywhere.

Moreover, Bruce Schneier has recommended against using AES256, in favor of AES128:

And for new applications I suggest that people don't use AES-256. AES-128 provides more than enough security margin for the forseeable future.

share|improve this answer
Thanks, for your answer, didn't expect to actually encounter the person who wrote the script! But the ecryptfs-setup-private is accepting many parameters. Why not add this one as well (for the paranoid users)? –  user12681 May 13 '12 at 16:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.