How to have End to End Encryption in Flutter chat app?

7.8k views Asked by At

I have made a chatting app using flutter and my own server as a backend for the database.
I want to add end to end encryption, similar to other chat apps like WhatsApp, but I am not having complete knowledge about it.
So What I wanna ask is :

  1. Work for an end to end encryption has to be done on client-side or at the backend?
  2. How can this be achieved
  3. is there any third-party provider for such thing, compatible with flutter
  4. And How one can even do it own there own without 3rd party Provider?
2

There are 2 answers

0
Itamar Garcia On
  1. Works on both. end to end encryption(E2EE) means that the sender and receiver can only know the real content of the message. It does not matter if the message is stored on a server or on the user's device.

  2. You can create your own algorithm of E2EE or use other library available, here a example: https://medium.com/@mr.jyotirmoy.paul/building-an-private-room-chat-application-using-flutter-d11306a0623c

  3. Yes there several packages availables, example: https://github.com/cardoso/virgil-e3kit-flutter

  4. You need to read about cryptography and create your own algorithms

0
Ali Yar Khan On

There is a package available at this link: Encrypt

It allows you to encrypt text using four encryption algorithms

  1. AES
  2. RSA
  3. Salsa20
  4. Fernet