223 points by msgsec 6 months ago flag hide 21 comments
messaging_app_dev 6 months ago next
Excited to share my experience building an encrypted messaging app with offline capabilities! I wanted to create an app that respected user privacy and gave them the ability to communicate securely even without a constant internet connection.
privacy_stack 6 months ago next
Awesome! I think there's a growing need and interest in apps offering offline functionality and respecting privacy. Can you tell us more about the encryption techniques you used to secure messages?
cryptography_fan 6 months ago prev next
Interesting! Do you leverage any existing libraries or completely rolled out your implementation of the Signal Protocol?
messaging_app_dev 6 months ago prev next
Sure! I used the Signal Protocol, which implements double ratchet algorithm and provides end-to-end encryption. I also implemented perfect forward secrecy, so that even if the keys get compromised, past conversations remain secure.
messaging_app_dev 6 months ago next
I used the Signal Protocol java implementation called libsignal-client as a foundation, which made it a lot easier to incorporate it into my existing Java-based app.
joe_random 6 months ago prev next
But what about offline communication? How does your app handle messages between users with no active internet connection?
messaging_app_dev 6 months ago next
I implemented a local storage and synchronization system that stores messages when the recipient is offline. Once the recipient comes online, messages are synced and sent with end-to-end encryption. The system is highly efficient and respects user privacy.
hacking_on_mobile 6 months ago prev next
Offline functionality is really unique in encrypted messaging apps. Did you struggle with any challenges for designing this aspect of your app?
messaging_app_dev 6 months ago next
Creating a robust and efficient system for offline messaging and synchronization was indeed challenging. One of the main difficulties was dealing with the highly dynamic nature of a peer-to-peer network, caused by users' intermittent connections and various network conditions. But I solved the challenges using careful design, thorough testing, and continuous improvement.
another_user 6 months ago prev next
How does your application ensure that messages are really coming from your app and not a phishing website or something similar? I imagine this might be a concern for users.
messaging_app_dev 6 months ago next
A fair question! My app has several mechanisms to verify its authenticity, like using strong SSL certificate pinning and displaying a security code to confirm the server's identity. Users can check that the code matches the one displayed on the app's website, ensuring their connection is secure.
security_research 6 months ago prev next
This idea sounds interesting. What's the scalability of your solution, given that message synchronization will require a lot of data to be transmitted when going back online?
messaging_app_dev 6 months ago next
For scalability, I optimized message synchronization by using delta encoding algorithms that transmit small diff chunks. I also optimized the data format and used efficient message serialization formats to reduce data overhead.
serialization_enthusiast 6 months ago prev next
Which serialization format did you use? I'm always curious about performance comparisons and gotchas when dealing with offline-first apps.
messaging_app_dev 6 months ago next
I used Protocol Buffers for serialization. It has a reasonable balance between compact data format, nice language support, and ease of use. I generated code stubs for major platforms using the protoc compiler to make things efficient.
decentralized_web 6 months ago prev next
Is there any consideration of creating a fully decentralized network? It could increase privacy and scalability.
messaging_app_dev 6 months ago next
That's an intriguing thought. I can see the benefits, but for now, I'll stick to the more centralized approach as I'm confident that I can provide a secure solution that scales well with the needs of my users.
programmer_jim 6 months ago prev next
Very insightful post. I'm curious about what platform(s) it's available on. iOS-only? Android-only? Cross-platform?
messaging_app_dev 6 months ago next
I launched the app on both Android and iOS. I believe in providing quality service to as many users as possible, so developing a cross-platform app was certainly a better fit for my vision.
common_lisp_programmer 6 months ago prev next
The project is truly inspiring. I'd love to see the code, learn about your design and give something back to the project. Could you provide information on where to find your codebase or documentation?
messaging_app_dev 6 months ago next
Thank you for your interest. The code and design documentation are available on GitHub. Feel free to fork, contribute, or even chat about the project directly on the platform.