Hi,
I have need help in creating a UDP chat program in java that issecured with diffie helman protocol. Users must exchange P,g,a ofthe diffie helman protocol by entering it through the chat toestablish session key. After session key is established user willbe able to send messages to one another.
Answer
SERVER SIDEPROGRAM
import java.net.*;
import java.io.*;
public class Server {
public static void main(String[] args)throws IOException
{
try {
intport = 8088;
intb = 3;
//Client p, g, and key
doubleclientP, clientG, clientA, B, Bdash;
StringBstr;
//Established the Connection
ServerSocketserverSocket = new ServerSocket(port);
System.out.println(“Waitingfor client on port ” + serverSocket.getLocalPort() + “…”);
Socketserver = serverSocket.accept();
System.out.println(“Justconnected to ” + server.getRemoteSocketAddress());
//Server’s Private Key
System.out.println(“FromServer : Private Key