Diffie-Hellman Key Exchange

What can this protocol do?

Diffie-Hellman Key Exchange allows two people (or systems) who have never met to establish a shared secret over a public communication channel. Even if an eavesdropper is monitoring the conversation, they won’t be able to determine the shared secret.

Why Matters?

With shared secret from DHKE, we can leverage the technique called "symmetric encryption" to create the secure channel of communication between parties that hold this shared secret such that other people cannot see what they communicate to each other (More on symmetric encryption later, make it clickable to symmetric encryption section??). This secure communication is used in "Messaging Apps" like WhatsApp to ensure that messages can only be read by the sender and receiver.

Setup

We work within a cyclic group G={1,2,…,p−1}\mathbb{G}=\{1,2,…,p−1\} with the operation being modular multiplication. Here, pp is a large public prime number (longer than 2948 bits), and gg is a generator of the group.

Open Ended

:Intuitively, why do you think we require pp to be a very big prime number

Private Values:

Party A (Alice) chooses a private value a∈Ga \in \mathbb{G}

Party B (Bob) chooses a private value b∈Gb \in \mathbb{G}

Public Values:

Alice computes her public value A=ga mod pA = g^a\ mod\ p and sends it to Bob.

Bob computes his public value B=gb mod pB = g^b\ mod\ p and sends it to Alice.

Shared Secret:

Alice computes S=Ba mod pS = B^a\ mod\ p

Bob computes S=Ab mod pS = A^b\ mod\ p

Open Ended

Explain why Diffe-Hellman Key Exchange make sense i.e. Alice and Bob arrive at the same shared secret.