Encrypted socket chat experiments.
  • C++ 54.3%
  • Python 45.7%
Find a file
2026-05-11 10:16:32 +02:00
.env.example Standardize Python project setup 2026-05-05 10:54:21 +02:00
.gitignore Standardize Python project setup 2026-05-05 10:54:21 +02:00
Client.cpp Prepare chat program repo 2026-05-05 08:27:33 +02:00
Client.py Standardize Python project setup 2026-05-05 10:54:21 +02:00
KeyGen.py Init 2024-11-15 12:39:33 +01:00
README.md Remove Codex context note from README 2026-05-11 10:16:32 +02:00
requirements.txt Standardize Python project setup 2026-05-05 10:54:21 +02:00
Server.py Standardize Python project setup 2026-05-05 10:54:21 +02:00

chat-program

Simple encrypted socket chat experiments in Python and C++.

Files

  • Server.py: TCP chat server on port 4242. 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.py is the server start file.
  • Client.py is the client start file.
  • .env.example lists the supported environment variables.
  • The Fernet key is read from CHAT_FERNET_KEY and should not be committed.