Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java code using the Deffie Hellman Algorithm to secure chat application, must be able to Diffie-Hellman handshake protocol: 1- server sends g and n
In Java code using the Deffie Hellman Algorithm to secure chat application, must be able to Diffie-Hellman handshake protocol: 1- server sends g and n to the client 2- client selects a random value x, and sends gx mod n to the server 3- server selects a random value y, and sends gy mod n to the client 4- each side computes the encryption key a. client computes key = g^yx mod n b. server computes key = g^xy mod n
The server is a concurrent server and can accept multiple connections. The server program will log and broadcast every chat message it receives from any client. For each connection the server will create a new thread and hand the connection to it. The server then waits for the next connection The server program will create a chat file called 'xy chat.txt upon the arrival of the first connection (first client joins the chat room), and will share this file with all the subsequent connections as long as there is at least one open connection. The server will delete the chat file when the last connection is closed (the only remaining client leaves the chat room). The server wil1 create a new chat file each time a client joins an empty chat room. The chat file (log file) will contain only the original messages, and not the encrypted ones When a connection is made, the thread that manages the connection will initiate a handshake with the client. During the handshake the thread will first send the client the values for g and n, and then the two sides will exchange values from which an encryption key (a session key) will be computed. Due to the randomness of the values exchanged, each client will have a unique encryption key, and no two keys would be the same. Note that any exchanges between the client and server from this point forward will be encrypted using bit-level encryption. Next the server will wait for the user's name, and then sends the client the content of the chat file. It will also log and broadcast the arrival of a new client to the chat room. Any message from the client after this point, except DONE, will be logged and broadcasted. For DONE, the thread will log and broadcast the departure of the client from the chat room. When the client signals that it is ready to leave the chat session (sending DONE), the thread will close the client connection, and will terminate itself As mentioned above, the server will log and broadcast every chat message it receives from any client. If the server gets a chat message from client A, then client A must be excluded from the list of clients that will get the message (the server doesn't echo the message back to the same client). The server will write only plaintext messages, not encrypted ones, to the The server is a concurrent server and can accept multiple connections. The server program will log and broadcast every chat message it receives from any client. For each connection the server will create a new thread and hand the connection to it. The server then waits for the next connection The server program will create a chat file called 'xy chat.txt upon the arrival of the first connection (first client joins the chat room), and will share this file with all the subsequent connections as long as there is at least one open connection. The server will delete the chat file when the last connection is closed (the only remaining client leaves the chat room). The server wil1 create a new chat file each time a client joins an empty chat room. The chat file (log file) will contain only the original messages, and not the encrypted ones When a connection is made, the thread that manages the connection will initiate a handshake with the client. During the handshake the thread will first send the client the values for g and n, and then the two sides will exchange values from which an encryption key (a session key) will be computed. Due to the randomness of the values exchanged, each client will have a unique encryption key, and no two keys would be the same. Note that any exchanges between the client and server from this point forward will be encrypted using bit-level encryption. Next the server will wait for the user's name, and then sends the client the content of the chat file. It will also log and broadcast the arrival of a new client to the chat room. Any message from the client after this point, except DONE, will be logged and broadcasted. For DONE, the thread will log and broadcast the departure of the client from the chat room. When the client signals that it is ready to leave the chat session (sending DONE), the thread will close the client connection, and will terminate itself As mentioned above, the server will log and broadcast every chat message it receives from any client. If the server gets a chat message from client A, then client A must be excluded from the list of clients that will get the message (the server doesn't echo the message back to the same client). The server will write only plaintext messages, not encrypted ones, to theStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started