public static void main(String args)
Scanner sc = new Scanner(System.in);
System.out.println(“Enter the value of Xa & Xb”);
System.out.println(“Enter a Prime no. p”);
System.out.println(“Enter Primitive Root a, such that a<p”);
Diffie Hellman Key Exchange Algorithm (Java)
4 thoughts on “Diffie Hellman Key Exchange Algorithm (Java)”
Does this work??
Hey Aarthi, haven’t tried it for a while, but used to work when I wrote it.
Hello Mr. Gajara,
Your code is simple and easily understandable. One small suggestion would be to get the random numbers from the users and then compute Xa and Xb, and from there, it is perfect. Thank you for your code
Glad that it helps. Good suggestion, I had written this some 4 years back, haven’t been doing much coding since past 2 years. Could you just add the modification in the comment?
Also, I had prefer Darshan 🙂