7

I use Dropbox with encfs. The problem is that my host supports only 256 characters in a filename, hence encfs supports only ~190. Is there a way to circumvent that without reinstall and increase limit for the host filesystem?

I am primarily using ext4 as filesystem in Ubuntu 11.10, but also Mac OSX 10.6 with hfs as filesystem and Windows is not so important for me at this time.

Cheers, Brubel.

math
  • 8,514
  • 10
  • 53
  • 61
  • 1
    I had problems using encfs on Ubuntu when I was using ecryptfs for home directory. For me ecryptfs was the limit, not encfs. – Leszek Zarna Aug 25 '13 at 12:50
  • 1
    What I end up doing was not to encrypt the filenames and disable IV. I see this also as a severe limitation in either using filename encryption. From the man page: "Based on an underlying filesystem supporting a maximum of 255 characters in filenames, here is the maximum possible filename length depending on the choosen encoding scheme : stream (189), block (176), block32 (143). Note that we should rather talk about bytes, when filenames contain special (multi-bytes) characters." – Sitoplex Nov 22 '18 at 08:38

2 Answers2

2

I don't think the task would necessarily be easy; it looks to me like the logic you need to work with is NameIO::recodePath(), and it even looks pretty well self-contained. You would need to come up with some other database that lets you create, rename, and delete entries as closely as possible as the standard POSIX filesystem semantics.

If you don't mind losing the "filenames are unknown without the key" property, you could simply store an SQLite3 database mapping the plaintext long names with the "ciphertext" shorter names -- maybe just counter-based names, or hash the names, etc.

sarnold
  • 102,305
  • 22
  • 181
  • 238
  • What if the SQLite3 database contained a table of the full-length encoding of the file name as one column, and a column consisting of the 40-byte SHA-1 hash of the file name? Then you could use the SHA-1 hash of the file name as the display file name in the encrypted system. I don't think this would expose the original file name, right? – taltman Jan 22 '13 at 02:08
1

I hit the same problem. Though I think that this should ideally become a feature of encfs (since it exasperates the problem via encryption of file or directory names), I decided that I couldn't hold my breath that long. So, I hacked together a script that can temporarily rename files and directories with shorter names so that encfs (and other programs) can proceed. Please let me know if it is helpful for you.

Suzanne Soy
  • 3,027
  • 6
  • 38
  • 56
taltman
  • 198
  • 2
  • 6
  • Looks like you've moved the file to https://github.com/taltman/scripts/blob/master/unix_utils/shorten-filenames.sh? – mwfearnley Aug 23 '19 at 08:54