For End-to-End Encryption in chats using Diffie-Hellman Algo the concept of Extended Triple Diffie-Hellman (X3DH) is used to prevent Man-in-the-middle attack (MITM) (courtesy: https://www.qed42.com/blog/developing-real-time-secure-chat-application-like-whatsapp-or-signal-with-end-end-encryption#endtoendencryption)

My question is, if the invite & chat communication is happening over SSL protocol or Secured Web Socket (wss) then is there any need to implement X3DH algo to prevent MITM as the SSL/WSS would already thwart this threat.

  • 1
    $\begingroup$ As is the question is off-topic for being unclear, and lacking research. I don't know a "Diffie-Hellman attack". Is the question about man-in-the-middle attacks on Diffie-Hellman? On wording; is "Group" used in the sense: more than two people; or in the mathematical sense? What research have you done, in particular on the Diffie-Hellman protocols in SSL and WSS (which I guess stands for Web Services Security)? $\endgroup$ – fgrieu Mar 18 at 7:19
  • $\begingroup$ Thanks for your response. I have updated my question and added more details. Hope you can shed some thoughts. $\endgroup$ – Alok Pabalkar Mar 18 at 17:08

In this case, you have two different threat models and two different types of attacks that both need to be considered.

The solution that a typical TLS connection (HTTPS or WSS connection) provides is an encrypted connection between a server, which is authenticated, and a client, who typically is not (but may be). This means that data between the client and the server has both privacy and integrity. However, if somebody gets the data on the server, whether legally or illegally, then the TLS connection does not protect it and generally the data is exposed. This is the case if you use TLS for email, for example.

When you use a secure chat application such as Signal, the endpoints for the encrypted connection are different. In such a case, the two parties are the two end users. There is a connection to a server (usually using TLS) which aids in distributing key material and encrypted messages, but this server is generally not trusted. If somebody compromises the server, they can prevent the end users from communicating (which is almost always a possible attack on any protocol), but the data remains securely encrypted and cannot be recovered. You'd need to compromise one of the end user devices in order to have any hope of recovering actual message data.

So the two types of protocols solve different problems and for secure chat, generally one uses both TLS to secure the connections between the end user devices and the server and a secure chat protocol to avoid a compromise of the server exposing the messages. Note that in this context, a compromise of the server includes legal demands, whether for good or bad purposes (however you define those).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.