Skip to main content

Proof of concept of an end-to-end encrypted peer-to-peer chat program written in Python.

Project description

snakewhisper

GitHub release (latest by date) PyPI GitHub Python Version

snakewhisper is a simple end-to-end encrypted chat program written in Python. It's functional (it currently supports two-way communication with a pre-shared key), but snakewhisper is primarily a proof-of-concept that showcases how regular computer users can easily access—or even create—chat programs with end-to-end encryption.

Installation

Pip

$ pip3 install snakewhisper

Git

$ git clone https://github.com/slightlyskepticalpotat/snakewhisper.git
$ cd snakewhisper
$ pip3 -r requirements.txt

Usage

The below commands show the basic features of snakewhisper.

Generate Key

Pip

$ python3 -m snakewhisper_key

Git

$ python3 snakewhisper_key.py

Output

Key: VJM5wFYxuM1oi5VD3WBRMv4NpTnnVQA8wVNV1x4KSig=
Save? (y/n): y # type here
Save As: snakewhisper.key # type here
Saved As: snakewhisper.key

Connect/Chat

Pip

$ python3 -m snakewhisper_chat

Git

$ python3 snakewhisper_chat.py

Output

Log? (y/n): y # type here
KEY: VJM5wFYxuM1oi5VD3WBRMv4NpTnnVQA8wVNV1x4KSig= # type here
INFO: Listening on port 2048
INFO: /help to list commands
HOST: 1.1.1.1 # type here
INFO: Connected to 1.1.1.1
INFO: New connection 1.1.1.1
# now you type messages or commands
alice to bob # your message
1.1.1.1: bob to alice # their message
/help # list all commands
INFO: /alias /clear /help /ip /quit /remote /time
/help quit # describe quit command
INFO: Quits the program
/quit # quits the program
INFO: Quit successfully

Cryptography

For easy implementation, snakewhisper uses the Fernet encryption scheme from the cryptography Python package. Fernet is just AES-128 encryption with a SHA-256 hash-based message authentication code, and the full specification can be viewed here. It also adds a timestamp to the message, but snakewhisper does not use that functionality.

To-do List

  • Proper key exchange algorithm
  • Register and upload pip package
  • More than two people chatting

Contributing

Pull requests are welcome, but please open an issue to discuss major changes.

License

snakewhisper is licenced under version 3.0 of the GNU Affero General Public License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snakewhisper-0.0.1.tar.gz (16.7 kB view hashes)

Uploaded Source

Built Distribution

snakewhisper-0.0.1-py3-none-any.whl (17.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page