Metadata-Version: 2.1
Name: decentralized-p2p
Version: 0.0.2
Summary: 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-URL: Homepage, https://github.com/NeekoKun/cs50p-project
Project-URL: Bug Tracker, https://github.com/NeekoKun/cs50p-project/issues
Author-email: NeekoKun <leonardo.riccim@gmail.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown


# CS50P peer to peer network

A simple system to handle networking through python sockets, in a p2p style

## Installation

Download PyPI library

```bash
  pip install decentralized-p2p
```

Import the peer class in your main file

```py
  from peer import Peer
```
## Usage/Examples

Declare a peer object with:

```py
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

```py
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:

```py
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

```bash
  pytest test_project.py
```


## Authors

- [@NeekoKun](https://www.github.com/NeekoKun)
- [@NeekoKun02](https://www.github.com/NeekoKun02)