Re: Question on ext4 directory hashes in combination with file name encryption

From: Theodore Ts'o
Date: Fri Sep 30 2016 - 20:44:28 EST

On Fri, Sep 30, 2016 at 04:09:09PM +0200, Richard Weinberger wrote:
> if I read the ext4 code correctly, you pass encrypted filenames to ext4fs_dirhash().
> These filenames are not encoded and therefore binary gibberish.

That's correct.

> Isn't this a problem for the ext4 hash functions? My fear is that these hashes are optimized
> for ASCII strings and produce more collisions when binary data is used as input.

I'm not particularly worried. In general, while the converse is true;
that hashes that assume that they are used for binary data might not
work as well for ASCII strings, the ext4 hash functions should work
fine for binary data.

- Ted