]> git.baikalelectronics.ru Git - kernel.git/commit
fscrypt: Add HCTR2 support for filename encryption
authorNathan Huckleberry <nhuck@google.com>
Fri, 20 May 2022 18:15:01 +0000 (18:15 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 10 Jun 2022 08:40:18 +0000 (16:40 +0800)
commitf4e6c9b7d4c69f9b652f45a466efcccdbb2ce0ec
tree8110bcd6c9baaedb35a031ae2529b2e47fa74269
parentbca21725bf55b2d77150c9fdfb314269a7e9f4e1
fscrypt: Add HCTR2 support for filename encryption

HCTR2 is a tweakable, length-preserving encryption mode that is intended
for use on CPUs with dedicated crypto instructions.  HCTR2 has the
property that a bitflip in the plaintext changes the entire ciphertext.
This property fixes a known weakness with filename encryption: when two
filenames in the same directory share a prefix of >= 16 bytes, with
AES-CTS-CBC their encrypted filenames share a common substring, leaking
information.  HCTR2 does not have this problem.

More information on HCTR2 can be found here: "Length-preserving
encryption with HCTR2": https://eprint.iacr.org/2021/1441.pdf

Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Documentation/filesystems/fscrypt.rst
fs/crypto/fscrypt_private.h
fs/crypto/keysetup.c
fs/crypto/policy.c
include/uapi/linux/fscrypt.h