Spex3
    

Development of a Secure File-Sharing System Using End-to-End Encryption


    

Development of a Secure File-Sharing System Using End-to-End Encryption
Abstract
Secure file sharing remains a critical challenge as organizations increasingly collaborate across distributed environments while facing threats from unauthorized interception, data breaches, and insider compromise. Traditional cloud storage solutions encrypt data at rest but retain access to encryption keys, leaving plaintext vulnerable to server-side compromise. This project presents the design and development of a secure file-sharing system that implements true end-to-end encryption (E2EE) using a hybrid cryptographic architecture. The system employs AES-256-GCM for authenticated file encryption, ECDH P-256 for ephemeral key agreement, and ECDSA for digital signatures, ensuring that plaintext data never leaves the user's device. A three-message key exchange protocol with forward secrecy protects session establishment, while client-side encryption using the Web Crypto API eliminates server-side key exposure. File content is encrypted in 64KB chunks before transmission, with metadata encryption and replay protection through nonce, timestamp, and sequence validation. The system provides a web-based interface for file upload, encrypted sharing, and authorized download, with user-based access control requiring sender approval and secure QR code sharing for key distribution. Experimental evaluation demonstrates strong cryptographic security properties including MITM resistance, forward secrecy, and zero-knowledge server architecture, with acceptable performance overhead for typical file-sharing operations.
Keywords: End-to-End Encryption; Secure File Sharing; AES-256-GCM; ECDH Key Exchange; Web Crypto API; Forward Secrecy
________________________________________
Chapter 1: Introduction
1.1 Research Background
In the age of remote collaboration, secure file sharing has become a fundamental requirement for individuals, enterprises, and government agencies. However, many online sharing platforms fail to provide adequate protection, leaving sensitive data vulnerable to interception, unauthorized access, and server-side compromise . Cloud file sharing has experienced explosive growth, yet most available solutions fall short in terms of strong encryption and tight access controls, placing important data at risk of hacking and unauthorized access .
Traditional encryption approaches, including transport-layer security (TLS), protect data in transit but decrypt it at the server for storage. This creates a fundamental trust asymmetry: the service provider possesses plaintext access to all user data. Even when providers claim to encrypt data at rest, they typically control the encryption keys, meaning a compromised server or malicious insider can access user files .
End-to-end encryption (E2EE) addresses this limitation by ensuring that data is encrypted on the sender's device and can only be decrypted by the intended recipient. The server acts as a blind relay, storing and forwarding ciphertext without ever possessing the decryption keys or plaintext data. This architecture provides cryptographic guarantees against server compromise, unauthorized access, and insider threats .
The challenge lies in implementing E2EE file sharing with adequate security properties while maintaining usability and performance. Key management, forward secrecy, replay protection, and user-friendly key distribution require careful design to prevent security gaps .
1.2 Problem Statement
Current secure file-sharing systems face several critical challenges:
Server-Side Key Exposure: Most cloud storage services encrypt data at rest but retain encryption keys, meaning server compromise exposes all user data. True E2EE requires that keys never leave user devices .
Key Distribution Complexity: Secure sharing requires recipients to obtain decryption keys through secure channels. Without proper key exchange protocols, users may transmit keys alongside encrypted files, defeating the purpose of encryption .
Replay and MITM Attacks: Without proper protocol design, encrypted communications remain vulnerable to man-in-the-middle attacks where adversaries substitute keys, and replay attacks where captured transmissions are re-injected .
Forward Secrecy: Compromise of long-term keys should not expose past session data. Systems without ephemeral key agreement fail to provide this property .
Usability Barriers: Complex security configurations deter adoption. Users need intuitive interfaces for secure key distribution, recipient approval, and access revocation .
1.3 Research Objectives
This project aims to design and implement a secure file-sharing system that:
1. Implements true end-to-end encryption where plaintext never leaves the user's device, using client-side AES-256-GCM encryption via the Web Crypto API .
2. Establishes session keys through an authenticated three-message key exchange protocol using ECDH P-256 and ECDSA signatures .
3. Provides forward secrecy through ephemeral key agreement, ensuring past sessions remain secure even if long-term keys are compromised .
4. Implements replay protection through nonce, timestamp, and sequence validation to prevent captured transmission re-injection .
5. Delivers a user-friendly web interface supporting encrypted file upload, recipient approval, secure key sharing via QR code, and one-click access revocation .
1.4 Thesis Structure
This thesis comprises five chapters. Chapter 1 introduces research background and objectives; Chapter 2 reviews related work in E2EE file sharing, key exchange protocols, and cryptographic best practices; Chapter 3 presents system design; Chapter 4 describes implementation details; Chapter 5 concludes and discusses future work.
________________________________________
Chapter 2: Literature Review
2.1 End-to-End Encryption Architectures
End-to-end encryption ensures that data remains confidential throughout its lifecycle, with encryption and decryption occurring exclusively at endpoint devices. Recent research presents a secure file sharing portal implementing E2EE with user-based access controls operating entirely within a web browser . The system uses the Web Crypto API to provide local encryption using AES-GCM, ensuring that plaintext documents do not leave the user's device .
A critical aspect of E2EE file sharing is the separation of file and key distribution. Receiving the encrypted file is insufficient for access; the recipient must also obtain the decryption key through a separate secure channel. This dual-distribution requirement prevents server-side access even if the encrypted file is intercepted .
2.2 Key Exchange Protocols
Secure key establishment forms the foundation of E2EE systems. The Messaging Layer Security (MLS) protocol provides a framework for group key management in file-sharing contexts. Before uploading an object, both content and filename are encrypted using a fresh key generated from a cryptographically secure random source. The key is then distributed to authorized devices through MLS groups .
A proposed three-message key exchange protocol (CryptShare-KEX) implements authenticated key exchange using ECDSA signatures. All key exchange messages are signed with ECDSA P-256, and the receiver verifies signatures using the peer's known identity public key. If signature validation fails, the key exchange aborts and alerts the user, preventing man-in-the-middle attacks where adversaries attempt to substitute keys .
Elliptic Curve Diffie-Hellman (ECDH) with P-256 provides 128-bit equivalent security for key agreement, while HKDF-SHA256 derives session keys from the shared secret . This approach provides forward secrecy, as session keys are unique to each connection and ephemeral keys ensure past sessions remain secure even if long-term keys are compromised .