Add to this code & apply in it, hashing for Confidentiality service or Username & password for Authentication service (JAVA code) server side class initializes socket, establishes connection with socket.accept method, read string and close the connection. but this code Doesn't it implement authentication and confidentiality services, so you should ADD IT in this codes below Server class import java.net.*; import java.io.*; public class TestServer { public static void main(String[] args){ try{ ServerSocket ss=new ServerSocket(8088); Socket s=ss.accept(); DataInputStream DataInput=new DataInputStream(s.getInputStream()); String str=(String)DataInput.readUTF(); System.out.println("message= "+str); ss.close(); }catch(Exception e){System.out.println(e);} } } client class import java.io.*; import java.net.*; public class TestClient { public static void main(String[] args) { try{ Socket s=new Socket("localhost",8088); DataOutputStream output=new DataOutputStream(s.getOutputStream()); output.writeUTF("Hello Server! How are you doing?"); output.flush(); output.close(); s.close(); }catch(Exception e){System.out.println(e);} } } .
Add to this code & apply in it, hashing for Confidentiality service or Username & password for Authentication service (JAVA code)
server side class initializes socket, establishes connection with socket.accept method, read string and close the connection.
but this code Doesn't it implement authentication and confidentiality services, so you should ADD IT in this codes below
Server class
import java.net.*;
import java.io.*;
public class TestServer {
public static void main(String[] args){
try{
ServerSocket ss=new ServerSocket(8088);
Socket s=ss.accept();
DataInputStream DataInput=new DataInputStream(s.getInputStream());
String str=(String)DataInput.readUTF();
System.out.println("message= "+str);
ss.close();
}catch(Exception e){System.out.println(e);}
}
}
client class
import java.io.*;
import java.net.*;
public class TestClient {
public static void main(String[] args) {
try{
Socket s=new Socket("localhost",8088);
DataOutputStream output=new DataOutputStream(s.getOutputStream());
output.writeUTF("Hello Server! How are you doing?");
output.flush();
output.close();
s.close();
}catch(Exception e){System.out.println(e);}
}
} .
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 8 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)