Lurker News
Hello HN,

Over the last year we've been building ente[1], a privacy-friendly, easy-to-use alternative to Google Photos. We've so far built Android[2][3], iOS[4], web[5] apps that encrypt your files and back them up in the background. You can access these across your devices, and share them with other ente users, end-to-end encrypted. You can also use our electron app[6] to maintain a local copy of your backed up files.
We've built a fault-tolerant data replication layer that replicates your data to two different storage providers in the EU. We will be providing additional replicas as an addon in the future.
We're relying on libsodium[7] for performing all cryptographic operations. Under the hood it uses XChaCha20 and XSalsa20 for encryption and Argon2 for key derivation.
We have documented our architecture[8] and open-sourced our clients[9].
We did a soft-launch on r/degoogle[10] sometime ago, and have since then ironed out issues and polished the product.
But we are far from where we want to be in terms of features (object and face detection, location clustering, image filters, ...) and user experience. We are hoping to use this post as an opportunity to collect feedback from fellow hackers.
If there's anything we can do better, please let us know, we would like to.
Best,
- Vishnu, Neeraj, Abhinav
[1]: https://ente.io
[2]: https://ente.io/apk
[3]: https://play.google.com/store/apps/details?id=io.ente.photos
[4]: https://apps.apple.com/in/app/ente-photos/id1542026904
[5]: https://web.ente.io
[6]: https://github.com/ente-io/bhari-frame/releases/latest
[7]: https://libsodium.gitbook.io
[8]: https://ente.io/architecture
[9]: https://github.com/ente-io
[10]: https://www.reddit.com/r/degoogle/comments/njatok/we_built_a...

Comments (405) 96 threads

Show all comments

Showing thread 49 of 96

DenisM1 reply#
Question: Why XChaCha20? If you used aes256 I wouldn't even give it a thought and simply move on to the next question, but now I have stop and ask what's going on and wonder if you did it right. Just seems like unnecessary friction in my decision process.
vishnumohandas1 reply#
We had started off with AES, and the performance was abysmal on low-end mobie devices and certain web browsers. XChaCha20 in comparison added negligible latency and seemed less prone to human errors.

These weren't the sole reason however. There's a lot of literature on the security aspects of XChaCha20, some of which I'll link below:
- https://soatok.blog/2020/07/12/comparison-of-symmetric-encry... (in our case your masterKey is used to sign all your fileKeys)
- https://crypto.stackexchange.com/a/34458
- https://nordpass.com/features/xchacha20-encryption/#why%20No...
- https://blog.cloudflare.com/do-the-chacha-better-mobile-perf...

nicce1 reply#
Have you correctly evaluated your threat scenarios?

ChaCha is streaming cipher, which is meant to be used on transmission phase, not on data-on-rest(DARE). That is significant difference. In this case, you are implementing Photo storage service, where data is laying mostly on your servers, and not disappearing after the transmission. What is the threat model?
In general, streaming ciphers are considered as weaker alternatives for DARE ciphers. The main risk lies on nonce. In service like this, you are using long-term key. xChaCha provides 192-bit nonce. How likely you are generating identical nonces?
Well. In this case, it might be that this streaming cipher is safe. 192-bit nonce is quite big number.
For example AES-GCM with 96-bit nonce has max message amount of 2^32 when used deterministically [1]
In theory, the AES alternative is much weaker than your current implementation.
[1]: https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=51288...

vishnumohandas3 replies#
From the literature we have read, XChaCha20 coupled with Poly1305 is safe for DARE, ChaCha20 in isolation isn't. We're employing the former.

Continue this thread — 3 replies