[saag] PQC in ZRTP (RFC6189)

Johan Pascal <johan.pascal@linphone.org> Tue, 23 November 2021 22:50 UTC

Return-Path: <johan.pascal@linphone.org>
X-Original-To: saag@ietfa.amsl.com
Delivered-To: saag@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BA8443A08C4; Tue, 23 Nov 2021 14:50:35 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level:
X-Spam-Status: No, score=-1.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=linphone.org
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 4WpKHI7oadlO; Tue, 23 Nov 2021 14:50:31 -0800 (PST)
Received: from smtp.belledonne-communications.com (smtp.belledonne-communications.com [IPv6:2001:41d0:1:fec2::]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DFC413A08C2; Tue, 23 Nov 2021 14:50:30 -0800 (PST)
Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.belledonne-communications.com (Postfix) with ESMTP id 7106CC00DFD; Tue, 23 Nov 2021 23:50:27 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.belledonne-communications.com 7106CC00DFD
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linphone.org; s=default; t=1637707827; bh=RqPYPEMNUkC2P2tyaKdr+66qEmHjDHJgGPLI5Nop1DI=; h=Date:To:From:Subject:From; b=sEXq5nLeUgPZJqiDoO5Op4BoAo07pC5NluQ5dn/MLnzPECzB0ijttSYxclU1Xf8Qh ovu06UHfjjrAdUu/DrqOfqtyznRrAM2trPPb3kxkfKF+tOLdYu8IiCP+eRNkW3UZdI F+jCK0HVXOc6GKFXnqEvncyVurSdKbdPC294r0WwFJ+OEWPCMRfFx2VLhaRXIdvmnq 1pYdvwCvaTUWVfoAiuPk4l76JarnuL0m/VsCj601VyuKIDZ9ukKHGvDjcyn+ZaWsK4 BU2ZOtAUiZRXwakQjmhIGhmDAhyU6+UUX7r6pDXacmIhX0em+yr/djqUQRAE8+nsjd hhaLH7aChdQzg==
X-Virus-Scanned: amavisd-new at belledonne-communications.com
Received: from smtp.belledonne-communications.com ([127.0.0.1]) by localhost (smtp.belledonne-communications.com [127.0.0.1]) (amavisd-new, port 10026) with LMTP id eGNSn9J2vszy; Tue, 23 Nov 2021 23:50:27 +0100 (CET)
Received: from [192.168.1.100] (unknown [80.215.117.89]) by smtp.belledonne-communications.com (Postfix) with ESMTPSA id 105D3C00A27; Tue, 23 Nov 2021 23:50:27 +0100 (CET)
Message-ID: <b8909eef-eb6f-714b-92d8-c28ad686a31d@linphone.org>
Date: Tue, 23 Nov 2021 23:50:26 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2
Content-Language: en-US
To: IETF SAAG <saag@ietf.org>, avt@ietf.org
From: Johan Pascal <johan.pascal@linphone.org>
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/saag/7IOfzFwltRB7U3h5KRaZF2t35L8>
Subject: [saag] PQC in ZRTP (RFC6189)
X-BeenThere: saag@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Security Area Advisory Group <saag.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/saag>, <mailto:saag-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/saag/>
List-Post: <mailto:saag@ietf.org>
List-Help: <mailto:saag-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/saag>, <mailto:saag-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 23 Nov 2021 22:50:36 -0000

Dear Saag and AvtCore,

as already discussed on Saag (https://mailarchive.ietf.org/arch/msg/saag/HjxX-4QcqbgO6pshPsPozbhxTV0/" rel="nofollow">https://mailarchive.ietf.org/arch/msg/saag/HjxX-4QcqbgO6pshPsPozbhxTV0/) I'm working on introducing PQC in ZRTP. On Colin Perkins' advice, I post this also on avtcore. I'm not yet ready to publish an I-D, but eager to get external eyes on the solution I figured to solve the problem of substituting DH with PQC-KEM in ZRTP.

For those not familiar with ZRTP, it's a key exchange protocol with authentication over a voice channel using a Short-Authentication-String(SAS). Stripping it to the very core of the key exchange it basically does:

Alice and Bob generates DH key pairs (Pka, Ska) and (PKb, Skb).

1) Bob sends a Commit packet holding hash(Pkb)

2) Alice sends DH1 packet holding Pka

3) Bob sends DH2 packet holding PKb

They both compute a shared secret DHab using the peer's public key and their secret one. They then derive s0 from DHab and a transcript of the exchange. From this, a 20bits hash is generated and turned into a human readable string(the SAS) to be compared over a voice channel.

Bob sending hash(Pkb) prevent an attacker to put himself in a position of choosing the final SAS(by generating his key pair leading to the desired SAS) trying to find a collision (on 20 bits it is not difficult) starting from two different Pka.

Whole details in the RFC: https://datatracker.ietf.org/doc/html/rfc6189" rel="nofollow">https://datatracker.ietf.org/doc/html/rfc6189


In order to introduce PQC to this scheme, it must be adapted to KEM interface:

Pk,Sk = KEM_keyGen()

Ct,Secret = KEM_encaps(Pk)

Secret = KEM_decaps(Ct, Sk)

This cannot be used directly in the current ZRTP scheme: if Alice sends her Pk in DH1 packet, Bob can't commit to Ct before receiving it.


Two solutions to solve this problem :


A - Both parties encapsulate a secret.

Alice and Bob both generate a key pair (Pka,Ska) and (Pkb,Skb)

1) Bob sends Pkb

2) Alice generates Cta,Secreta = KEM_encaps(Pkb) then sends Pka and hash(Cta)

3) Bob generates Ctb,Secretb = KEM_encaps(Pka) then sends Ctb

4) Alice sends Cta

They both derive s0 using Secreta, Secretb and a transcript of the exchange

In this version there is one additional packet, Alice sending hash(Cta) plays the role of hash(Pkb) from the original ZRTP.


B - Only Alice encapsulates a secret

1) Bob generates Pkb,Skb and a random nonce then sends Pkb and hash(nonce) to Alice

2) Alice generate Ct, Secret = KEM_encaps(Pkb) then sends Ct to Bob

3) Bob sends the nonce

They both derive s0 using Secret, nonce and a transcript of the exchange. No extra packets, the exchange is still safe against simple wiretapping thanks to the KEM and no parties gets to choose the SAS after getting the other party material involved in its generation: Alice doesn't have the nonce when she generates Ct and Secret, Bob commits to use the nonce before receiving Ct.


The second solution seems simpler and have my preference. Anyone read this long email until here and have comments on these schemes?

Note: Hybrid key exchange would be addressed inside the KEM itself performing both a PQC-KEM and a DH-based KEM.

Thanks

Johan