Skip to content
Discussion options

You must be logged in to vote

You can implement end-to-end encryption (E2EE) in a Flutter + Firebase chat app by encrypting messages on the client before sending them to Firestore/Realtime DB and decrypting only on the recipient’s device.

A common approach:
Use a key exchange protocol (e.g., Diffie-Hellman) to generate shared keys between users.
Encrypt/decrypt messages with AES (for speed) and RSA/ECC (for key exchange).
Store only encrypted data in Firebase; Firebase should never see plaintext messages.

Libraries like encrypt
in Dart can handle AES/RSA.

This ensures Firebase acts as a transport/storage layer only, while message privacy stays intact.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Ziauddin-developer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Mobile
Labels
Mobile Triage your notifications and browse code on the go with the GitHub Mobile app Question Ask and answer questions about GitHub features and usage
2 participants