Let's say bob says Hi and Alice says Hello, With the knowledge of n and g, how can we encrypt those message using Diffie-hellman or any ECDH

  • 2
    Diffie-Hellman is a key exchange protocol. With this protocol, the parties agree on a key and transfer messages by using a symmetric encryption algorithm like AES. – kelalaka Nov 18 at 19:37

If you look at the Wikipedia page of Diffie–Hellman key exchange you will see that, the algorithm is actually a key exchange protocol.

That is; two parties agree on a new key such that any of the two parties doesn't know before the protocol.

We use this protocol to generate a new key, and transfer the messages by using a symmetric encryption algorithm like AES with the generated key.

If you are looking for an encryption based on the Diffie-Hellman assumption you should check ElGamal Encryption

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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