Secured yet simple socket server-client for interprocess communications.
Project description
Encrypted Socket
Secured yet simple socket server-client for interprocess communications.
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, private_key=kp["private_key"]).start()
print("test socket server started.", flush=True)
# # Nothing is printed, you must start it from an other thread
# client
sc = SC(public_key=kp["public_key"])
for i in range(5):
print(sc.request(command="test", data=f"Hello, {i}!"))
for i in range(5):
print(SC(bits=512).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 DH 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.5.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for encryptedsocket-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bfc732661e3194de896a7cce805828805e5f2f5fe53f09132bd695bd8fc2bd2 |
|
MD5 | 04865c311b5c363e5036a7115a59b910 |
|
BLAKE2b-256 | dcf7ceb4a7c1d21b2c897842456c30982413bffe471f1802f019a2cf5dd30049 |