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

Add simple helper functions for encrypting & decrypting content #49

Open
3 tasks
cinnamon-bun opened this issue Aug 21, 2020 · 3 comments
Open
3 tasks

Comments

@cinnamon-bun
Copy link
Member

cinnamon-bun commented Aug 21, 2020

This issue is duplicated by #10

What's the problem you want solved?

Users have public keys, let's send them some private messages! Or eventually, encrypt messages to the workspace public key so only people with the workspace private key can read it (e.g. the members of the invite-only workspace).

Complicated solution

#11 Fully wrapped encrypted documents

Easy solution

Just encrypt the content and nothing else. The path and author will be exposed.

The recipient could be specified in the path so they know where to look for messages, or we could make recipients scan through everything looking for documents they can decrypt.

The encryption can probably be done with some function in Chloride. For multi-recipient messages we can use private-box

Potential crypto modules we can use:

Todo

  • Research how to do basic message encryption with Chloride
  • Write a helper function in crypto.ts
  • Think about how this affects IStores -- will they try to decrypt stuff for you? How do they know what to try? Should an IStore become responsible for one specific author's decrypted view of the data, or stay neutral? Maybe this is an app-level concern?
@cinnamon-bun cinnamon-bun added this to the bananaslug milestone Aug 21, 2020
@cinnamon-bun cinnamon-bun changed the title Add simple helpers for encrypting messages Add simple helper function for encrypting & decrypting strings Aug 21, 2020
@cinnamon-bun cinnamon-bun changed the title Add simple helper function for encrypting & decrypting strings Add simple helper function for encrypting & decrypting content Aug 21, 2020
@cinnamon-bun cinnamon-bun changed the title Add simple helper function for encrypting & decrypting content Add simple helper functions for encrypting & decrypting content Aug 21, 2020
@jb33k
Copy link

jb33k commented Sep 8, 2020

How close are you at implementing this? I'm mainly wondering whether I should do a userland e2e or wait for native support.

@cinnamon-bun
Copy link
Member Author

@jb33k

I won't get to this in the next couple of weeks at least. This is really just a matter of finding the right functions from chloride and exporting them so people in userland can easily encrypt their document's content field by hand. It won't be something deeply integrated (...yet, that's #11 which will be Later).

If you do it yourself and want to share your code, that would be helpful!

@jb33k
Copy link

jb33k commented Sep 9, 2020

@cinnamon-bun

I use Sodium directly for crypto, so unfortunately I have no experience with chloride. Personally I'm planning to go with ChaCha20-Poly1305 for AEAD. Btw, when you get around to implement the encryption, you should plan to implement streaming with WASM because otherwise performance will be unbearable for anything more than small text files, especially with mobile. But the issue I've run into is that there is no ChaCha20-Poly1305 WASM implementation that I have found that supports streaming out-of-the-box.

sgwilym pushed a commit that referenced this issue Feb 16, 2022
@sgwilym sgwilym removed this from the Bananaslug milestone May 27, 2022
@sgwilym sgwilym removed the good first issue Good for newcomers label Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants