All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taylor Hornby <havoc@defuse.ca>
To: ecryptfs@vger.kernel.org
Subject: Re: [RFC 3/3] Enable GCM support in eCryptfs
Date: Wed, 22 Jan 2014 11:13:12 -0700	[thread overview]
Message-ID: <lbp1nd$f0m$1@ger.gmane.org> (raw)
In-Reply-To: <52DAD571.5070801@gmail.com>

On 01/18/2014 12:26 PM, Will Morrison wrote:
> This patch adds support for GCM as a cipher mode in eCryptfs. If a file
> is encrypted in this mode, the layout of the lower file will change to
> accomodate it. This is due to the need to store auth tags as well as
> encrypted data.

Using a stream cipher mode like GCM without choosing a new random IV for
every write will destroy eCryptfs's security.

In GCM, the ciphertext is simply XORed with a key stream generated by
encrypting a counter. This means that the first time you write an
extent, you get:

  ciphertext1 = keystream ^ plaintext1

The second time you write to that extent (without changing the IV, which
I believe is not done), you get:

  ciphertext2 = keystream ^ plaintext2

An attacker can XOR ciphertext1 with ciphertext2 to get:

  ciphertext1 ^ ciphertext2 = plaintext1 ^ plaintext2

Which reveals them lots of information about the plaintext. Other disk
encryption software all use block modes like CBC-ESSIV or XTS to prevent
this.

See also the "Security Audit" thread.

-- 
Taylor Hornby

      reply	other threads:[~2014-01-22 18:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-18 19:26 [RFC 3/3] Enable GCM support in eCryptfs Will Morrison
2014-01-22 18:13 ` Taylor Hornby [this message]

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='lbp1nd$f0m$1@ger.gmane.org' \
    --to=havoc@defuse.ca \
    --cc=ecryptfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.