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

Distributing DistributionMessage #73

Open
Swepilot opened this issue Jun 20, 2023 · 2 comments
Open

Distributing DistributionMessage #73

Swepilot opened this issue Jun 20, 2023 · 2 comments

Comments

@Swepilot
Copy link

Hi!

I've been studying this package, examples and reading other issues for a few days now. What I fail to get my head around is how to distribute the DistributionMessage to other members in a group chat. Examples run fine but then all members (Alice, Bob & Dean) all are in the same function with direct access to all variables.

Currently I have written a small test program that stores the chat messages (cipher text) in a Firestore database. It works fine to "chat" between two different devices, but only because I am storing the DistributionMessage along with the cipherText. This is obviously not how it should be done. Should the DistriubutionMessage be sent to all members using the normal 1-to-1 session or some other mechanism?

Furthermore, should I every time I send a message go through every member of the group and .process their DistributionMessage before encrypting the message to be sent? Is this how one achieve the behaviour that new members cannot see old messages, because their distribution message was not included when the message was encrypted?

for each member in chat {
   await bobGroupSessionBuilder.process(
      member[GroupSender], member[DistributionMessage]);
}

Thankful for any guidance!

/Nik

@Tougee
Copy link
Member

Tougee commented Jun 24, 2023

  • you need a server to distribute messages, not sure Firestore can do this well
  • every member should exchange their DistributionMessages, useGroupCipher
  • you only need to send and process DistributionMessage the first time you join in chat (all members should refresh their keys if someone exits chat for forward secrecy)

Is this how one achieve the behaviour that new members cannot see old messages, because their distribution message was not included when the message was encrypted?

  • yes

@anisalibegic
Copy link

@Tougee You said:

you only need to send and process DistributionMessage the first time you join in chat (all members should refresh their keys if someone exits chat for forward secrecy)

After a group is created, each user needs to go and click on a chat if he wants to decrypt upcoming messages. In Signal app I can create a group and immediately send few messages and every member will receive those messages even though he never clicked on a chat to send those keys. So, the question is how to encrypt a message with each member key if member is offline or did not joined a chat after I added him?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants