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 start an unencrypted socket server
# if you know what you are doing
# SS(host="remote ip", port=12321, encrypted=False)
# SC(host="remote ip", port=12321, encrypted=False)
# You can transmit objects as long as
# both sides have access to their classes
from encryptedsocket import *
# server
def test(data):
return f"Data:\t{data}"
functions = dict(test=test)
SS(functions=functions).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(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
rem encryptedsocket.exe {server|client}
rem echo test server-client example
encryptedsocket.exe server
encryptedsocket.exe client
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.4.2.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for encryptedsocket-0.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a448de68c7f9ba69270e521548b7df04903d86a59e239be4824471fe8d4b4bc |
|
MD5 | d4a28b068c8ec403292e5a9b26fb6678 |
|
BLAKE2b-256 | 48caf5bf2d88aece20d480527d17f6054cb4557985f239e0fbc14355dd43db55 |