- Introduction
- Requirements
- Dependencies
- Installation Instructions
- Project Overview
- Security Protocols
- Usage
- Contributors
- License
This project demonstrates a secure file-sharing system implemented in Python. It covers various topics such as low-level socket programming, cryptographic principles, concurrent server architecture, and secure key distribution. The project aims to provide a comprehensive learning experience for those interested in secure communication and file transfer.
- Python 3
Install the following Python libraries using pip
:
pip install cryptography
pip install pycryptodome
pip install pysqlite3
pip install tqdm
pip install prettytable
pip install bcrypt
Clone the project to your local machine using Git.
git clone https://github.com/NickPrivate/Secure-File-Sharing
This project involves both the indexing server and Peer-to-Peer (P2P) file transfer using Python sockets. The implementation covers:
- Establishing TCP connections
- Handling multiple connections concurrently using threading
- Custom protocols for file transfer and communication
The project incorporates several cryptographic techniques to ensure secure file transfer:
- Asymmetric Encryption (RSA): Used for encrypting the AES key and verifying digital signatures.
- Symmetric Encryption (AES): Used for encrypting the file contents.
- Digital Signature (RSA/DSA): Used for verifying the integrity and authenticity of the transferred files.
The indexing server is designed to handle multiple peer connections simultaneously. It uses:
- SQLite for managing file metadata and user information.
- Threading for handling concurrent connections and database operations.
The project implements a secure key distribution mechanism and encrypted file transfer protocol:
- Key Distribution: AES key and nonce are encrypted with the receiver's RSA public key.
- File Encryption: The file is encrypted using AES.
- File Transfer: Custom socket protocols are used for transmitting the encrypted file and keys.
- Initial Key Exchange:
- Sender and receiver exchange their public RSA/DSA keys.
- AES Key Generation:
- The sender generates an AES key and a nonce.
- Encryption of AES Key:
- The AES key and nonce are encrypted using the receiver's public RSA key.
- Transmission:
- The encrypted AES key and nonce are sent to the receiver.
- Decryption:
- The receiver decrypts the AES key and nonce using their private RSA key.
- File Encryption:
- The file is encrypted using the AES key and nonce.
- Digital Signature:
- The sender generates an RSA/DSA signature for the encrypted file.
- Transmission:
- The encrypted file and signature are sent to the receiver.
- Decryption:
- The receiver decrypts the file using the AES key.
- Integrity Verification:
- The receiver verifies the file's integrity using the RSA/DSA signature. If verification fails, the download is canceled; if it succeeds, the file is downloaded.
- Start the Indexing Server:
- Navigate to the
Server
directory and runserver.py
cd src/Server python server.py
- Navigate to the
- Start User 1 (sender):
- Navigate to
user1
inside thetest
directory and runclient.py
cd test/user1 python client.py
- Navigate to
- Start User 2 (receiver):
- Navigate to
user2
inside thetest
directory and runclient.py
cd test/user2 python client.py
- Navigate to
- Katherine Joy Guardiano - Architecture Design
- Allen Dai - Tools and Project Testing
- Andy Huynh - Security Protocol Designer
- Nick Goulart - Implementation and Key Distribution
- Dylan Zuniga - Database Modeling and Queries
This project is licensed under the MIT License - see the LICENSE file for details.