Re: [Cfrg] Salsa20 stream cipher in TLS

Simon Josefsson <simon@josefsson.org> Mon, 18 March 2013 20:42 UTC

Return-Path: <simon@josefsson.org>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F3C1C11E80CC; Mon, 18 Mar 2013 13:42:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -99.909
X-Spam-Level:
X-Spam-Status: No, score=-99.909 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FH_HOST_EQ_D_D_D_D=0.765, HELO_MISMATCH_COM=0.553, HOST_EQ_STATICB=1.372, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PXsO-wceCunr; Mon, 18 Mar 2013 13:42:32 -0700 (PDT)
Received: from yxa-v.extundo.com (static-213-115-179-173.sme.bredbandsbolaget.se [213.115.179.173]) by ietfa.amsl.com (Postfix) with ESMTP id EF48E11E80BA; Mon, 18 Mar 2013 13:42:30 -0700 (PDT)
Received: from latte.josefsson.org (host-95-192-103-177.mobileonline.telia.com [95.192.103.177]) (authenticated bits=0) by yxa-v.extundo.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id r2IKgIXx008663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 18 Mar 2013 21:42:21 +0100
From: Simon Josefsson <simon@josefsson.org>
To: "David McGrew (mcgrew)" <mcgrew@cisco.com>
References: <87ppyxhc6y.fsf@latte.josefsson.org> <747787E65E3FBD4E93F0EB2F14DB556B183EB8AD@xmb-rcd-x04.cisco.com>
OpenPGP: id=B565716F; url=http://josefsson.org/key.txt
X-Hashcash: 1:22:130318:joachim@secworks.se::gtcs30S7ApbT29ps:1XE5
X-Hashcash: 1:22:130318:cfrg@irtf.org::aYH0KGdGpFBKoqaG:9He
X-Hashcash: 1:22:130318:mcgrew@cisco.com::McJDm8ulb7NLZpDl:Ole7
X-Hashcash: 1:22:130318:tls@ietf.org::Ce9zQZZ6LXhKXWtE:gpfN
Date: Mon, 18 Mar 2013 21:42:13 +0100
In-Reply-To: <747787E65E3FBD4E93F0EB2F14DB556B183EB8AD@xmb-rcd-x04.cisco.com> (David McGrew's message of "Mon, 18 Mar 2013 19:23:41 +0000")
Message-ID: <87ehfc784a.fsf@latte.josefsson.org>
User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
Cc: "cfrg@irtf.org" <cfrg@irtf.org>, "joachim@secworks.se" <joachim@secworks.se>, "tls@ietf.org" <tls@ietf.org>
Subject: Re: [Cfrg] Salsa20 stream cipher in TLS
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <http://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <http://www.irtf.org/mail-archive/web/cfrg>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <http://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Mar 2013 20:42:33 -0000

"David McGrew (mcgrew)" <mcgrew@cisco.com> writes:

> Hi Simon,

Hi David.  Thanks for quick review.

> It is not exactly clear what problem is being addressed by this work.
> Would be good to add a problem statement section.

Good idea, the document now contains this paragraph:

   The purpose of this document is to provide an alternative stream
   cipher for both TLS and DTLS that is comparable to RC4 in speed on a
   wide range of platforms.

There are other soft factors too.  In general the goal is to offer
something that can replace use of RC4 in TLS.  I'm guessing speed is one
reason people use RC4 in TLS today.

> Some more detailed comments, quoting from the draft:
>
>    Recent attacks has indicated problems with CBC-mode cipher suites in
>    TLS/DTLS and problems with the only supported stream cipher (RC4) in
>    TLS has been known for a long time.  While AEAD cipher suites address
>    these issues, concerns about performance are sometimes raised.
>
>
> What are the performance concerns?   I suggest citing some relevant
> performance data.

If there are implementations of this, we can benchmark them and compare
them against other cipher suites and include some numbers or pointers to
comparisons.  I believe Salsa20 is faster than for example AES GCM on
most platforms.

>   Because the GenericStreamCipher definition in TLS does not provide
>    any way to transport the Salsa20 nonce that is required for
>    functionality and needed to provide the random access property, we
>    let the output from the stream cipher operation be the concatenation
>    of the IV and the encrypted data.
>
>
> Please, define a Salsa20-based AEAD mechanism instead of a new TLS format!

That paragraph has been removed from the current work in progress, it
was incorrect (the record sequence number will be used as nonce
instead).  I don't believe the AEAD mechanism works: there is no field
to put the MAC in it.

>>Some elements of the draft is still in flux.  For example,
>>initial performance benchmarks suggests HMAC-SHA256 was a poor choice
>>for the MAC so we are looking into UMAC and HMAC-SHA1 as alternatives.
>>Still, all comments are appreciated.
>
> If anything other than HMAC-SHA1 is used, that would underscore the value
> of defining an AEAD algorithm.   If the main motivation for this work is
> encryption that is computationally cheap, then it makes sense to pair the
> algorithm with an authentication method with the same characteristics.

Yes -- only specifying HMAC-SHA256 was a mistake, and we have included a
HMAC-SHA1 variant in the working copy.  It is not clear to me whether
keeping HMAC-SHA256 is useful.

> For security considerations, I suggest citing the analysis of Salsa20, and
> adding a sentence or paragraph summarizing the best-known attacks.
> Something like "Salsa20 has been analyzed by X independent teams, and the
> best known attack breaks 8 of 20 rounds."

Good idea, the first paragraph of the security considerations is now:

   The security of Salsa20 is discussed in the Salsa20 security
   [SALSA20-SECURITY] paper.  The reader must consult cryptographic
   research to find out the current security status of Salsa20.  At the
   time of writing this document, there are no known significant
   security problems with Salsa20/12 or Salsa20/20.  As of early 2013,
   the best cryptanalysis breaks 8 out of 20 rounds to recover the 256-
   bit secret key in 2^251 operations, using 2^31 keystream pairs (see
   [SALSA20-ATTACK]).  For more background, see the eSTREAM report
   [ESTREAM].

/Simon