Diffie–Hellman key exchange

Diffie-hellman key Exchange (D-H) is a security protocol. It allows both parties to set up a key over an insecure channel without any prior information from the other party. This key can be used as a symmetric key in subsequent communications to encrypt the communication content. 

  1. Alice and Bob publicly agree to use a modulus p = 23 and base g = 5 (which is a primitive root modulo 23).
  2. Alice chooses a secret integer a = 4, then sends Bob A = ga mod p
    • A = 54 mod 23 = 4
  3. Bob chooses a secret integer b = 3, then sends Alice B = gb mod p
    • B = 53 mod 23 = 10
  4. Alice computes s = Ba mod p
    • s = 104 mod 23 = 18
  5. Bob computes s = Ab mod p
    • s = 43 mod 23 = 18
  6. Alice and Bob now share a secret (the number 18).








Reference: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange

Popular posts from this blog

Phonebook - Hack the box Write up -- Web LDAP injection

wafwaf -- Hack The Box -- Web SQL injection

Cheat sheet for security+