A simple client/server system that transfers files over TCP sockets and verifies their integrity using SHA-256 hashes.
- Upload: the client sends a file to the server. The server saves it
under
storage/, calculates its SHA-256 hash, and stores that hash inhashes.json. - Download: the client requests a file back. The server re-calculates
the hash of the stored file and reports whether it still matches the
hash recorded at upload time (
MATCH/MISMATCH). The client then calculates its own hash of the downloaded copy and confirms it matches what the server sent (VALID/CORRUPTED). - Threading: the server spawns one thread per connected client
(
threading.Thread), so multiple uploads/downloads can happen at the same time without blocking each other.
Terminal 1 (start the server):
cd file_integrity_system
python server.pyTerminal 2 (client commands):
cd file_integrity_system
python client.py upload path/to/some_file.txt
python client.py list
python client.py download some_file.txtNo external dependencies — everything uses the Python standard library
(socket, threading, hashlib, json).
server.py—FileServer(accepts connections) andHashStore(thread-safe hash database).client.py—FileClient(upload / download / list).common.py— shared SHA-256 helper functions.
- Add a
tkinterGUI with a drag-and-drop upload area and a progress bar. - Add TLS (
sslmodule) to encrypt the connection itself. - Add resumable/chunked transfer for very large files.