Diffie-Hellman Key Exchange: Alice and Bob wants to agree on a key. First, both agree on p = 23 and g = 5 which is public. Alice chooses her secret key xA = 8 and Bob xB = 14.
(a) What will be the shared secret key?
(b) DH Key exchange is vulnerable to the following attack. Adversary sits between Alice and Bob, intercepting all messages. Alice and Bob thinks they talk to each other while in fact both talking to the adversary. Draw the scenario of the attack and find out the final shared key(s).
What is Diffie-Hellman Key Exchange:
How does the Diffie-Hellman key exchange work?
Refer the following diagram for the process:
C++ program to demonstrate the Diffie-Hellman Key Exchange Algorithm:
#include <iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
/* This program calculates the Key for two persons using the
Diffie-Hellman Key exchange algorithm */
// Power function to return value of a ^ b mod P
long long int power(long long int a, long long int b, long long int
P)
{
if (b == 1)
return a;
else
return (((long long int)pow(a, b)) % P);
}
//Main program
int main()
{
long long int P, G, x, a, y, b, ka, kb;
// Both the persons will be agreed upon the public keys G and
P
P = 23;
// A prime number P is taken
printf("The value of P : %lld\n", P);
G = 5;
// A primitve root for P, G is taken
printf("The value of G : %lld\n\n", G);
// Alice will choose the private key a
a = 8;
// a is the chosen private key
printf("The private key a for Alice : %lld\n", a);
x = power(G, a, P);
// gets the generated key
// Bob will choose the private key b
b = 14;
// b is the chosen private key
printf("The private key b for Bob : %lld\n\n", b);
y = power(G, b, P);
// gets the generated key
// Generating the secret key after the exchange of keys
ka = power(y, a, P);
// Secret key for Alice
kb = power(x, b, P);
// Secret key for Bob
printf("Secret key for the Alice is : %lld\n", ka);
printf("Secret Key for the Bob is : %lld\n", kb);
return 0;
}
Output for the program:
Diagram for attack scenario i.e. MAN IN THE MIDDLE ATTACK:
Step by step algorithm (Refer the attached notes for refrence):
Diffie-Hellman Key Exchange: Alice and Bob wants to agree on a key. First, both agree on...
Question1: Alice and Bob use the Diffie–Hellman key exchange technique with a common prime q = 1 5 7 and a primitive root a = 5. a. If Alice has a private key XA = 15, find her public key YA. b. If Bob has a private key XB = 27, find his public key YB. c. What is the shared secret key between Alice and Bob? Question2: Alice and Bob use the Diffie-Hellman key exchange technique with a common...
5. Diffie-Hellman key exchange. Alice and Bob use Diffie-Hellman key exchange protocol to communicate in secret. They publicly announce a prime number p = 23 and a primitive root r = 5 under modulus 23, Alice picks a secret key a-6 and in turn receive the key ß-19 from Bob (a.) (2 points) What is the key that Alice sends to Bob? b) (2 points) What is the shared secret key?
The Diffie-Hellman key exchange is vulnerable to the following type of attack. An opponent Carol intercepts Alice’s public value and sends her own public value to Bob. When Bob transmits his public value, Carol substitutes it with her own and sends it to Alice. After this exchange, Carol simply decrypts any messages sent out by Alice or Bob, and then reads and possibly modifies them before re-encrypting with the appropriate key and transmitting them to the other party. Choose all...
The Diffie-Hellman key exchange is vulnerable to the following type of attack. An opponent Carol intercepts Alice’s public value and sends her own public value to Bob. When Bob transmits his public value, Carol substitutes it with her own and sends it to Alice. After this exchange, Carol simply decrypts any messages sent out by Alice or Bob, and then reads and possibly modifies them before re-encrypting with the appropriate key and transmitting them to the other party. Choose all...
Find Alice and Bob’s secret number in Diffie-Hellman key exchange if g=5, p=103, A = 102, B = 94.
Answer all of it asap Discrete mathematics Problem 10 (10 pts) Alice and Bob would like to exchange a key using the Diffie-Hellman protocol that uses the following public information: the cyclic group Zio, and 5 as its base element. Alice: If she chooses 3 as her private key, which element does she send to Bob. Bob: If he chooses 4 as his private key, which element does he send to Alice Key-Exchanged: What is their Private Key exchanged. Problem...
The Diffie-Hellman public-key encryption algorithm is an alternative key exchange algorithm that is used by protocols such as IPSec for communicating parties to agree on a shared key. The DH algorithm makes use of a large prime number p and another large number, g that is less than p. Both p and g are made public (so that an attacker would know them). In DH, Alice and Bob each independently choose secret keys, ?? and ??, respectively. Alice then computes...
In a Diffie-Hellman Key Exchange, Martha and John have chosen prime value q = 19 and primitive root a = 10. If Martha's secret key is 4 and John's secret key is 6, determine the following three values: The value Martha sends to John. The value John send to Martha The shared key they exchanged.
Alan and Bill agree (through a public exchange) on using the Diffie-Hellman algorithm to create a common secret key. They also agree on two public numbers: q (large prime number), (generator mod q): q = 13, = 3 Alan generates a random RA =11. Bill generates a random RB =13. (a) What is the SA Alan sends to Bill? (i.e. SA =? (3 points) (b) What is the SB Bill sends to Alan? (i.e. SB =? (3 points)...
Suppose that Alice wants to initiate a message exchange (also called session) to instruct her bank, NetBank, to pay Bob N40. Alice shares a long-term secret, X, with NetBank (hereafter denoted as C). Alice starts the session by sending a service request, (A, C, n), to NetBank, 3. a. where A is Alice's identity, C is NetBank's identity, and n is a nonce. Assume that NetBank keeps a record of the nonces used by Alice for X. Answer the following...