# diffie hellman algorithm (encryption) (DHA)

The Diffie-Hellman method( DHA) is a public- key method for key exchange. The DHA method allows two communication partners, Alice and Bob, to exchange a secret key over an unsecured connection. The method is based on exponentiating the data to be encrypted with large exponents.

Before the transmission, Alice and Bob agree on a very large prime number (p) and a so-called prime root (g) of (p), which is divisor-alien to (p-1). Both numbers are allowed to be common knowledge. Before the key exchange, Alice and Bob each generate a random number (a) and (b) to be kept secret. Alice and Bob each used the prime root (g) as the mantissa and their secret random number (a) and (b) as the exponent, respectively, and calculate a new value (A) and (B) from it. After that, communication partners exchange the results. From the B-value of Bob and the A-value of Alice, both calculate an identical key, which can only be used jointly by both for decryption. Each participant contributes its share. For example, when the recipient has done his share of the decryption, he sends the document, which remains encrypted, to the sender, who can use his key to decrypt the document.

The Diffie-Hellman method (DHA) results in a public-private key pair similar to the RSA method. It uses the ElGamal algorithm, which guarantees high security. The method was patented in 1976 and is difficult to crack because the back calculation can only be performed logarithmically.