This Python module demonstrates a basic implementation of a secure file transfer system using Python sockets and AES encryption.
The module consists of two main components: server.py
and client.py
. These components enable secure file transfer between a server and a client using a basic encryption mechanism (AES encryption from the cryptography
library) over a network.
-
server.py
: Contains the server-side code that listens for incoming connections from clients and receives encrypted files sent by clients. It decrypts the received file and saves it asreceived_file.txt
. -
client.py
: Contains the client-side code that establishes a connection with the server, encrypts a file (file_to_send.txt
), and sends it to the server for storage.
-
Clone the repository:
git clone https://github.com/nadirhamid/file-transfer-test.git
-
Install the required library:
pip install cryptography
-
Run the server:
python server.py
-
Run the client:
python client.py
-
Verify the process:
- After running the client, the server should display a message indicating the successful receipt of the file (
received_file.txt
).
- After running the client, the server should display a message indicating the successful receipt of the file (
-
This is a basic implementation for educational purposes and doesn't cover all security aspects or error handling for a production environment.
-
Consider enhancing the codebase with more robust error handling, security measures, and additional features for a real-world application.
-
Please ensure that you have appropriate permissions for sending and receiving files in the specified directories.