This project is a simple file server system with user authentication. It uses a client-server architecture where the server can handle multiple clients. The communication between the client and the server is secured using SSL/TLS.
Here's a brief overview of what the server does:
- It listens for incoming client connections.
- When a client connects, it receives the client's username and password.
- It checks if the username exists in its database (which is a directory on the filesystem). If the username doesn't exist, it creates a new user with the provided username and password. If the username does exist, it checks if the provided password matches the stored password for that user.
- If the authentication is successful, it sends a confirmation message to the client and then waits for commands from the client. If the authentication is not successful, it sends an error message to the client.
- It supports the following commands from the client:
QUIT
: Disconnects the client.LIST
: Sends a list of files in the user's directory to the client.DOWNLOAD <filename>
: Sends the specified file to the client.UPLOAD <filename>
: Receives the specified file from the client and saves it in the user's directory.
- If an error occurs while processing a command, it sends an error message to the client.
The client does the following:
- It connects to the server and sends the username and password for authentication.
- If the authentication is successful, it waits for user input and sends the user's commands to the server. If the authentication is not successful, it prints an error message and exits.
- It handles the responses from the server based on the command that was sent.
This project uses the cryptography
library for password encryption and decryption, and the ssl
library for securing the communication between the client and the server.