[This feature is a licensed version feature] Those who require a license can obtain a 30-day license from the [Program Key Issuance] page.

Let’s learn about the DH (Diffie-Hellman) algorithm, a key exchange algorithm.

DH Algorithm Concept

The DH algorithm is a key agreement or key exchange algorithm that uses your private key and the other party’s public key to obtain the same symmetric key.

In other words, rather than one party unilaterally determining the key value, both parties agree on the key value and share it.

DH Algorithm Vulnerabilities

The DH algorithm is vulnerable to man-in-the-middle attacks.

To protect against man-in-the-middle attacks, it is used in conjunction with a certificate-based digital signature.

Also, excessively short parameters should not be used.

Obtaining S (a symmetric key) using DH

Alice computes A \(A = g^a mod p\)

Bob computes B \(B = g^b mod p\)

Alice obtains S using B \(S = B^a mod p\)

Bob obtains S using A \(S = A^b mod p\)

This is the algorithm for Alice and Bob to obtain symmetric values ​​using the same S.

  • Here, the values ​​g and p represent the DH parameter information.
  • a : Alice’s private key
  • A : Alice’s public key
  • b : Bob’s private key
  • B : Bob’s public key

How to Use BerEditor

Select BerEditor -> Cryptography -> Key Agreement, then select the DH tab.

    1. First, create parameters (g and p values)
    1. A Specify DH public and private key values
    1. Specify B DH public and private key values
    1. Specify the location for calculating the secret value between A and B
    1. Execute the secret value calculation
    1. Display the secret key value

Here, the activation of the public and private key sections varies depending on whether you select “calculate A” or “calculate B.”

When calculating each value, the secret values ​​for A and B are the same.

Note that if you use the key generation function without generating a private key, both the private and public keys are generated.

For testing purposes, all values ​​for A and B are shown here.

In reality, these are the values ​​A needs to obtain A’s private key using A’s private key and B’s public key.

Otherwise, B needs B’s private key and A’s public key to obtain B’s secret key.

Both sides generate the same secret key, allowing key agreement.

This is a brief overview of the DH algorithm.

The DH algorithm is used in protocols such as TLS.