How youseffayez20/secure-communication-suite works
Purpose and Entry Points
This is a Python secure-communication coursework project combining messaging, authentication, cryptography, certificates, and local persistence. The apparent executable roles are server and client:
• server.py hosts the communication service.
• client.py connects to it and participates in secure messaging.
• main.py may provide an alternate orchestration entry point.
Legacy implementations are retained in server_old.py and client_old.py.
Client–Server Communication Boundary
The core runtime boundary is a networked client/server model. Clients submit authentication and messaging requests; the server is responsible for accepting connections, validating users, and coordinating protected communication.
• client.py
• server.py
• main.py
Transport protection is intended to use TLS/SSL and certificate material, rather than exposing cryptographic operations solely as local utilities.
Cryptographic Protection Layer
Cryptographic code is separated under crypto/, providing the primitives used to protect message confidentiality, integrity, and authenticity:
• crypto/aes.py supplies symmetric encryption for message/data confidentiality.
• crypto/rsaEnDe.py handles RSA encryption/decryption, likely for protected key exchange or asymmetric payload handling.
• crypto/hash.py provides message digest/integrity operations.
• crypto/signing.py supports signing and signature verification.
The intended flow is asymmetric cryptography or certificates to establish trust/protect keys, AES for bulk message encryption, and hashes/signatures to detect modification and authenticate content.
Certificate Authority and Trust Material
A local certificate authority subsystem supports certificate-based identity and TLS trust:
• crypto/ca.py
• crypto/certificates/ca_cert.pem
• crypto/certificates/server_cert.pem
The repository includes CA private-key material and issued certificates, including crypto/certificates/moh.crt and crypto/certificates/moh2.crt. Server key material also exists at repository root: server_private.pem and server_public.pem. These are sensitive runtime assets and form a hard trust boundary between trusted service identity and untrusted network peers.
Authentication and User Identity
Authentication is implemented separately from transport and cryptographic primitives:
• utils/auth.py
• data/auth.txt
• data/users.txt
This suggests file-backed credential/user validation. Authentication gates access to the server’s messaging or protected-service functionality; certificate mechanisms may provide an additional identity path.
Key Management
Key generation, loading, and distribution concerns are isolated in:
• utils/keys.py
• crypto/rsaEnDe.py
• crypto/certificates/
This layer bridges persistent key/certificate files and the client/server protocol. It is responsible for ensuring that encryption keys and asymmetric identities are available to the communication layer without embedding key logic directly in application flow.
Persistence and Runtime Dependencies
Local persistence appears SQLite- and file-based rather than dependent on external infrastructure:
• Database.py
• DataBase.db
• data/
Database.py likely encapsulates database access, while DataBase.db stores application state. No cloud service, message broker, web framework, or external managed identity provider is represented in the repository tree; the system runs as local Python processes with local keys, certificates, flat files, and SQLite storage.
Main entry points: server.py Server · client.py Client · auth.py Authentication · rsaEnDe.py RSA protection
Components 17
Runtime
- Client · Connects and participates in secure messaging.
client.py - Server · Accepts connections and coordinates protected communication.
server.py - Alternate entry
main.py
Security & Trust
- TLS transport · Protects client-server transport using certificate material.
- Key management · Bridges persistent asymmetric identities and the protocol.
utils/keys.py - RSA protection · Protects keys or asymmetric payloads.
crypto/rsaEnDe.py - AES encryption · Encrypts message payloads.
crypto/aes.py - Hashing & signing · Provides digests, signatures, and verification.
crypto/signing.py - Hash functions
crypto/hash.py - Certificate authority · Issues or manages trusted certificate identities.
crypto/ca.py - Certificates · CA and issued certificates used for TLS trust and identity.
- Server keypair · Sensitive private/public key material for server identity.
server_private.pem
Identity & Persistence
- Authentication · Gates access to messaging functionality.
utils/auth.py - User credentials
data/auth.txt - User records
data/users.txt - Database access
Database.py - Application state
DataBase.db
Connections 20
- Alternate entry → Client: orchestrates
- Alternate entry → Server: orchestrates
- Client → TLS transport: secure connection
- TLS transport → Server: protected requests
- Server → Authentication: authenticates
- Authentication → User credentials: validates
- Authentication → User records: loads users
- Server → Database access: persists state
- Database access → Application state: reads and writes
- Client → AES encryption: encrypts messages
- Server → AES encryption: decrypts messages
- Client → Hashing & signing: signs content
- Server → Hashing & signing: verifies content
- Hashing & signing → Hash functions: uses digests
- Key management → RSA protection: manages asymmetric keys
- Key management → Certificates: loads trust material
- Certificate authority → Certificates: issues trust material
- Certificates → TLS transport: establishes trust
- Server keypair → RSA protection: server identity
- RSA protection → AES encryption: protects session keys