Question: Q1: In the following programs there are 5 errors. Find those errors and fix it. import java.io.; import java.math.Biglnteger: class DiffieHellman I public static void

 Q1: In the following programs there are 5 errors. Find those

Q1: In the following programs there are 5 errors. Find those errors and fix it. import java.io."; import java.math.Biglnteger: class DiffieHellman I public static void main(String[largs)throw IOException I BufferedReader brmew BufferedReader(new InputStreamReader(System.in)); System.out println("Enter prime number:"): BigInteger penew Biginteger(br readline0)): System.out.print("Enter primitive root of " +p+n: :"); BigInteger genew Biginteger(br readLine(O): System.outiprintln( "Enter value for XQless than "+p+":"): Sy stem.out printinl E Biglnteger x=nW Biginteger(br.readLine()); X= vew Biglnteger RI=gmodPow(x,p); System.out.println("Public key for Alice YA= "R1); system.out.print " Enter value for X8 less than " +p+"+7; Biglnteger y= new Biglnteger(br.readLineO); Biginteger R2=g.modPow(y.p); System.out.println("Public key For BOBYB=+R2 ): Biginteger kl=R2.modPow(x,p) : System.out.printin("Key calculated at Alice's side:" +k1 ); BigInteger 2K=R1.modPow(y/p) : System.out.println("Key calculated at Bob's side:" +k2 ), System.out.println("deffichellman secret key Encryption has Taken")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!