What the benefit of the shared key that generated from ECDH key exchange protocol? Can I use it to encrypt the message or encrypt the public key of asymmetric encryption?
1 Answer
In principle your could use the derived secret for encryption. But this has several disadvantages. It may leak information about the involved keys and is vulnerable by man-in-the-middle attacks.
A common scheme is to use the derived shared secret to seed a key derivation function to derive stronger keys and get better security properties (forward secrecy, ...)
-
1$\begingroup$ How does the use of a key derivation function protect you from man-in-the-middle attacks? If you bring MITM up, you might want to mention how to defend against it... $\endgroup$– ponchoJun 14, 2022 at 18:21