How to change encfs password

Okay, most tutorials on encfs tells you that you can change your password with the encfsctl tool, but the ones I've looked at don't tell you how to do it. So here is a small explanation on how to change your encfs password.

For the purpose of this tutorial, I will create a new encfs container, put in some files, change the password and then verify that the files are still the same. First of, lets prepare the encrypted filesystem (I assume you already know how to do this, so no explanations):

mkdir encfs_test
cd encfs_test/
mkdir plain 
mkdir encrypted 
encfs ~/encfs_test/plain/ ~/encfs_test/encrypted/ 
dd if=/dev/urandom of=encrypted/testfile.bin count=1 bs=1k 
md5sum encrypted/testfile.bin 
#  34c1339b303f3c2d32bb608438f71b2f  encrypted/testfile.bin 
fusermount -u encrypted/

Now, as you can see, the MD5 sum for the testfile is 34c1339b303f3c2d32bb608438f71b2f. Now, lets change the password with encfsctl:

encfsctl passwd /home/bredsaal/encfs_test/plain/
Enter present Encfs password
EncFS password:
Enter new Encfs password
New Encfs password:
Verify EncFS password: 
Drive key was updated

Note: I translated the messages from encfsctl since I use the danish locale.

Now, to check if the file is still the same as it was before:

encfs ~/encfs_test/plain/ ~/encfs_test/encrypted/
md5sum encrypted/testfile.bin
#  34c1339b303f3c2d32bb608438f71b2f  encrypted/testfile.bin`

So they match - how nice! :-D There you have it, a simple way to change the password on a filesystem encrypted with encfs. :-)

Written by Jannich Brendle ons 11 januar 2012 In How to

tags: encryptionsecurity

Related posts