Short answer: end-to-end encryption (E2EE) means only the two people chatting can read the messages, not even your server. Each device creates a key pair, they exchange public keys, each side computes the same shared secret with ECDH, derives an encryption key from it, and encrypts every message with an authenticated cipher such as AES-GCM. The server only ever sees ciphertext.
This article explains each step in plain language and shows the Kotlin code using only standard Android APIs.
I'm Padmakar Garg, a Senior Android Developer. I work on secure messaging, encrypted calling and Android security. The code below is for understanding how E2EE works.…