Diffie-Hellman Key Exchange

A Simple Group Theoretic Introduction

CasualPhysicsEnjoyer
5 min readDec 12, 2021

The goal of cryptography is to have two agents sharing a coded secret over some public channel. This secret has to be secure, which means that eavesdroppers shouldn’t be able to figure out what the secret is, even if they had the coded version. Most encryption algorithms rely on a key that needs to be known by two parties and kept secret. For now, let’s say that this secret is s, a number. Methods for secure messaging of this secret key are called Key exchanges. A simple yet classically secure way to do this is the Diffie-Hellman protocol. It is a protocol that uses simple group theory to encode secretes for us and is widely applicable to different mathematical groups.

Cyclic Groups

The first step is to take any mathematical group that is cyclic. As I’ve explained in previous posts, a group is a mathematical object with some elements. In this case, let’s assume that we only have a finite number of these elements. We also have a binary operation that allows us to ‘add’ two elements together in a group. In the bullet points below, the following conditions are some conditions that mathematicians use to decide if something is a group formally.

  • There exists a group identity, which we will call e, where e ∈ G such that for all g ∈ G, combining the identity with any other element satisfies e · g = g · e = g. In plain English, this means that a group needs to contain a ‘do nothing’ transformation and that this…

--

--