A java program for the diffie-hellmann key exchange

Assignment Help JAVA Programming
Reference no: EM132080186

You need help writing a java program for the Diffie-Hellmann Key Exchange. The program needs only 1 input from the user where it takes a 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, random numbers a,b Z* p, and other intermediate results computed in the Dife-Hellman protocol.

Note that the values of p,g,a, and b have to be generated randomly by your program based on the input argument.

Your program should finally output the shared key generated. An example of how the code's output should look upon execution is below:

>> 5

>> The value of p selected: 23

>> The value of g selected: 5

>> The value of a selected by Alice: 6

>> The value of b selected by Bob: 15

>>The value of A sent to Bob by Alice: 8

>> The value of B sent to Alice by Bob: 19

>>The value of key shared between Alice and Bob: 2

In the above scenario, the program takes 5 as input meaning that the size of p should be 5 bits (i.e., the value of p should be selected in the range (16,31]).

Note that since the values of p,g,a,b are assumed to be generated randomly as per the Dife-Hellman protocol, their values and the shared key value can be very different during each execution.

Reference no: EM132080186

Questions Cloud

How many should the company produce to maximize : If the price on the competitive market for a bunny this size is $7.00, how many should the company produce to maximize its profit? bunnies
Price in dollars and q is the quantity : If P is the price in dollars and q is the quantity, demand for a product is given by
Write a code for an arduino and servo motor : You need help writing a code for an arduino and servo motor. You need the servo motor to rotate 180* after pressing a button.
Injection of the drug : The quantity of a drug, Q mg, present in the body t hours after the injection of the drug is given is
A java program for the diffie-hellmann key exchange : Compute and print the values of p, the generator g, random numbers a,b Z* p, and other intermediate results computed in the Dife-Hellman protocol.
Draw the bracket shown including centre : ENGINEERING DESIGN - COMPUTER-BASED TECHNOLOGY - BASIC DRAWING - Draw the bracket shown below including centre lines but not the dimensions
Write the equation of an ellipse centered at the origin : Steps to solve the following problem. Write the equation of an ellipse centered at the origin with foci at (0, -3) and (0, 3) and a major axis of 10.
Write an application that counts by three : Write an application that counts by three from 3 through 300 inclusive, and that starts a new line after every multiple of 30.
Compare the word with the string and call itself to read : In the main program, close your file and report whether there is a match and how many characters are in the file.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd