2

I use encfs to backup my data to my external hard drive. Until yesterday everything has always gone fine. Then, after formatting my internal hard drive, I needed to access data on my encrypted folder

  • I used an old Lucid (10.04) install to mount my encrypted folder (was using 12.04 on my PC and it was the only available Linux install around)
  • Cryptkeeper accepted my password and mounted the directory, but the latter was empty
  • I tried unmounting then remounting it, but this time I got a "password incorrect" message
  • I tried to mount another encrypted folder (which had a different password), it went exactly the same : password accepted, the mounted directory is empty, then after unmounting/remounting the password isn't accepted anymore

I even tried to boot from a 13.10 live USB but this time encfs wouldn't accept the password (for either encrypted folders)

Question

How can I recover my data now ? I have lost half of my documents now, some of which are professional works.

1

1 Answer 1

2

The best easiest solution is to go to a backup copy, encryption by design makes data recovery nearly impossible, so backups are more important than ever.

The encfs man page has some things to say about different versions, stuff like

Note: EncFS reads at most 2k of data from the password program, and it removes any trailing newline. Versions before 1.4.x accepted only 64 bytes of text.

If an EncFS filesystem configuration from 1.4.x is modified with ver‐ sion 1.5 (such as when using encfsctl to change the password), then the new PBKDF2 function will be used and the filesystem will no longer be readable by older versions.

Even stuff like block sizes & different filename encoding may be unsupported in older versions.

I'm just guessing, but probably trying all the different versions messed stuff up. If you're lucky then none of the files were correctly mounted so the files themselves may be unchanged, and mounting them with the same version of encfs might still work. Or maybe only the .encfs6.xml "configuration" file was changed a little.

If the same version of encfs that created the files, or a newer version doesn't work, them maybe you've got a good backup copy of the .encfs6.xml file to decrypt the files. If you DON'T have a good backup then you might be able to re-create a configuration file that will work, I'm trying to find out how to do that myself in case something goes wrong with the config file, and keeping a config file with a password hash & instructions how to decrypt the files isn't terribly secure either.

  • I just tried creating a new empty encfs folder using the same settings & password as another folder with encrypted files. BUT the .encfs6.xml files had different "encodedKeyData" probably because of different "saltData" and different "kdfIterations" and trying to mount the old files with the new .encfs didn't work (error decoding filenames, checksum mismatches...).
  • I'll try changing the new .encfs file to matching saltData & kdfInterations, so just different encodedKeyData. --> Still doesn't work! Even with --anykey doesn't work!

So it looks like you really need an identical .encfs6.xml file to decrypt any old files. Recreating a new .encfs with the same options would get almost all the file recovered, but still need the "encodedKeyData" "saltData" and "kdfIterations" so if those 3 options weren't changed in your .encfs6.xml file but maybe some other options were changed, you might still be in luck?

  • Also, DON'T use cryptkeeper! (At least until after you can decrypt your files) Use encfs directly in a terminal, with encfs -f -v encodeddir decrypteddir to get a hint of what's going on, for all I know it's an old or weird version of cryptkeeper alone that's not mounting your directories correctly, come to think of it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .