Hi Need Help Creating Udp Chat Program Java Secured Diffie Helman Protocol Users Must Exch Q37252294

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

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.