Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/casper64/hai
The 100% console based messaging program using the cryptography library in python; a project I made for my cryptograpghy course.
https://github.com/casper64/hai
cryptography python sockets
Last synced: 3 days ago
JSON representation
The 100% console based messaging program using the cryptography library in python; a project I made for my cryptograpghy course.
- Host: GitHub
- URL: https://github.com/casper64/hai
- Owner: Casper64
- License: mit
- Created: 2023-12-17T23:18:55.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-08-09T21:47:41.000Z (3 months ago)
- Last Synced: 2024-08-09T22:49:15.146Z (3 months ago)
- Topics: cryptography, python, sockets
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Readme
The 100% console based messaging program using the `cryptography` library in python; a project I made for my cryptograpghy course.
This code is probably not 100% secure, please only use it for educational purposes.
All the core functionality of the program are in `hai_core.py`
## Features
- Console based
- Supports multiple chats at the same time (using non-blocking sockets)
- Custom handshake based on TLS
- Supports elliptic curve keys
- Hmac validates messages (iv's are never reused)
- Error messages for invalid / unvalidates messages> **Note**:
> Public key verification using a CA not implemented.## Quick Start
This program was developed and tested using python `3.11.6`.
Make a new virtual environment and instal the required packages
```bash
python3 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt
```Then start the program in `hai.py`.
```bash
python3 hai.py
```## Settings
You can configure the program in `hai.py`.
## Key generation
Keys will be automatically generated. You can generate your own keys using
the `create_keys.sh` program.
```bash
chmod +x create_keys.sh
./create_keys.sh
```Then change the `PRIVATE_KEY` and `PUBLIC_KEY` settings in `settings.py`.
> **Note:**
> Keys have to be encoded in PEM format and use an elliptic curve.