The Diffie–Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure channel. This key can then be used to encrypt subsequent communications using a symmetric key cipher.
1. A and B agree to use a modulus p = 619 and base g = 3(primitive root)
2. A chooses a secret integer a = 16, then sends B H = ga mod p = $3^{16}$ mod $619$ = $223$
3. B chooses a secret integer b = 15, then sends A G = gb mod p = $3^{15}$ mod $619$ = $487$
4. A computes s = Ga mod p = $487^{16}$ mod $619$ = $24$
5. B computes s = Hb mod p = $223^{15}$ mod $619$ = $24$
6. A and B now share a secret i.e $24$
$OR$
simply The D-H key is $g^{ab}$ mod $p$ = $3^{16*15}$ mod $619$ = $24$