Re: [TLS] TLS1.3

mrex@sap.com (Martin Rex) Sat, 09 February 2013 01:29 UTC

Return-Path: <mrex@sap.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0E80921F89FC for <tls@ietfa.amsl.com>; Fri, 8 Feb 2013 17:29:13 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.296
X-Spam-Level:
X-Spam-Status: No, score=-10.296 tagged_above=-999 required=5 tests=[AWL=-0.047, BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q4df26In0o5k for <tls@ietfa.amsl.com>; Fri, 8 Feb 2013 17:29:12 -0800 (PST)
Received: from smtpde02.sap-ag.de (smtpde02.sap-ag.de [155.56.68.140]) by ietfa.amsl.com (Postfix) with ESMTP id E07E121F8867 for <tls@ietf.org>; Fri, 8 Feb 2013 17:29:11 -0800 (PST)
Received: from mail05.wdf.sap.corp by smtpde02.sap-ag.de (26) with ESMTP id r191T7Xk025946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 9 Feb 2013 02:29:08 +0100 (MET)
In-Reply-To: <CAJU7za+NPT03YoJc=xKkA23=aw6kq2DSgs3Tpj_cA_dP2xCf6w@mail.gmail.com>
To: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date: Sat, 09 Feb 2013 02:29:07 +0100
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: <20130209012907.D1C891A533@ld9781.wdf.sap.corp>
From: mrex@sap.com
X-SAP: out
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] TLS1.3
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
Reply-To: mrex@sap.com
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Feb 2013 01:29:13 -0000

Nikos Mavrogiannopoulos wrote:
>
> Peter Gutmann wrote:
> >
> >>Padding the plain text up to a multiple of the cipher block size (minus the
> >>hash size) ahead of doing the MAC is a more modest change that may be more
> >>widely applicable to existing cipher suites - with a "pad-then MAC" client
> >>hello
> >
> > That won't help against the current attack.
> 
> This family of attacks relies on the fact that padding isn't
> authenticated, i.e, you can play with it without being detected. If
> pad is part of the MAC there is no issue.

I agree with Nikos.

The problem of TLS is that it does not authenticate the entire
decryption output (i.e. uses MAC-pad-encrypt rather than pad-MAC-encrypt).


> 
> > The only proper fix for the
> > various attacks that target the encryption is to protect everything with the
> > MAC, i.e. switch to encrypt-then-MAC.  The definitive reference for this is
> > Hugo Krawczyk's "The Order of Encryption and Authentication for Protecting
> > Communications (Or: How Secure is SSL?)".


To me, Hugo's "proof" that AtE would have a "general weakness"
is misleading (and slightly bordering on lame).

He proofs a security problem *ONLY* for a MAC-extend-encrypt scheme,
and only under the condition of the availablility of a decryption oracle
that will blissfully answer a huge amount of chosen ciphertext attacks.

Potentially not realizing that the existing MAC-pad-encrypt approach
in SSL/TLS is one incarnation of the dangerous MAC-extend-encrypt schemes,
Hugo's paper incorrectly asserts this (last paragraph on page 3):

  The security of AtE with specific encryption modes.

  This paper does not bring just bad news. We also show that the
  authenticate-then-encrypt method is secure under two very common
  forms of encryption: CBC mode (with an underlying secure block cipher)
  and stream ciphers (that xor the data with a random or pseudorandom pad).
  We provide a (near optimal) quantified security analysis of these
  methods. While these positive results do not resolve the
  "generic weakness" of the authenticate-then-encrypt method
  (and of SSL), they do show that the common implementations currently
  in use do result in a secure channels protocol.


CBC-padding is simply an incarnation of "extend" in MAC-extend-encrypt.

And the addition of unauthenticated-but-encrypted information may allow
breaking the confidentiality of the cipher, given sufficient responses
from the decryption oracle, frobbing the ciphertext block covering the
unauthenticated part and getting the de-padding function to oracle
about characteristics of the resulting plaintext block.


> 
> Using encrypt-then-MAC to counter the attack is as radical change as
> using the GCM or CCM modes. This isn't a small fix, it is an upgrade
> which changes the protocol semantics (e.g. MAC is no longer encrypted
> - whatever that may mean). Moreover, encrypt-then-MAC isn't a panacea.
> There is nothing wrong with MAC-then-encrypt, it is TLS that applied
> it incorrectly by keeping the pad unauthenticated. I'd prefer a fix
> that keeps the current protocol semantics.


Personally, I also feel somewhat uncomfortable with a "radical" change
to encrypt-then-MAC rather than the simply using the obvious
pad-MAC-encrypt, as originally suggested by Serge Vaudenay.

When the encryption scheme that is used is bijective, then it will not
matter (to the confidentiality of the encryption) whether AtE or EtA
is used, as long as authentication covers the exact same information
in both cases, i.e. *ALL* of it, padding included.

However, in the EtA scheme, we would have a naked keyed hash.  And would
an attack on the keyed hash become somehow feasible, that attack might be
easier on a naked keyed hash than on an encrypted keyed hash.


-Martin