A small package built for my cs50p course. It includes a Peer module which provides straight forward methods to exchange messages and create/join networks
Project description
CS50P peer to peer network
A simple system to handle networking through python sockets, in a p2p style
Installation
Download PyPI library
pip install decentralized-p2p
Import the peer class in your main file
from peer import Peer
Usage/Examples
Declare a peer object with:
my_peer = Peer()
To create a new network, use the Peer.create_network method. You will need to specify your username, password, ip and eventual signature and encryption keys
my_peer.create_network("Username", "Password", "192.168.1.2", "None", "None")
In another file, call the sign up method to connect to the newly created network:
my_peer_2.signup("SecondUsername", "SecondPassword", "192.168.1.2")
Now you can send and receive messages respectivly with the .send() and .read() methods.
Features
- Asyncronous message send and receive
- Totally decentralized system, allows for wide horizontal expansion
- Asymmetrix signature implemented through ecdsa
- Asymmetric encryption implemented using fernet
Running Tests
To run tests, run the following command
pytest test_project.py
Authors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for decentralized_p2p-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e075090c5ffe1b3b3ac6cb83deaa654f5a5de9f8ea2c6dd6d42386bfd2ae2e01 |
|
MD5 | 01e29e36fcd763e4034ef8907c95dff8 |
|
BLAKE2b-256 | 230b79d64fca164f91d7581c0d5c8340d3ce30c35070f4eddc3c8f31fdd2a964 |