CS3750 Homework9- ogram to implement the following secure Info Collection protocolSolved

35.00 $

Category:

Description

5/5 - (1 vote)

Task I : Write a client Java program and a server Java program to implement the following secure Info Collection protocol on top of SSL/TLS service. TCP or UDP service cannot be used directly in your programs, i.e., any TCP/UDP class such as Socket and ServerSocket cannot be used in your source code although the ssl sockets used in your source code will certainly use the TCP service.

  • InfoCollection Server Program:
    1. Take one argument, which specifies the port number that the server listens to, and create the SSL Server Socket.
    2. Listen to the given port and wait for a connection request from an InfoCollection Client.
    3. Create a new thread and an SSL socket for every incoming SSL connection from an InfoCollection client. While the original thread goes back to Step 2, the new thread continues with the following steps.
    4. Get the session of this SSL socket and display the following information (hint: use the get…() methods of this session.)

Peer host is ……

Cypher suite is …… Protocol is ……

Session ID is ……

The creation time of this session is ……

The last accessed time of this session is ……

  1. Send questions to and collect information from the InfoCollection client
    1. Send “User Name: ” to client, read the response from client, create a txt file named as <this user ID>.txt, and write

“User Name: <response from client>” as the first line in this file.

  1. Send “Full Name: ” to client, read the response from client, and add a line, “Full Name: <response from client>”, to the file created in Step 5.a.
  2. Send “Address: ” to client, read the response from client, and add a line, “Address: <response from client>”, to the file created in Step 5.a.
  3. Send “Phone number: ” to client, read the response from client, and add a line, “Phone number: <response from client>”, to the file created in Step 5.a.
  4. Send “Email address: ” to client, read the response from client, and add a line, “Email address: <response from client>”, to the file created in Step 5.a.
  5. Close the file created in Step 5.a.
  6. Send “Add more users? (yes or any for no)” to client, read the response from client. If the client responds “yes”, go back to Step 5.a and repeat.  Otherwise, close the SSL connection and terminate this new thread (and loop back to Step 2 if the server is single-threaded).
  • InfoCollection Client Program:
    1. Take two arguments, which specify the ip/dns and the port number of the remote InfoCollection Server.
    2. Create a SSL socket to connect to your InfoCollection server. Catch the exception, terminate the program, and display error messages on the standard output if any.
    3. Get the session of this SSL socket and display all the information as what is listed in Server program’s Step 4.
    4. Read each question from the Info Collection server, one at a time, and display each question on the standard output to ask the user to input the answer. Read the user’s answer from the standard input and send it to the server.
      1. If the user answers any except for “yes” to the InfoCollection Server’s Step 5.g, close the SSL connection and terminate this program AFTER sending the user’s answer to the InfoCollection Server. b. Otherwise, repeat Step 4.

 

Task II: Generate keys and test your program on cs3750a and cs3750b.

  Warning:

to complete this part, especially when you work at home, you must first (1) connect to the MSUDenver VPN via GlobalProtect; then (2) connect to the virtual servers cs3750a.msudenver.edu and cs3750b.msudenver.edu using sftp and ssh command on MAC/Linux or PUTTY and PSFTP on Windows.  For details, you may refer to Lab 1.

The server program always has to start BEFORE the client program in your test.

 

  1. Create a directory “HW09” under your home directory on cs3750a and cs3750b. Create a subdirectory “server” on cs3750a for the server program and your keystore. Make a subdirectory “client” on cs3750b for the client program and your truststore
  2. Use keytool to create a simple JKS keystore suitable for use with JSSE. Make a PrivateKeyEntry in your keystore in HW09/server, then make a corresponding trustedCertEntry in your truststore in HW09/client.
  3. In a file named “keyinfo.txt” under HW09/server on cs3750a, list the names and passwords of your keystore and truststore, and the alias and password of your PrivateKeyEntry and trustedCertEntry.
  4. RUN and TEST your server program in HW09/server on cs3750a. You must use the port number assigned to you in the file named “pdf”, which is posted Blackboard under “Lab03 SSL”, in your server program as the local port number to create a SSL Server Socket, which will wait for a connection request from any client.
  5. RUN and TEST your client program in HW09/client on cs3750b, copy & paste the outputs of this client program during your test to a file named “txt”. (Hint: in your client program, your need to use cs3750a.msudenver.edu as the remote DNS/IP and the port number assigned to you as the remote port number to create a SSL socket that is connected to your server program.)
  6. (This step can be done simultaneously with the above step if your server program supports multithreading.) RUN and TEST your client program on your local computer, while the server program is running on cs3750a. You may either copy the truststore to your local computer or import the key certificate to a local truststore on your local computer.

 

  • HW-9-5gfvyo.zip