Encrypted socket chat experiments.
- C++ 54.3%
- Python 45.7%
| .env.example | ||
| .gitignore | ||
| Client.cpp | ||
| Client.py | ||
| KeyGen.py | ||
| README.md | ||
| requirements.txt | ||
| Server.py | ||
chat-program
Simple encrypted socket chat experiments in Python and C++.
Files
Server.py: TCP chat server on port4242. Receives Fernet-encrypted messages and broadcasts them to the other clients.Client.py: Python client that connects to the configured server and sends/receives encrypted messages.Client.cpp: C++ client experiment.KeyGen.py: helper for generating a Fernet key.
Requirements
- Python 3.x
cryptography
Install the Python dependency with:
pip install -r requirements.txt
Usage
Generate a Fernet key:
python KeyGen.py
Export the key before starting server and client:
export CHAT_FERNET_KEY="paste-generated-key-here"
Start the server:
python Server.py
Start one or more clients:
python Client.py
Type messages in the client terminal. Use exit to close a client.
Notes
Server.pyis the server start file.Client.pyis the client start file..env.examplelists the supported environment variables.- The Fernet key is read from
CHAT_FERNET_KEYand should not be committed.