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

9541 Exp2 Css

This document provides details about an experiment on implementing the Diffie-Hellman key exchange algorithm and simulating a man-in-the-middle attack. It describes the theory behind Diffie-Hellman key exchange and how a man-in-the-middle attack works. The objective, prerequisites, steps, and applications of Diffie-Hellman key exchange are explained. The document also includes the output, evaluation, and post-lab assignment questions related to the experiment.

Uploaded by

Kakashi Hatake
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

9541 Exp2 Css

This document provides details about an experiment on implementing the Diffie-Hellman key exchange algorithm and simulating a man-in-the-middle attack. It describes the theory behind Diffie-Hellman key exchange and how a man-in-the-middle attack works. The objective, prerequisites, steps, and applications of Diffie-Hellman key exchange are explained. The document also includes the output, evaluation, and post-lab assignment questions related to the experiment.

Uploaded by

Kakashi Hatake
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

FR.

CONCEICAO RODRIGUES COLLEGE OF ENGINEERING


Department of Computer Engineering

Course , Subject & Experiment Details


Academic Year 2023-24 Estimated Time 02 - Hours

Course & T.E. (CMPN)- Sem VI Subject Name CSS


Semester

Module No. 02 – Mapped to CO-2 Chapter Title Key Management


Techniques

Practical No: 2

Title: Implementation of Diffie- Hellman Key exchange algorithm


and Simulation of Man In the Middle attack

Date of Performance: 30/1/24

Date of Submission: 13/2/24

Roll No: 9541

Name of the Student: Max Gonsalves

Evaluation:
Sr. No Rubric Grade

1 On time submission
Or completion (2)

2 Preparedness(2)

3 Skill (4)

4 Output (2)

Signature of the Teacher:


Date:
Title: Implementation of Diffie- Hellman Key exchange algorithm and Simulation of Man In
the Middle attack.

Lab Objective :

This lab provides insight into:


• The working of Diffie – Hellman Key Exchange Protocol.

Reference : “Cryptography and Network Security” B. A. Forouzan


“Cryptography and Network Security” Atul Kahate

Prerequisite: Any programming Language and Knowledge of Symmetric Key cryptography.

Theory:
Diffie-Hellman is a way of generating a shared secret between two people in such a way
that the secret can't be seen by observing the communication.
This is particularly useful because you can use this technique to create an encryption key with
someone, and then start encrypting your traffic with that key. And even if the traffic is recorded
and later analyzed, there's absolutely no way to figure out what the key was, even though the
exchanges that created it may have been visible.
Man – In – The –Middle Attack

Let us take the example illustrated by Diffie-Hellman to discuss the Man-in-the-Middle Attack.
Let us that Eve is in the middle of Alice and Bob. Eve does not need the value of x or y to attack
the protocol. She can fool both Alice and Bob by the following process.

1. Alice choose a, calculate A=g^a mod p


2. Eve, the intruder, interpret A, she chooses z, calculate Z=g^z mod p, and sends Z to both Alice and
Bob.
3. Bob choose b, calculate B=g^b mod p, and sends B to Alice; B is interpreted by Eve and
never reaches Alice.
4. Alice and Eve calculate the same key g^az mod p, which become a shared key between Alice
and Eve. Alice however think that it is a key shared between Bob and herself.
5. Eve and Bob calculate the same key g^bz mod p, which become a shared key between Eve
and Bob. Bob, however, thinks that it is a key shared between Alice and himself.
This situation is called man-in-the-middle attack.

Practical and Real Time Applications


• Used as a method of exchanging cryptography keys for use in symmetric
encryption algorithms like AES
• Public key encryption schemes based on DF – ElGamal encryption
• Password-authenticated key agreement
• public key infrastructure - It is possible to use DF as part of PKI
Conclusion:

The program was tested for different sets of inputs.


Program is working SATISFACTORY NOT SATISFACTORY ( Tick
appropriate outcome)

Post Lab Assignment:

1. In the Diffie- Hellman protocol , what happens if x and y have the same
value, that is, Alice and Bob have accidentally chosen the same number?
Are A and B (values exchanged by Alice and Bob to each other) the same?
Do the session keys calculated by Alice and Bob have the same value? Use
an example to prove your claims.
2. How to secure Diffie-Hellman from Man-in –the –Middle attack?
Server;

Client:
Key Exchange:
OUTPUT:
Man In The Middle:
Date:
OSTLAL

aceontole

Hallran proto cal ten n] (8) uul be same

n=

Calaee

ehows hat and Sch


Thus

wl
Date:

areetor

Conceant
JS

esmrad.

auehnl

You might also like