-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add a share key to conceal read keys from a follower #38
Comments
^ Updated thinking in the issue description ... thoughts welcome! |
First question is check if I'm on the same page on what the code currently does when
Where I feel I'm missing something. Since this is direct-talking with other peers, aren't channels assumed to be secure? Why do you need a shared key? (or maybe this is for external invites?). |
Yep, same page. The channels are secure but the crux here is ensuring that a follower can serve a thread (and all its logs and keys, including read keys) to new consumers without knowing the read key. So, given a thread address like,
Where the host is a follower, how can I get a hold of the read keys? The proposal above is to back-channel a key that was used to encrypt the log read keys in the address. Something like,
Multiaddresses don't have query params like that but something to that effect. The client would parse out the key and NOT send it to the follower. It just uses it to decrypt the read keys on receipt. |
Oh, that's more clear now. Some thoughts/questions/claims to check:
|
Yep. For example, in an email, text, slack, other thread, etc. This is analogous to sharing a link to a google doc: "anyone with the link can read and write".
Yep.
I was thinking that the key could be passed around and used if it's present, such that I could serve an address to your follower:
The key could be tied to the follower so that each follower has their own, but then a third peer that was already in the thread would not be able to pick up new logs from a follower since it wouldn't have the key used to encrypt its logs. Tricky to visualize without drawing it out. Ideally, all followers would host logs encrypted with the same key. |
Definitely sounds good that key can be shared as you mention. But even if that's the intention, I think it can't be avoided that some two peers generate new key unintentionally. What I'm imagining this could happen:
To be clear, I think is optimal to re-use key if one is known. But I think this multiple keys situation can't be avoided, and not really clear about how to handle it... since readers should have a way to realize if the key they're assuming to be true for decryption is the correct one. (I can imagine solutions, but that'd add some extra metadata (e.g: hash of the key or something similar)). |
The key could be created when the thread is created, and then always shared with the address when adding new peers. In a sense, this would be like using a keypair for the thread (like the logs), where peers all have the private key and followers only have the public key except we have the benefit of better encryption and shorter keys (no need for signing). |
Ah, I was thinking that the This means that it exists a shared key for all log writers. Maybe stupid question: if non-follower roles should have read-access to all the thread logs, and now non-follower roles have a shared key: why this key isn't the actual read key of all logs? (and lower key management complexity?) |
Right, I was thinking above that the key would be created dynamically, but then you got me thinking. As for the single read key, that's a good question. Couple thoughts:
|
Maybe the safe bet is to keep them separate (key and read key) to avoid handcuffs and leave it flexible.
Now that you mention that. In that case the key should also be changed? (to avoid blocked peer to decrypt again the rotated key) Or can we assume all followers know that that peer was blocked to ignore requests? |
As per much Slack chatting, closing this in favor of just using the same read and follow keys for all logs. |
AddFollower
should work like,Now, on the client,
The text was updated successfully, but these errors were encountered: