linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Milan Broz <gmazyland@gmail.com>,
	Mike Snitzer <msnitzer@redhat.com>,
	device-mapper development <dm-devel@redhat.com>,
	"open list:HARDWARE RANDOM NUMBER GENERATOR CORE" 
	<linux-crypto@vger.kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-fscrypt@vger.kernel.org
Subject: Re: [dm-devel] [RFC PATCH 0/3] crypto: switch to shash for ESSIV generation
Date: Sun, 16 Jun 2019 14:09:03 -0700	[thread overview]
Message-ID: <20190616210903.GF923@sol.localdomain> (raw)
In-Reply-To: <CAKv+Gu88tYOmO=8mi7yP2oj=x_SOB_o7D9jo6v_3xfbUxY2R1A@mail.gmail.com>

[+Cc linux-fscrypt]

On Sun, Jun 16, 2019 at 09:13:01PM +0200, Ard Biesheuvel wrote:
> >
> >  - ESSIV is useful only for CBC mode. I wish we move to some better mode
> > in the future instead of cementing CBC use... But if it helps people
> > to actually use unpredictable IV for CBC, it is the right approach.
> > (yes, I know XTS has own problems as well... but IMO that should be the default
> > for sector/fs-block encryption these days :)
> >
> 
> I agree that XTS should be preferred. But for some reason, the
> kernel's XTS implementation does not support ciphertext stealing (as
> opposed to, e.g., OpenSSL), and so CBC ended up being used for
> encrypting the filenames in fscrypt.
> 

Actually, for fscrypt CTS-CBC was also chosen because all filenames in each
directory use the same IV, in order to efficiently support all the possible
filesystem operations and to support filenames up to NAME_MAX.  So there was a
desire for there to be some propagation across ciphertext blocks rather than use
XTS which would effectively be ECB in this case.

Neither solution is great though, since CBC-CTS still has the common prefix
problem.  Long-term we're planning to switch to an AES-based wide block mode
such as AES-HEH or AES-HCTR for filenames encryption.  This is already solved
for Adiantum users since Adiantum is a wide-block mode, but there should be a
pure AES solution too to go along with AES contents encryption.

- Eric

  reply	other threads:[~2019-06-16 21:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  8:34 [RFC PATCH 0/3] crypto: switch to shash for ESSIV generation Ard Biesheuvel
2019-06-14  8:34 ` [RFC PATCH 1/3] crypto: essiv - create a new shash template for IV generation Ard Biesheuvel
2019-06-14  8:34 ` [RFC PATCH 2/3] dm crypt: switch to essiv shash Ard Biesheuvel
2019-06-14  8:34 ` [RFC PATCH 3/3] fscrypt: switch to ESSIV shash Ard Biesheuvel
2019-06-15 18:19 ` [RFC PATCH 0/3] crypto: switch to shash for ESSIV generation Milan Broz
2019-06-16 19:13   ` Ard Biesheuvel
2019-06-16 21:09     ` Eric Biggers [this message]
2019-06-16 20:44 ` Eric Biggers
2019-06-17  8:51   ` Gilad Ben-Yossef
2019-06-17  9:15     ` Ard Biesheuvel
2019-06-17  9:20       ` Herbert Xu
2019-06-17  9:24         ` Ard Biesheuvel
2019-06-17 10:39       ` Milan Broz
2019-06-17 10:58         ` Ard Biesheuvel
2019-06-17 13:59           ` Ard Biesheuvel
2019-06-17 14:35             ` Milan Broz
2019-06-17 14:39               ` Ard Biesheuvel
2019-06-17 17:05                 ` Milan Broz
2019-06-17 17:29                   ` Ard Biesheuvel
2019-06-17 17:52                     ` Milan Broz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190616210903.GF923@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dm-devel@redhat.com \
    --cc=gmazyland@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=msnitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).