Before being able to speak with the other person, the two phones must establish their connection. A signaling server facilitates this by exchanging technical information—such as IP addresses, connection identifiers, and the fingerprint of the certificate used to secure the call. In the WebRTC protocol, this data collectively forms the Session Description Protocol (SDP). While the connection to the server is encrypted via TLS, this encryption ends at the server itself—meaning the server can see everything.
The risk?
A compromised signaling server could read this information and rewrite it on the fly. By replacing the certificate fingerprint with its own, the server could insert itself between the two parties, establish two separate connections, and then read or modify their communications. It could also gain access to the private network addresses of both devices. This is known as a “man-in-the-middle” (MitM) attack.
twinme locks this door before it can even be opened.
The SDP is encrypted directly on the sender’s phone (using AES-256-GCM) before transmission. The server is now only relaying an opaque block of data. Any modification is detected by the recipient, who will reject the altered data. Furthermore, the session description is bound to a specific session, preventing it from being “replayed” in another.
To encrypt the communication, both devices use a secret key known only to them. Each device generates a random key when a contact is created and sends it to the other party via an encrypted invitation. Consequently, there is a unique key for every relationship and every direction of communication. Since these keys never pass through the server in plaintext, the server has no visibility into them whatsoever. Every 30 days, it is renewed via a channel that is already encrypted between the two devices. For any two contacts who possess these keys, encryption is mandatory: a server cannot bypass it by sending a description in plaintext, as such an attempt would be rejected.
Even if the server were compromised, it could neither read these SDP (Session Description Protocol) messages nor modify them without being detected.
This mechanism currently protects more than 500,000 audio and video calls every day.
With twinme, communication protection doesn’t begin when you speak. It starts as soon as your devices attempt to connect.
For readers who wish to delve deeper into the cryptographic mechanisms and architectural choices, Stéphane Carrez, CTO of twinme, explains how they work in his original technical article.
He will also be giving a presentation on the subject at the Open Source Experience 2026 trade show.