Question: Diffie-Helmann Key Exchange Java Program should take the size of the prime number p (in bits) as an argument during execution. Based on the size
Diffie-Helmann Key Exchange
Java Program should take the size of the prime number p (in bits) as an argument during execution. Based on the size of p, your program should be able to compute and print the values of p, the generator g, and random numbers a, b Zp as per the Die-Hellman protocol. Note that all these values are selected randomly in your code. Based on the values chosen, your program should nally output the shared key generated.
(b). Suppose your program name is Assignment2.java. Here is a sample case of what your code is expected to output upon its execution
>> java Assignment 5
the value of p selected: 23
the value of g selected: 5
the value of a selected: 6
the value of b selected: 15
the value of shared key generated: 2
In this case, the program takes 5 as input meaning that the size of p is 5 bits. Note that here the values of p, g, a, b are assumed to be generated randomly as per the Die-Hellman protocol and therefore their values and the shared key value can be very dierent during each execution.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
