Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I thought changing the password with 'encfsctl passwd path/to/encrypted' would change all filenames. But it didn't work. Any ideas why?

I got this, so the password was changed correctly:

Enter current Encfs password
EncFS Password:
Enter new Encfs password
New Encfs Password:
Verify Encfs Password:
Volume Key successfully updated.
share|improve this question
up vote 6 down vote accepted

Data encryption systems (typically) do not directly encrypt the data with the password. The problem with doing this is that when the password is changed, all the data needs to be re-encrypted, which is a very intensive process. (It also prevents supporting multiple passwords.) Instead, a random key is generated when the system is initialised, and the data is encrypted with this random key. The random key is then encrypted with the password and stored on disk. To decrypt the data the password is first used to decrypt the random key, and then the random key is used to decrypt the data. Changing the password simply involves re-encrypting this random key, and not all the data.

The encfs manpage mentions:

The user must supply a password which is used to (indirectly) encrypt both filenames and file contents.

which implies that it uses this scheme.

share|improve this answer
If it re-encrypted everything with a brand new key, you'd have two keys you would have to keep secret forever to protect the data -- the old one (because it could decrypt backups of your encrypted data) and the new one (because it could decrypt the re-encrypted data) -- instead of just one. – David Schwartz Jul 1 '12 at 9:34

In EncFS the filenames and the data have different initialisation vectors. That prevents an attacker from encrypting data (or filenames) and compare it to the cypthertext.

As mentioned in the default answer, the password is actually only used to encrypt the Key. And the Key is used to encrypt the data. So assuming you changed the password you can reencrypt all the data inside of the container. Eg. like this (if your containter that contains the decrypted files is ~/dec/ )

cd ~/dec/
mkdir _copy
cp -a ./ ./_copy/
mv ./_copy/* ./
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.