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

Rich text E2EE with sync #452

Open
steida opened this issue Dec 13, 2021 · 7 comments
Open

Rich text E2EE with sync #452

steida opened this issue Dec 13, 2021 · 7 comments

Comments

@steida
Copy link

steida commented Dec 13, 2021

If I understand it correctly, it's chicken-egg problem. We can't put encrypted text to Automerge, and we can't encrypt whole Automerge doc because then we can't do an incremental sync.

What is the current approach to E2EE CRDT? Thank you.

@steida
Copy link
Author

steida commented Dec 13, 2021

And a related question, Because modern cryptography uses byte arrays instead of strings, it would be useful if Automerge could store byte arrays directly.

@pvh
Copy link
Member

pvh commented Dec 13, 2021

Like git, the sync protocol requires understanding the structure of the document, but relay and storage servers don't need to have access to the data. If you want end-to-end encryption, ensure all messages sent over the wire are encrypted and decrypt them on the recieving client.

Also, it's not clear to me why you think you can't store encrypted text in Automerge. Automerge is pretty agnostic about what you keep in it. If your text is encrypted you'll need to store it as a blob value -- you can't insert into the middle of an encypted string -- but I've certainly done this.

Last, I note in your title that you want to sync "rich text". Automerge doesn't currently support rich text natively. Our recent Peritext research prototype explored how to do so, but it has not yet been shipped in production. I don't have an ETA for that, but it's something we'd like to do.

@steida
Copy link
Author

steida commented Dec 13, 2021

it's not clear to me why you think you can't store encrypted text in Automerge

By text (rich text) I mean Automerge.Text CRDT type.

doc.text.insertAt(0, here can not be encrypted text)

@pvh
Copy link
Member

pvh commented Dec 13, 2021

It wouldn't really be meaningful to insert pre-encrypted text into an Automerge.Text field. The value of using the Text type is that it can merge insertions and so on, if you have encrypted the text already this is not useful. Inserting other text in the middle of a range or modifying bits would break the cypher.

I'd suggest Automerge's relationship to encryption is similar to other data structures (though I realize Automerge is uncommonly featureful). If you'd like to encrypt an Automerge document, encrypt it when you save it or do incremental synchronization over an encrypted channel.

This is what we did in the backchannel paper. All data is transferred via an untrusted mailbox & relay server which has no knowledge of who is using it or what they're sharing.

@steida
Copy link
Author

steida commented Dec 13, 2021

That's what I wrote "here can NOT be encrypted text"

@steida
Copy link
Author

steida commented Dec 13, 2021

encrypt it when you save it

I wrote we can't encrypt it without sacrificing incremental syncing because I was curious whether I am not missed something.

incremental synchronization over an encrypted channel.

What does it mean "encrypted channel"? How we can do incremental synchronization E2EE? That's was my question.

@pvh
Copy link
Member

pvh commented Dec 13, 2021 via email

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

2 participants