0% found this document useful (0 votes)
221 views

Diffie-Hellman Case Study - 1DS18TE075

The document describes the Diffie-Hellman key exchange algorithm. It explains that the algorithm allows two parties to generate a shared secret key over an insecure channel without physically transferring the key. It works by having the parties first agree on a prime number and generator. They then each select a private number and calculate a public number by exponentiating the generator with their private number modulo the prime. The parties exchange public numbers and calculate the shared secret key by exponentiating the received public number with their private number. While eavesdroppers can obtain the public numbers, they cannot determine the private numbers or shared secret key without immense computational resources. The document provides examples of the calculation steps and discusses advantages like not requiring prior knowledge between parties and allowing

Uploaded by

Gaurav Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
221 views

Diffie-Hellman Case Study - 1DS18TE075

The document describes the Diffie-Hellman key exchange algorithm. It explains that the algorithm allows two parties to generate a shared secret key over an insecure channel without physically transferring the key. It works by having the parties first agree on a prime number and generator. They then each select a private number and calculate a public number by exponentiating the generator with their private number modulo the prime. The parties exchange public numbers and calculate the shared secret key by exponentiating the received public number with their private number. While eavesdroppers can obtain the public numbers, they cannot determine the private numbers or shared secret key without immense computational resources. The document provides examples of the calculation steps and discusses advantages like not requiring prior knowledge between parties and allowing

Uploaded by

Gaurav Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

“Jnana Sangama”, Belagavi-18, Karnataka, India.

Report on

“Diffie -Hellman Key Exchange


Algorithm”
A case study submitted in partial fulfillment of the requirement for the degree of

Bachelor of Engineering
In
Telecommunication Engineering
By

Gaurav Agarwal
1DS18TE075

7th sem B.E.


Under the guidance of
Mr. Vivek Raj
Assistant Professor

Department of Telecommunication Engineering


DAYANANDA SAGAR COLLEGE OF ENGINEERING
BENGALURU -560078

2021-22
Diffie-Hellman Key Exchange Algorithm 2021-22

INTRODUCTION

Asymmetric Encryption of data requires transfer of cryptographic private key. The


most challenging part in this type of encryption is the transfer of the encryption
key from sender to receiver without anyone intercepting this key in between. This
transfer or rather generation on same cryptographic keys at both sides secretively
was made possible by the Diffie-Hellman algorithm.

The Diffie-Hellman algorithm was developed by Whitfield Diffie and Martin


Hellman in 1976. This algorithm was devices not to encrypt the data but to
generate same private cryptographic key at both ends so that there is no need to
transfer this key from one communication end to another. Though this algorithm is
a bit slow but it is the sheer power of this algorithm that makes it so popular in
encryption key generation.

In the Diffie–Hellman key exchange scheme, each party generates a public/private


key pair and distributes the public key. After obtaining an authentic copy of each
other's public keys, Alice and Bob can compute a shared secret offline. The shared
secret can be used, for instance, as the key for a symmetric cipher.

Department of Telecommunication Engineering, DSCE Page 1


Diffie-Hellman Key Exchange Algorithm 2021-22

DIFFIE–HELLMAN ALGORITHM

This algorithm uses arithmetic modulus as the basis of its calculation. Suppose
Alice and Bob follow this key exchange procedure with Eve acting as a man in
middle interceptor .

Here are the calculation steps followed in this algorithm that make sure that eve
never gets to know the final keys through which actual encryption of data takes
place.

1. First, both Alice and Bob agree upon a prime number and another number that
has no factor in common. Lets call the prime number as p and the other
number as g. Note that g is also known as the generator and p is known as
prime modulus.
2. Now, since eve is sitting in between and listening to this communication so
eve also gets to know p and g.
3. Now, the modulus arithmetic says that r = (g to the power x) mod p. So r will
always produce an integer between 0 and p.
4. The first trick here is that given x (with g and p known) , its very easy to
find r. But given r (with g and p known) its difficult to deduce x.
5. One may argue that this is not that difficult to crack but what if the value
of p is a very huge prime number? Well, if this is the case then
deducing x (if r is given) becomes almost next to impossible as it would take
thousands of years to crack this even with supercomputers.
6. This is also called the discrete logarithmic problem.
7. Coming back to the communication, all the three Bob, Alice and eve now
know g and p.

