This repository contains a Python implementation of a simplified version of the Signal Protocol, developed as a term project for CS411. The project demonstrates secure key management, forward secrecy, deniability, and end-to-end encrypted communication.
The implementation is inspired by the Signal Protocol and uses elliptic curve cryptography (Ed25519), modern hash functions, and authenticated encryption primitives.
- Identity Key (IK) generation and registration
- Signed Pre-Key (SPK) generation and verification
- One-Time Pre-Key (OTK) generation and lifecycle management
- Secure session establishment using X3DH
- Post-Quantum X3DH (PQXDH) support
- Forward secrecy via one-time keys and KDF chains
- Authenticated encryption using AES-256-CTR and HMAC-SHA256
- Secure asynchronous client-to-client messaging
- Conference key establishment for group communication
Handles public key registration, including identity keys, signed pre-keys, and one-time pre-keys.
Implements secure messaging, session key derivation, message encryption and decryption, integrity verification, and OTK management.
Extends the protocol with conference key establishment and post-quantum secure communication using PQXDH.
- Long-term keys are never used directly for message encryption
- Each message block derives fresh encryption and authentication keys
- One-time pre-keys are consumed exactly once
- Message integrity and authenticity are enforced using HMAC and digital signatures
- All sensitive key material is stored locally and excluded from version control
- Python 3.x
- Cryptographic libraries as specified in the course documentation
- Network access to the project server (VPN required when off-campus)
This project interacts with a remote server for key registration and message exchange. Keys must be generated and registered in the correct order, and protocol phases should be executed sequentially as specified in the assignment.
This implementation is not production-ready and should not be used for real-world secure communication.