0% found this document useful (0 votes)
44 views4 pages

Prac V1

This document describes a laboratory experiment on simulating the Diffie-Hellman key exchange protocol. The objectives are to understand the protocol and simulate it to securely exchange cryptographic keys over a public channel. It provides background on how Diffie-Hellman works by raising numbers to powers to generate decryption keys without directly transmitting the key components. The procedure has students choose parameters, generate their own keys, exchange public values, and calculate a shared secret key. Screenshots of the simulation results are included to verify correct key establishment.

Uploaded by

Niket Bhalerao
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)
44 views4 pages

Prac V1

This document describes a laboratory experiment on simulating the Diffie-Hellman key exchange protocol. The objectives are to understand the protocol and simulate it to securely exchange cryptographic keys over a public channel. It provides background on how Diffie-Hellman works by raising numbers to powers to generate decryption keys without directly transmitting the key components. The procedure has students choose parameters, generate their own keys, exchange public values, and calculate a shared secret key. Screenshots of the simulation results are included to verify correct key establishment.

Uploaded by

Niket Bhalerao
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/ 4

PUNE INSTITUTE OF COMPUTER TECHNOLOGY, PUNE - 411043

Department of Electronics & Telecommunication Engineering

CLASS : T.E. (E&TC) SUBJECT: NETWORK SECURITY


EXPT. NO. : VL1 DATE :

AIM: Simulate Diffie-Hellman secure key exchange protocol.

OBJECTIVES:

 To understand Diffie-Hellman key exchange protocol.

LEARNING OUTCOMES:

The students will be able to:


 Simulate Diffie-Hellman key exchange protocol.
 Use Diffie-Hellman key exchange protocol to ensure the security of the communication
channel.

APPARATUS: Computer Systems (2 Nos.)

THEORY:

 Diffie-Hellman key exchange is a method of digital encryption that securely exchanges


cryptographic keys between two parties over a public channel without their conversation
being transmitted over the internet. The two parties use symmetric cryptography to encrypt
and decrypt their messages. Published in 1976 by Whitfield Diffie and Martin Hellman, it
was one of the first practical examples of public key cryptography.
 Diffie-Hellman key exchange raises numbers to a selected power to produce decryption
keys. The components of the keys are never directly transmitted, making the task of a would-
be code breaker mathematically overwhelming. The method doesn't share information
during the key exchange. The two parties have no prior knowledge of each other, but the
two parties create a key together.
 Diffie-Hellman key exchange's goal is to securely establish a channel to create and share
a key for symmetric key algorithms. Generally, it's used for encryption, password
authenticated key agreement and forward security. Password-authenticated key agreements
are used to prevent man-in-the-middle (MitM) attacks. Forward secrecy-based Protocols.
PUNE INSTITUTE OF COMPUTER TECHNOLOGY, PUNE - 411043

Department of Electronics & Telecommunication Engineering

protect against the compromising of keys by generating new key pairs for each session.
 Diffie-Hellman key exchange is commonly found in security protocols, such as Transport
Layer Security (TLS), Secure Shell (SSH) and IP Security (IPsec). For example, in IPsec,
the encryption method is used for key generation and key rotation.
 Even though Diffie-Hellman key exchange can be used for establishing both public and
private keys, the Rivest-Shamir-Adleman algorithm, or RSA algorithm, can also be used,
since it's able to sign public key certificates.

Diffie-Hellman protocol allows two communicating parties; say Alice and Bob, to create a
symmetric session key without the need of a KDC (Key Distribution Center).

Diffie-Hellman key exchange protocol:


 Alice and Bob chose two numbers p and g which are public.
 ‘p’ is a large prime of the order of 1024 bits.
 ‘g’ is a generator of order p-1 in the group Z p*.
 Alice chooses a large random number ‘x’ in the range 0 to p-1 and calculates
R1 = gx mod p.
 Bob chooses a large random number ‘y’ in the range 0 to p-1 and calculates
R2 = gy mod p.
 Alice sends R1 to Bob and Bob sends R2 to Alice.
 Alice Calculates K = (R2)x mod p.
 Bob Calculates K = (R1)y mod p.
 K = (gx mod p)y mod p = (gy mod p)x mod p = gxy mod p.
 K is the symmetric key for the session.
PUNE INSTITUTE OF COMPUTER TECHNOLOGY, PUNE - 411043

Department of Electronics & Telecommunication Engineering

Fig. 1. Diffie-Hellman Key Exchange Agreement

PROCEDURE:

1. Firstly, choose a large prime number p and a generator g for that prime.
2. Secondly, both Alice and Bob generate their respective keys A and B. And (ga, gb) for
their keys respectively.
3. Both Alice and bob send exchange their ga,gb
4. Finally, both calculate their public keys gab and gba respectively.
5. If both gab and gba are equal, then Deffie-Hellman key exchange is verified.
6. ADD screenshots of result output and name it as Fig. Simulation of Diffie-Hellman Key
Establishment
PUNE INSTITUTE OF COMPUTER TECHNOLOGY, PUNE - 411043

Department of Electronics & Telecommunication Engineering

CONCLUSION:

REFERENCES:
1. William Stallings, “Cryptography and Network Security”, Pearson Education, 4th Edition
2. Atul Kahate, “Cryptography and Network Security”, McGraw Hill, 3rd Edition.
3. C K Shymala, N Harini, Dr. T R Padmanabhan, “Cryptography and Network Security”,
WileyIndia,1st Edition.

You might also like