eli5: deffie-hellman key exchange

202 views

I get the basic idea that raising (c^a mod(p))^b = (c^b mod(p))^a but how does one get a message out of this? Lets say Alice wants to send Bob a message, “Hello”. How does this message get attached on the encryption and decrypted? Its cool that we can get c^ab mod(p) everytime but how does this help in understanding the message?

In: 1

2 Answers

Anonymous 0 Comments

You don’t, not directly. Diffie-Hellman is a *key exchange* method, not an encryption method. This means it only handles the details of sharing a key. The actual encryption is done by a different algorithm (any encryption algorithm will do)

To send an encrypted message, you first perform a Diffie-Hellman key exchange with your partner to create a shared secret number (c^ab mod(p)). Once you both know that number, you can plug it into a standard encryption algorithm, [such as AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard), as the secret key.

The reason that Diffie-Hellman exists is that most encryption algorithms require both you and your partner to know the same secret key in order to communicate. This is not a problem if you can meet your partner in person to exchange keys, but if you can only talk to them online you need a way to create a shared secret key even though people can eavesdrop on all your messages. Diffie-Hellman is the process that allows you to do so.

You are viewing 1 out of 2 answers, click here to view all answers.