Re: [TLS] AAED ciphers: AES-GCM vs AES-EAX/AES-CCM: a meta-analysis

Michael Clark <michael@metaparadigm.com> Thu, 25 December 2014 02:38 UTC

Return-Path: <michael@metaparadigm.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3AB511A6FDB for <tls@ietfa.amsl.com>; Wed, 24 Dec 2014 18:38:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.468
X-Spam-Level:
X-Spam-Status: No, score=-1.468 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, IP_NOT_FRIENDLY=0.334, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_DKIM_INVALID=0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M5qWSkkt6P78 for <tls@ietfa.amsl.com>; Wed, 24 Dec 2014 18:38:46 -0800 (PST)
Received: from klaatu.metaparadigm.com (klaatu.metaparadigm.com [67.207.128.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8E16A1A6FCF for <tls@ietf.org>; Wed, 24 Dec 2014 18:38:46 -0800 (PST)
Received: from monty.local (unknown.maxonline.com.sg [58.182.90.50] (may be forged)) (authenticated bits=0) by klaatu.metaparadigm.com (8.14.4/8.14.4/Debian-4) with ESMTP id sBP2xKZP012598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 25 Dec 2014 02:59:24 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=metaparadigm.com; s=klaatu; t=1419476367; bh=I1zWmWp5ICyUUg4UN4+nWkH6rxOViJFaYfqdrvcgxFY=; h=Date:From:To:CC:Subject:References:In-Reply-To:From; b=EXILJ5aiU6Xp1sPAwQ4VBjn7AACpbjDiR9sPHnn+Tge0Z/eB1spoo67Xr19l1Ejdt F5+SZ6SD1N/4u7EERKBhZDIr/yvBkqJFxzJY/Ms467YxMlN4zSC5IN2Wx+4IwRAn08 avHQtP+FO3nNRkZlWxfLTBGGVuBHpzfIbr1QLl8Y=
Message-ID: <549B7890.9000304@metaparadigm.com>
Date: Thu, 25 Dec 2014 10:38:08 +0800
From: Michael Clark <michael@metaparadigm.com>
Organization: Metaparadigm Pte Ltd
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
MIME-Version: 1.0
To: Watson Ladd <watsonbladd@gmail.com>
References: <9A043F3CF02CD34C8E74AC1594475C73AAF49636@uxcn10-tdc05.UoA.auckland.ac.nz> <549B61E4.8080301@metaparadigm.com> <CACsn0c=O55tU7zpo_hZ6m958H7W=3K3PgTO6G0n=a-5FofkQTg@mail.gmail.com>
In-Reply-To: <CACsn0c=O55tU7zpo_hZ6m958H7W=3K3PgTO6G0n=a-5FofkQTg@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.98.4 at klaatu.metaparadigm.com
X-Virus-Status: Clean
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/Oy9zHZsHtvrp2sqcp0EU4CeCvn4
Cc: "<tls@ietf.org>" <tls@ietf.org>
Subject: Re: [TLS] AAED ciphers: AES-GCM vs AES-EAX/AES-CCM: a meta-analysis
X-BeenThere: tls@ietf.org
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." <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: Thu, 25 Dec 2014 02:38:48 -0000

On 25/12/14 9:57 am, Watson Ladd wrote:
> On Wed, Dec 24, 2014 at 8:01 PM, Michael Clark <michael@metaparadigm.com> wrote:
>> Hi Peter,
>>
>> Someone pointed out RFC 7366 to me off list. I will read. I like the
>> idea of encrypt-then-MAC being a core requirement for TLSv1.3.
> 
> And we have already made AEAD modes a requirement in the TLS 1.3
> draft. I don't see the argument for adding RFC 7366 in addition to
> these.
>>
>> Before I've read through can we do this with it?
>>
>> AES-256-GCM + hmac_null   = 128 bits authentication
>> AES-256-CBC + hmac_sha128 = 128 bits authentication
>>
>> AES-256-GCM + hmac_sha128 = 256 bits authentication
>> AES-256-CBC + hmac_sha256 = 256 bits authentication
>>
>> AES-256-GCM + hmac_sha256 = 384 bits authentication
>> AES-256-CBC + hmac_sha384 = 384 bits authentication
>>
>> I like the idea of >= 256 bits authentication, and the idea of the
>> combination of a cipher based MAC and PRF based MAC for AES-GCM, given
>> the properties of the AES-GCM CTR mode 'variant' and GHASH GF(2^128).
> 
> I don't agree with this analysis.
> 
> For starters, GCM is not a PRF based authenticator. The security of
> GCM authentication decreases with the length of the message, while the
> security of HMAC authentication does not, while the numbers above
> don't recognize this.

This is kind of my point. There is broken MAC-then-encrypt for non AEAD
ciphers and AEAD ciphers with 128-bit tags where the authentication
decreases with the length of the messages (non PRF based MACs based on
finite fields).

> Secondly, attacks on authentication have to be online, and a failed
> guess results in connection teardown. An attacker with a 2^{-64}
> probability of forgery on any given connection would take decades to
> inject data into a TLS connection, even if the connection restarted 1
> million times a second.  By contrast, recovering data from a key 64
> bits in length is a rather easy computation today, and will be easier
> tomorrow.

Sorry I don't have numbers, however if you are attacking a target where
you know the message length of a oft repeated transaction and have a
128-bit GCM auth tag (theoretically ~64-bits strength if you have
captured texts) then there is a possibility you could forge auth tags.
DHTs are fast and disks are cheap. There may be some facilities that
have 100 million threads and more drives (if you knew Intel's order
book). I say dictionary lookup would be feasible within the next few
years which has to be the time domain that is considered. sha1 is being
deprecated elsewhere. Sure people have more time to attack CA certs.

> Thirdly, the weak keys of GCM are a red herring. Using the logic of
> those papers, every GCM key is weak, as there is a known difference
> between messages that will lead to a forgery if a given key is used.
> One could make the same argument against CBC-MAC: if an attacker knows
> the key, they can produce forgeries.
> 
> Fourthly, this ignores performance. Recent Intel chips have a
> significant amount of acceleration for AES-GCM that cannot be used for
> other modes. The parallelism of CTR mode permits hiding the latency of
> the AES instructions, while the carryless multiply can't accelerate
> HMAC. It also ignores implementation complexity: making two passes
> over the data, with different algorithms, is more complex than one.

I understand. I've read the code. I am aware of the properties of
GF(2^128) finite fields. There are all arguments for performance and
scary when it comes to the potential to forge tags for larger messages.
There is huge parallelism potential in AES-GCM. I know software
implementations with AES-NI are doing 4 blocks but the potential is not
limited to 4 blocks.

> In short, there are no real security gains from this proposal. But
> there are large losses in simplicity and performance, as now the
> existing record layer transformations have to be redesigned and
> stacked in ways they aren't currently. One can't say "such and such an
> algorithm has more bits, therefore it is more secure". You have to
> look at the exact claims, and see how they apply to the way the
> algorithms are used.

I see it a different way. hmac_null plus AEAD_AES_GCM allows for the
current level of integrity. The addition of a PRF based MAC provides
more message integrity. No doubt. I can't see a good argument against an
option for more integrity if a user wants it. I'm always worried by
people who trust the level of integrity in algorithms that have
deliberately sacrificed security for performance (32-bits less entropy
in IV, not following CTR IV method, along with GCM's parallel GHASH and
the properties of GF(2^128). This is all for speed. Good for a
SSL-everywhere plain text replacement. Fine for Facebook and Google
search. I'm sure the banks wouldn't trust it. Anyway, they have external
factors to mitigate flaws in TLS.

Consider it like insurance. The 'option' of adding authentication bits
with a PRF gives you *added* integrity that does not decrease based on
message length. It's up to a server whether it is used or not. I'm not
making any argument about what are good defaults, just an option for
more integrity.

We will have to agree to disagree. I don't trust AES_GCM given my read
of the spec. I noticed a shift towards better properties of prime sized
fields GF(P) and GF(2^p); where p is prime. It's a fallacy to trust the
security of AES_GCM when there are known weaknesses. We don't have to do
any math to know that adding integrity with a PRF based MAC would
mitigate future flaws in AES_GCM. i.e. reserve.