You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
26/WAKU2-PAYLOAD defines how message payloads can be encrypted using symmetric/asymmetric primitives. However, a protocol to allow users to safely exchange encryption cryptographic keys is missing.
This issue addresses the third item of vacp2p/research#97 by setting a rough plan for the integration of the Noise handshakes K1K1, XK1, XX, XXpsk0 into nim-waku. Their description, the assumed security model and provided security properties can be found following the above references.
Future issues will address the required changes to support encoding/decoding of Waku2 message payloads encrypted according to implemented Noise protocols' encryption/decryption rules.
Underlying Cryptographic Primitives
We plan to instantiate the K1K1, XK1, XX, XXpsk0 handshakes using the following underlying cryptographic primitives:
Curve25519 for Diffie-Hellman exchanges;
ChaChaPoly for symmetric authenticated encryption;
SHA256 as hash function.
This ultimately results in implementations for the following Noise protocols:
However, BLAKE2 family of hash functions is conjectured to offer better security guarantees (random oracle indifferentiable) and offers faster hashing times (a Nim implementation for BLAKE2 is provided in nimcrypto). Future PRs might integrate support for the BLAKE2 hash functions family (in particular, BLAKE2s) as underlying hash primitive.
Future PRs might integrate support for the Curve448 elliptic curve as well, in order to instantiate Diffie-Hellman exchanges on an higher bit-security level.
Handshake Implementation Timeline
We plan to adapt and integrate nim-libp2p's Noise_XX_25519_ChaChaPoly_SHA256implementation in nim-waku.
We then propose to implement and integrate the remaining Noise handshakes in the following order:
XXpsk0.
XK1;
K1K1;
This is motivated by the following facts:
XXpsk0 can be transformed to an XX handshake using an empty psk, thus can be tested with minor modification adapting nim-libp2p's XX implementation;
XX can be transformed to an XK1 handshake if Bob doesn't transmit to Alice his static key, thus can be tested with minor modification adapting nim-libp2p's XX implementation;
XK1can be transformed to K1K1 if Alice doesn't transmit to Bob her static key, thus can be tested with minor modification using XK1 implementation;
We note, however, that the logic used to derive the shared key material slightly differ among such handshakes.
Problem
26/WAKU2-PAYLOAD defines how message payloads can be encrypted using symmetric/asymmetric primitives. However, a protocol to allow users to safely exchange encryption cryptographic keys is missing.
Issue vacp2p/rfc#494 and this Vac forum post propose to integrate multiple Noise handshakes in Waku2 to address the current lack of key-exchange protocols.
This issue addresses the third item of vacp2p/research#97 by setting a rough plan for the integration of the Noise handshakes
K1K1
,XK1
,XX
,XXpsk0
intonim-waku
. Their description, the assumed security model and provided security properties can be found following the above references.Future issues will address the required changes to support encoding/decoding of Waku2 message payloads encrypted according to implemented Noise protocols' encryption/decryption rules.
Underlying Cryptographic Primitives
We plan to instantiate the
K1K1
,XK1
,XX
,XXpsk0
handshakes using the following underlying cryptographic primitives:Curve25519
for Diffie-Hellman exchanges;ChaChaPoly
for symmetric authenticated encryption;SHA256
as hash function.This ultimately results in implementations for the following Noise protocols:
Noise_K1K1_25519_ChaChaPoly_SHA256
;Noise_XK1_25519_ChaChaPoly_SHA256
;Noise_XX_25519_ChaChaPoly_SHA256
;Noise_XXpsk0_25519_ChaChaPoly_SHA256
,named according to Noise protocols naming conventions.
However,
BLAKE2
family of hash functions is conjectured to offer better security guarantees (random oracle indifferentiable) and offers faster hashing times (a Nim implementation forBLAKE2
is provided innimcrypto
). Future PRs might integrate support for theBLAKE2
hash functions family (in particular,BLAKE2s
) as underlying hash primitive.Future PRs might integrate support for the
Curve448
elliptic curve as well, in order to instantiate Diffie-Hellman exchanges on an higher bit-security level.Handshake Implementation Timeline
We plan to adapt and integrate
nim-libp2p
'sNoise_XX_25519_ChaChaPoly_SHA256
implementation innim-waku
.We then propose to implement and integrate the remaining Noise handshakes in the following order:
XXpsk0
.XK1
;K1K1
;This is motivated by the following facts:
XXpsk0
can be transformed to anXX
handshake using an emptypsk
, thus can be tested with minor modification adaptingnim-libp2p
'sXX
implementation;XX
can be transformed to anXK1
handshake if Bob doesn't transmit to Alice his static key, thus can be tested with minor modification adaptingnim-libp2p
'sXX
implementation;XK1
can be transformed toK1K1
if Alice doesn't transmit to Bob her static key, thus can be tested with minor modification usingXK1
implementation;We note, however, that the logic used to derive the shared key material slightly differ among such handshakes.
Context
Specifications:
Implementations:
Acceptance Criteria
nim-libp2p
's Noise processing rules andXX
handshake implementations;XXpsk0
handshake;XK1
handhshake;K1K1
handhshake;BLAKE2b
andBLAKE2s
hash functions.Curve448
for elliptic curve Diffie-Hellman exchanges.@oskarth @staheri14 @jm-clius @kaiserd @D4nte @cammellos
The text was updated successfully, but these errors were encountered: