From 116e8860423ddc1e3961a5aec20829d7cf848116 Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Thu, 9 Feb 2023 10:34:55 +0100 Subject: [PATCH 1/4] Init should also be encrypted to self --- group/init/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group/init/README.md b/group/init/README.md index 2259610..62db0a6 100644 --- a/group/init/README.md +++ b/group/init/README.md @@ -27,7 +27,7 @@ because the definition of `group_id` depends on the key of this message, which w be known until this is published. This means this initial message and it's content will need to be **manually boxed**, -with the only `recipient_key` being the symmetric `group_key` for this new group. +with the `recipient_key`s being the symmetric `group_key` for this new group as well as to yourself, for recovery purposes. Do not be tempted to overload this initialisation message. Adding people to the group would interfere with the [`add-member` spec](../add-member/README.md) From 0f312dcfa5a4e86806c9b641ce8045ed9db93a75 Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Fri, 17 Feb 2023 14:43:13 +0100 Subject: [PATCH 2/4] Ignore pnpm lock --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 15813be..7e4cd7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ package-lock.json +pnpm-lock.yaml node_modules/ From e58d4e090a22b4c1a9e5c97226761be7b17ccad0 Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Fri, 17 Feb 2023 14:46:14 +0100 Subject: [PATCH 3/4] Refer to own_key --- group/init/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/group/init/README.md b/group/init/README.md index ee05d44..34cb1af 100644 --- a/group/init/README.md +++ b/group/init/README.md @@ -27,7 +27,7 @@ because the definition of `group_id` depends on the key of this message, which w be known until this is published. This means this initial message and it's content will need to be **manually boxed**, -with the `recipient_key`s being the symmetric `group_key` for this new group as well as to yourself, for recovery purposes. +with the `recipient_key`s being the symmetric `group_key` for this new group as well as to your `own_key`, for recovery purposes. Do not be tempted to overload this initialisation message. Adding people to the group would interfere with the [`add-member` spec](../add-member/README.md) @@ -42,8 +42,9 @@ var prevMsgId = 'ssb:message/classic/Zz-Inkte70Qz1UVKUHIhOgo16Oj_n37PfgmIzLDBgZw var feed_id = ... BFE binary encoding of feed_id var prev_msg_id = ... BFE binary encoding of feed_id -var group_key = ... symetric key as buffer -vat msg_key = ... make up a one use key for the msg +var group_key = ... symmetric key as buffer +var own_key = ... symmetric key as buffer +var msg_key = ... make up a one use key for the msg // here's the unencrypted init message var plainText = { @@ -58,7 +59,7 @@ var plainText = { var plain_text = .... stringify + buffer -var ciphertext = envelope(plain_text, feed_id, prev_msg_id, msg_key, [ group_key ]) +var ciphertext = envelope(plain_text, feed_id, prev_msg_id, msg_key, [ group_key, own_key ]) ciphertext ---> string + .box2 ``` From 8966beec2274413abe0a621b0c70fe6a450e7ded Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Wed, 1 Mar 2023 11:43:51 +0100 Subject: [PATCH 4/4] Clarify key formats in init --- group/init/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/group/init/README.md b/group/init/README.md index 34cb1af..5d1add3 100644 --- a/group/init/README.md +++ b/group/init/README.md @@ -42,9 +42,15 @@ var prevMsgId = 'ssb:message/classic/Zz-Inkte70Qz1UVKUHIhOgo16Oj_n37PfgmIzLDBgZw var feed_id = ... BFE binary encoding of feed_id var prev_msg_id = ... BFE binary encoding of feed_id -var group_key = ... symmetric key as buffer -var own_key = ... symmetric key as buffer -var msg_key = ... make up a one use key for the msg +var group_key = { + key: group_buffer, // group_buffer is symmetric key as buffer + scheme: 'envelope-large-symmetric-group' +} +var own_key = { + key: own_buffer, // own_buffer is a symmetric key as a buffer + scheme: 'envelope-symmetric-key-for-self' +} +var msg_key = ... make up a one use key for the msg as a buffer // here's the unencrypted init message var plainText = {