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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decentralized_p2p-0.0.2.tar.gz.
File metadata
- Download URL: decentralized_p2p-0.0.2.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64730819f20cea2a2237c95fb4b920ff14165f4a7892164353ff69ff17d2aa71
|
|
| MD5 |
39934c0b67cf36c9ee949fa691e0c142
|
|
| BLAKE2b-256 |
d801688b5677a39d60c45268ae05f5b285643a34142185b1a42f70e0173272a8
|
File details
Details for the file decentralized_p2p-0.0.2-py3-none-any.whl.
File metadata
- Download URL: decentralized_p2p-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e075090c5ffe1b3b3ac6cb83deaa654f5a5de9f8ea2c6dd6d42386bfd2ae2e01
|
|
| MD5 |
01e29e36fcd763e4034ef8907c95dff8
|
|
| BLAKE2b-256 |
230b79d64fca164f91d7581c0d5c8340d3ce30c35070f4eddc3c8f31fdd2a964
|