{"id":15149750,"url":"https://github.com/anishvedant/end-to-end-encryption","last_synced_at":"2025-04-13T04:52:14.545Z","repository":{"id":238154147,"uuid":"793356889","full_name":"anishvedant/End-to-End-Encryption","owner":"anishvedant","description":"End-to-End Encryption with Python Socket Communication This Python project demonstrates end-to-end encryption (E2EE) using the x25519 key exchange protocol and AES encryption for secure communication between a client (Alice) and a server (Bob) over a socket connection.","archived":false,"fork":false,"pushed_at":"2024-06-07T03:41:21.000Z","size":32,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T04:52:09.603Z","etag":null,"topics":["advance-encryption-standard","aes-encryption","aes256-cbc","alice","bob","cbc-mode","client-server","communication","cryptography","end-to-end-encryption","hmac-authentication","hmac-sha256","key","key-generation","pyhton3","server","socketserver","symmetric-key-cryptography"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anishvedant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-29T04:21:34.000Z","updated_at":"2025-04-03T13:16:12.000Z","dependencies_parsed_at":"2024-06-07T04:54:15.895Z","dependency_job_id":null,"html_url":"https://github.com/anishvedant/End-to-End-Encryption","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":0.4736842105263158,"last_synced_commit":"8fe6e4d3e91360e7581439f45165e55624f91b9d"},"previous_names":["anishvedant/end-to-end-encryption"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishvedant%2FEnd-to-End-Encryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishvedant%2FEnd-to-End-Encryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishvedant%2FEnd-to-End-Encryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishvedant%2FEnd-to-End-Encryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anishvedant","download_url":"https://codeload.github.com/anishvedant/End-to-End-Encryption/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665767,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advance-encryption-standard","aes-encryption","aes256-cbc","alice","bob","cbc-mode","client-server","communication","cryptography","end-to-end-encryption","hmac-authentication","hmac-sha256","key","key-generation","pyhton3","server","socketserver","symmetric-key-cryptography"],"created_at":"2024-09-26T14:01:04.198Z","updated_at":"2025-04-13T04:52:14.526Z","avatar_url":"https://github.com/anishvedant.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# End-to-End Encryption with Python Socket Communication\n\nThis Python project demonstrates end-to-end encryption (E2EE) using the x25519 key exchange protocol and AES encryption for secure communication between a client (Alice) and a server (Bob) over a socket connection.\n\n## Key Features\n\n- **Secure Key Exchange**: Utilizes the x25519 algorithm for secure key exchange between Alice and Bob.\n- **Symmetric Encryption**: Employs AES encryption in CBC mode for symmetric encryption of messages.\n- **Message Integrity**: Verifies message integrity using HMAC to detect any tampering during transmission.\n- **Client-Server Interaction**: Implements client-server interaction with threading to handle concurrent connections securely.\n\n## Setup Instructions\n\n1. **Clone the Repository:**\n   \n   ```bash\n   git clone https://github.com/anishvedant/End-to-End-Encryption.git\n   ```\n\n2. **Install Dependencies:**\n   ```bash\n      pip install cryptography\n      pip install sockets\n   ```\n## Usage\n1. **Run the key_gen and generate a shared key:**\n   ```bash\n   python3 key_gen.py\n   ```\n   \n1. **Run the Server:**\n   ```bash\n   python3 Server.py\n   ```\n   \n2. **Run Alice's Client:**\n    ```bash\n   python3 Alice.py\n   ```\n   \n4. **Run Bob's Server:**\n   ```bash\n   python3 Bob.py\n   ```\n5. **Input the shared key generated from the key_gen.py**\n   \n6. **Follow the Prompts:**\n   Enter messages as prompted to observe the encrypted communication between Alice and Bob.\n\n## File Descriptions \n\n- **key_gen.py:** Generates public and private keys for Alice and Bob, performs key exchange, and encrypts/decrypts messages.\n- **Server.py:** Initializes the server, handles client connections, and relays encrypted messages to other clients.\n- **Alice.py:** Simulates Alice's client-side interaction. Encrypts messages and sends them to Bob, verifies message integrity.\n- **Bob.py:**  Simulates Bob's server-side interaction. Receives messages from Alice, decrypts them, and responds securely.\n\n# **How it Works**\n### *Key Generation and Exchange*\n\nThe key_gen.py script generates public and private keys for Alice and Bob using the x25519 key exchange protocol.\nKey exchange is performed between Alice and Bob to derive a shared secret key for symmetric encryption.\n\n### *Server Setup and Client Connections*\n\nThe Server.py script initializes a server that listens for incoming client connections. Each client connection is handled in a separate thread.\n\n### *End-to-End Encryption*\n\nAlice encrypts messages using AES encryption with a shared key derived from the key exchange. Messages are padded and encrypted using CBC mode with randomly generated Initialization Vectors (IVs).\nHMAC (Hash-based Message Authentication Code) is generated for each message to ensure message integrity. \nBob decrypts received messages using the shared key and verifies the HMAC for integrity.\n\n### *Client Interaction*\n\nAlice and Bob scripts simulate client-server interactions.\nThey establish connections, send encrypted messages, receive and decrypt messages, and maintain message integrity through HMAC verification.\n\n\n# **Contributing**\nContributions are welcome! Fork the repository and submit a pull request with your changes.\n\n##  :bulb:Note:\nEnsure both Alice and Bob have the same shared key for successful communication.\nThis project is for educational purposes and may require adjustments for production use.\n\n# **License**\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n# **Disclaimer**\n\nEnd-to-end encryption enhances communication security but does not guarantee absolute protection against all forms of attacks. Users are advised to understand the limitations and potential risks associated with the implementation. Use this project responsibly and in compliance with applicable laws and regulations.\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishvedant%2Fend-to-end-encryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanishvedant%2Fend-to-end-encryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishvedant%2Fend-to-end-encryption/lists"}