@h3artbl33d @vmovupd @stefano From mid-2010, given community experience and less...
Mikalai @mikalai@discuss.systems
@h3artbl33d @vmovupd @stefano
From mid-2010, given community experience and lessons, encryption is straightforward. So, let's outline this chapter for docs, linking to existing words about nuances around crypto, cause one doesn't rollout their own 😉
Aligned with 3N matra, servers/providers have no say in what e2ee crypto is used.
Where is it used?
First place is for user to have storage, encrypted and synced for use by user's devices.
This is a secret key cryptography. Implementation chooses what to use.
Our choice is driven by cryptographers' rant about decade of news about "broken crypto" where developers were making mistakes in putting crypto primitives together. Hence, we use NaCl, xsalsa+poly, or libsodium, implementations abound. More so, when we were porting platform on devices, we had NaCl in JS, in Rust in WASM, same process, different process, Rust native, and even android now has for secret box Kotlin implementation.
https://github.com/PrivacySafe/xsp-files#xsp-file-format is XSP format, it is nuances "near crypto", how do we pack lots of bytes, satisfying the laundry list of wishes that allow efficiency, yet, there is no nonce reuse that leads to cryptanalysis.
XSP packs lots of bytes into blobs.
Mapping your file system objects onto storage happens to be a separate question, and layout allows internal changes that look differently to an observer of how encrypted blobs change (server).
Your implementation of platform can do something more fun, ... and no one around would know.
The other file system nuance is that we do keys cascade. Object that is folder, can decrypt objects of its immediate children. This is needed for sharing of fs subtrees (folders) without giving away keys to not shared parts.
The second place for crypto use is in sending messages. This needs public key cryptography. Each key comes with what overall process it should be used.
Naturally, our current implementation uses NaCl's public box's curve code. Each message is encrypted with unique random secret key. So, public crypto only encrypts that master key. While message is a cascade of objects carrying attachments file system, where needed. So, there is a heavy reuse of code between storage and messages packing.
The third place is in usage of platform. What happens when user starts platform?
We stand that master key to root of user's storage should be given by signin process.
Current implementation uses scrypt as a memory-heavy process to get from user password to root master key.
You may choose to make startup that gets this key material from yubi key, whatever. These characteristics that can be user-fitted, without touching anything else.
The forth place for crypto is in a solution (not the solution) of the first contact problem. User gets a message with public key, how do you trust it?
There was a BrowserId non-tracking protocol created by Mozilla. One of the stages was using browser. This part was shown to be broken, allowed identity provider to leave something to note/track where user used identity.
We have removed browser part and left only crypto process. It is MailerId protocol.
Servers use it for users to login, the original raison d'etre of the original protocol. It is a process of signing assertions to prove to server. But, we can and use the signing and checking process in the initial contact situation. Except user device is a checker of signatures, not some server.
Some docs are https://github.com/PrivacySafe/3NWeb-architecture/blob/main/protocols/mailerid/README.md
Right, docs about keys rotation is in my repo, and isn't echoed in public repo.
Trust me that after reading an old rfc with simple suggestion - give to peer your next new public key, we have implemented this simple key rotation in communication between peers.
Key rotation/ratcheting is simple.
Signal has historic roots with sms phones. They had no synced e2ee storage to lean on. Hence, those industry standards carry some unnecessary calcification, and let server know too much about user communications, user devices.
This is further than PoC 👀.
Just install, try, use, and there is a space to make fun stuff.