dominictarr / scuttlebutt

peer-to-peer replicatable data structure
Other
1.32k stars 66 forks source link

Encrypted message to all friends #52

Open qbolec opened 5 years ago

qbolec commented 5 years ago

Hi! I'm new to Scuttlebutt and fascinated by the idea. I wonder how it can solve my concern: I like to post content to "all of my friends" because it's hard for me to guess who might be interested in what I share upfront, so I don't want to tideously create a whitelist. At the same time, I wouldn't like the intermediate nodes (say, evil spying profiling company running a pub) to see the plaintext. I've read this protocol description https://ssbc.github.io/scuttlebutt-protocol-guide/ and I guess that what I'd like to achieve can be done with it by:

  1. Me spending some time within my client to define something like google+ circles: set of people, like "family" or "boardgame geeks" or "all my followers" or "all my friends"
  2. Add 49*NumberOfRecipients bytes with decryption keys to each of my messages.

This is a nice MVP but has some problems:

  1. If I have 300 friends, this can mean kilobytes of keys per message (also the length of tgis header becomes a side channel to guess how many recipients, so how, private it is, and using same circle will produce same length, so one can corellate..)
  2. If I gain a new friend in future which I consider part of a circle they will not see my past messages directed to that circle

How about this improvement:

  1. Define a pair of keys for each circle
  2. Encrypt message with private key for that circle
  3. Distribute the public key for a circle to the circle members

I'm not good at crypto, so perhaps there should be some additional salting, nonces, etc. This is just a sketch.

Once again, I'm completely new, so sorry if it is already done, discussed or if this is bad place to talk about. I was searching and couldn't find anything about it, so please point me to relevant place if I missed it. The closest thing I found were groups, but I guess that they represent cliques in the graph (all parties of group agree that they consider them all part of that group), while circles despite their name, are rather assymetric as members do not have to know in what circle they are from my perspective and don't have to consider me a part of circle of same name etc.