Re: [TLS] Encrypt-then-MAC again (was Re: padding bug) (Martin Rex) Tue, 19 November 2013 01:43 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 17C741AE986 for <>; Mon, 18 Nov 2013 17:43:28 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -6.552
X-Spam-Status: No, score=-6.552 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id kPG8tIVMRzPg for <>; Mon, 18 Nov 2013 17:43:25 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 7E3A51AE95B for <>; Mon, 18 Nov 2013 17:43:25 -0800 (PST)
Received: from by (26) with ESMTP id rAJ1hFwX022938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Nov 2013 02:43:15 +0100 (MET)
In-Reply-To: <1384400970.2092.7.camel@aspire.lan>
To: Nikos Mavrogiannopoulos <>
Date: Tue, 19 Nov 2013 02:43:15 +0100 (CET)
X-Mailer: ELM [version 2.4ME+ PL125 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="US-ASCII"
Message-Id: <>
From: (Martin Rex)
X-SAP: out
Cc: "" <>
Subject: Re: [TLS] Encrypt-then-MAC again (was Re: padding bug)
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 19 Nov 2013 01:43:28 -0000

Nikos Mavrogiannopoulos wrote:
> > > 
> > >
> There are two options. (a) Minor changes to the application protocol
> (for all application protocols), or (b) minor changes to the TLS
> protocol. The draft above takes the latter approach.

Personally, I prefer to seperate true fixes
(such as changing mac-pad-encrypt -> pad-mac-encrypt) from
new features.

> I also don't understand what do you mean by heading TLSv1.2-only. The
> proposal in the above draft works from SSL 3.0 to TLS 1.2. There is
> nothing TLS 1.2-specific there.

The AES-CCM and AES-GCM specs take the extreme position that everything
that refers to GenericAEADCipher PDU must be TLSv1.2 exclusively.

I would very much welcome if we could kill this, and let implementors
use GenericAEADCipher with whatever TLS version they see fit.
Such a relaxation should be negotiated, though, to avoid confusion
(and interop problems) with excessively pedantic implementations
that follow obviously flawed suggestions in immature specifications.

> > You proposal adds the padding at the beginning only.  Since the
> > problem exhibited by RC4 is inherent to any XOR-encryption with
> > a pseudo-random-pad, AES-CCM, AES-GCM, etc. I would make such an
> > extension use random fraction, random content, authenticated padding
> > on both sides of the plaintext, with a combined minimum padding length of
> > at least 16 bytes, in order to mitigate statistical attacks on
> > any bias that may be found in the pseudo-random-pad.
> The above draft does:
> 1. prevent padding oracle attacks
> 2. hide the length of the plaintext
> What you propose there is having the plaintext appear and finish in an
> unpredictable position. That's an interesting approach, not handled by
> the draft above.
> In simple terms you're asking for more bells and whistles :)

If you can't be good, at least be good at it.  :)

If you want to retrofit random padding into TLS (and into the stream and
aead cipher PDUs specifically), then you could at least try to mitigate
the most obvious problems with XOR-encryption schemes: the problems with
biases/patterns in the pseudo-random-pad and the possibility to accurately
flip individual bits in the plaintext.