Secured yet simple socket server-client for interprocess communications with RSA and AES.
Project description
Encrypted Socket
Secured yet simple socket server-client for interprocess communications with RSA and AES.
Hierarchy
encryptedsocket
|---- SS()
| |---- start()
| '---- stop()
'---- SC()
'---- request()
Example
python
# You can transmit objects as long as
# both sides have access to their classes
from encryptedsocket import *
from easyrsa import *
# prepare rsa key pair
kp = EasyRSA(bits=1024).gen_key_pair()
# server
def test(data):
return f"Data:\t{data}"
functions = dict(test=test)
SS(functions=functions, key_pair=kp).start()
print("test socket server started.", flush=True)
# # Nothing is printed, you must start it from an other thread
# client
sc = SC()
for i in range(5):
print(sc.request(command="test", data=f"Hello, {i}!"))
for i in range(5):
print(SC().request(command="test", data=f"Hello, {i}!"))
print("test socket client started.", flush=True)
# # both for loops produce same result
# # while the later one uses a new key in each loop
# Data: Hello, 0!
# Data: Hello, 1!
# Data: Hello, 2!
# Data: Hello, 3!
# Data: Hello, 4!
# test socket client started.
shell
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
encryptedsocket-0.7.0.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for encryptedsocket-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1003269c3fb5a9465b0e69f85d1072ca5fccf404a606094838d6e768eb589c53 |
|
MD5 | abc8da8757f5524a2a86555ef1ccd197 |
|
BLAKE2b-256 | d4c5c55caf9cd6b3a7f2f83cebf40d4413fc26bbe2c87d2a8532c4d9172ba1c1 |