Department of Telecommunication Engineering, DSCE Page 2


Diffie-Hellman Key Exchange Algorithm 2021-22

8. Now, Alice selects a random private number xa and calculates (g to the


power xa) mod p = ra. This resultant ra is sent on the communication
channel to Bob. Intercepting in between, eve also comes to know ra.
9. Similarly Bob selects his own random private number xb, calculates (g to the
power xb) mod p = rb and sends this rb to Alice through the same
communication channel. Obviously eve also comes to know about rb.
10. So eve now has information about g, p, ra and rb.
11. Now comes the heart of this algorithm. Alice calculates (rb to the power xa)
mod p = Final key which is equivalent to (g to the power (xa*xb) ) mod p .
12. Similarly Bob calculates (ra to the power xb) mod p = Final key which is
again equivalent to (g to the power(xb * xa)) mod p.
13. So both Alice and Bob were able to calculate a common Final key without
sharing each others private random number and eve sitting in between will not
be able to determine the Final key as the private numbers were never
transferred.

Department of Telecommunication Engineering, DSCE Page 3


Diffie-Hellman Key Exchange Algorithm 2021-22

Department of Telecommunication Engineering, DSCE Page 4


Diffie-Hellman Key Exchange Algorithm 2021-22

DESCRIPTION

Diffie–Hellman key exchange establishes a shared secret between two parties that
can be used for secret communication for exchanging data over a public network.
An analogy illustrates the concept of public key exchange by using colors instead
of very large numbers:

The process begins by having the two parties, Alice and Bob, publicly agree on an
arbitrary starting color that does not need to be kept secret (but should be different
every time ). In this example, the color is yellow. Each person also selects a secret
color that they keep to themselves – in this case, red and blue-green. The crucial
part of the process is that Alice and Bob each mix their own secret color together
with their mutually shared color, resulting in orange-tan and light-blue mixtures
respectively, and then publicly exchange the two mixed colors. Finally, each of
them mixes the color they received from the partner with their own private color.
The result is a final color mixture (yellow-brown in this case) that is identical to
their partner's final color mixture.

If a third party listened to the exchange, it would only know the common color
(yellow) and the first mixed colors (orange-tan and light-blue), but it would be
difficult for this party to determine the final secret color (yellow-brown). Bringing
the analogy back to a real-life exchange using large numbers rather than colors,
this determination is computationally expensive. It is impossible to compute in a
practical amount of time even for modern supercomputers.

Department of Telecommunication Engineering, DSCE Page 5


Diffie-Hellman Key Exchange Algorithm 2021-22

ADVANTAGES

• The sender and receiver don’t need any prior knowledge of each other.
• Once the keys are exchanged, the communication of data can be done
through an insecure channel.
• The sharing of the secret key is safe.

LIMITATIONS
• The algorithm can not be sued for any asymmetric key exchange.
• Similarly, it can not be used for signing digital signatures.
• Since it doesn’t authenticate any party in the transmission, the Diffie
Hellman key exchange is susceptible to a man-in-the-middle attack.

Department of Telecommunication Engineering, DSCE Page 6


Playfair Cipher 2021-22
PROGRAM

Department of Electronics and Telecommunication Engineering, DSCE Page 7


Playfair Cipher 2021-22

Department of Electronics and Telecommunication Engineering, DSCE Page 8


Playfair Cipher 2021-22

OUTPUT

Department of Electronics and Telecommunication Engineering, DSCE Page 9

You might also like