Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init should also be encrypted to self #24

Merged
merged 5 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
package-lock.json
pnpm-lock.yaml
node_modules/
15 changes: 11 additions & 4 deletions group/init/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 your `own_key`, for recovery purposes.
mixmix marked this conversation as resolved.
Show resolved Hide resolved

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)
Expand All @@ -42,8 +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 = ... symetric key as buffer
vat 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 = {
Expand All @@ -58,7 +65,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
```