Skip to content

Online File sharing service using TCP Sockets, custom security protocols, and key distribution

License

Notifications You must be signed in to change notification settings

NickPrivate/Secure-File-Sharing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure File Sharing

Table of Contents

  1. Introduction
  2. Requirements
  3. Dependencies
  4. Installation Instructions
  5. Project Overview
  6. Security Protocols
  7. Usage
  8. Contributors
  9. License

Introduction

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.

Requirements

Dependencies:

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

Installation Instructions

Clone the project to your local machine using Git.

git clone https://github.com/NickPrivate/Secure-File-Sharing

Project Overview

Low-Level Sockets Programming

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

Cryptographic Principles

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.

Concurrent Server and Database

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.

Secure Key Distribution and Encrypted File Transfer

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.

Security Protocols

Key Distribution

  1. Initial Key Exchange:
    • Sender and receiver exchange their public RSA/DSA keys.
  2. AES Key Generation:
    • The sender generates an AES key and a nonce.
  3. Encryption of AES Key:
    • The AES key and nonce are encrypted using the receiver's public RSA key.
  4. Transmission:
    • The encrypted AES key and nonce are sent to the receiver.
  5. Decryption:
    • The receiver decrypts the AES key and nonce using their private RSA key.

File Encryption and Integrity Verification

  1. File Encryption:
    • The file is encrypted using the AES key and nonce.
  2. Digital Signature:
    • The sender generates an RSA/DSA signature for the encrypted file.
  3. Transmission:
    • The encrypted file and signature are sent to the receiver.
  4. Decryption:
    • The receiver decrypts the file using the AES key.
  5. 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.

Usage

  1. Start the Indexing Server:
    • Navigate to the Server directory and run server.py
    cd src/Server
    python server.py
  2. Start User 1 (sender):
    • Navigate to user1 inside the test directory and run client.py
    cd test/user1
    python client.py
  3. Start User 2 (receiver):
    • Navigate to user2 inside the test directory and run client.py
    cd test/user2
    python client.py
    

Contributors

  • 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

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Online File sharing service using TCP Sockets, custom security protocols, and key distribution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages