The aim is to encrypt the WebRTC signaling data using public-key authenticated encryption. The inital key material is transferred from one party to the other out-of-band. Based on that the remaining required key material is securely delivered in-band using public-key signatures.
- "A" can be read as "self", "B" as "the other party".
- Key pairs used:
- Key pairs for public-key signatures (
signPubKey
,signPrivKey
). - Key pairs for public-key authenticated encryption (
pubKey
,privKey
).
- Key pairs for public-key signatures (
All parties use their pubKey
as UUID
when connected to signalhub
.
- A sends an out-of-band invitation to B containing:
pubKey(A)
,signPrivKey(AB)
. - B now recognizes
UUID(A)
in/all
because of the invitation from A. - B sends crypto ratchet data to
/A
namelysignPubKey(AB)
andpubKey(B)
signed usingsignPrivKey(AB)
. - A verifies and accepts
pubKey(B)
usingsignPubKey(AB)
. - A now sends encrypted/signed packages to
/B
usingpubKey(B)
andprivKey(A)
. - B receives encrypted/signed packages from A and knows that the crypto ratchet is complete.
Create a new signing key pair (signPubKey(AB)
, signPrivKey(AB)
). Use both the preexisting pubKey(A)
and the signPrivKey(AB)
to create a URI of the form: peermusic://host:port/#pubKey(A):signPrivKey(AB)
.
wrap
and unwrap
are methods that are invoced in a modified version of webrtc-swarm
and always take in the data and the destination address of the package as arguments.
-
/all
- No encryption - plain text.
-
/B
- Key Exchange and Encryption (see step 3 under Ratcheting Flow)
Holds an open invitation and thus knows that B still needspubKey(A)
.
HaspubKey(B)
andsignPrivKey(AB)
available from the invitation.- Sends
pubKey(A)
and the signature generated by usingsignPrivKey(AB)
. - Attaches
signPubKey(AB)
. - Encrypts/signs WebRTC signaling data using
pubKey(B)
andprivKey(A)
.
- Sends
- Just Encryption
Holds no open invitation regarding B.- Encrypts/signs using
pubKey(B)
andprivKey(A)
.
- Encrypts/signs using
- Key Exchange and Encryption (see step 3 under Ratcheting Flow)
-
/all
- Whitelist
RecognizesUUID(B)
.
- Whitelist
-
/A
- Key Exchange and Encryption (see step 4 under Ratcheting Flow)
Does not recognizeUUID(B)
.
Recognizes the attachedsignPubKey(AB)
since there is an open invitation.- Verifies signature of attached
pubKey(B)
usingsignPubKey(AB)
.- Marks the invitation as complete.
- Decrypts/verifies WebRTC signaling data using
privKey(A)
andpubKey(B)
.
- Verifies signature of attached
- Just Encryption
RecognizesUUID(B)
.- If there is an open invite regarding B it will be marked complete.
- Decrypts/verifies using
privKey(A)
andpubKey(B)
.
- Key Exchange and Encryption (see step 4 under Ratcheting Flow)