Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**IN C++** In this project, you are required to use network protocols to implement a pair of client and server that can achieve simple password

**IN C++** In this project, you are required to use network protocols to implement a pair of client and server that can achieve simple password verification. Your client will send a pair of username and password to your server and your server will verify whether the pair of username and password is legitimate or not. Assume the only legitimate pairs of usernames and passwords that will be accepted by your server are as follows.

username password
Alice aaaaaaaaaa
Bob bbbbbbbbbb
Cindy cccccccccc
David dddddddddd
Eve eeeeeeeeee
Frank ffffffffff
George gggggggggg

1. Your program for client needs to take two arguments that specify the name of server and the port that it is trying to connect to. Your program for server needs to take an argument that specifies the port that it is listening to.

2. Your server will start first and keep listening to the specified port. Your client will connect to the port that

your server is listening to, and a socket between your client and server is constructed.

3.Your client will first prompt a welcome message that asks the user to enter a username using the keyboard. This username will then be sent to the server. Then, your server, after receiving the username from your client, will send an acknowledgment message to the client.

4.Your client, after receiving the acknowledgment message from your server, will prompt a message that asks the user to enter the corresponding password. This password will then be sent to the server. Then, your server, after receiving the password from your client, will verify the received pair of username and password against the list of legitimate pairs. If the result is positive, the server will send a success message to the client. If the result is negative, the server will send a failure message to the client

5.Your client, after receiving the result message, will print out the result and close the socket. Your server

will close the socket following the client, and keep listening for the next client request.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

Question 1 (a2) What is the reaction force Dx in [N]?

Answered: 1 week ago

Question

Describe the major barriers to the use of positive reinforcement.

Answered: 1 week ago