# Encrypted Socket
<badges>[![version](https://img.shields.io/pypi/v/encryptedsocket.svg)](https://pypi.org/project/encryptedsocket/)
[![license](https://img.shields.io/pypi/l/encryptedsocket.svg)](https://pypi.org/project/encryptedsocket/)
[![pyversions](https://img.shields.io/pypi/pyversions/encryptedsocket.svg)](https://pypi.org/project/encryptedsocket/)
[![donate](https://img.shields.io/badge/Donate-Paypal-0070ba.svg)](https://paypal.me/foxe6)
[![powered](https://img.shields.io/badge/Powered%20by-UTF8-red.svg)](https://paypal.me/foxe6)
[![made](https://img.shields.io/badge/Made%20with-PyCharm-red.svg)](https://paypal.me/foxe6)
</badges>
<i>Secured yet simple socket server-client for interprocess communications with RSA and AES.</i>
# Hierarchy
```
encryptedsocket
|---- SS()
| |---- start()
| '---- stop()
'---- SC()
'---- request()
```
# Example
## python
```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
```shell script
```
PyPI 官网下载 | encryptedsocket-0.6.1.tar.gz
版权申诉
65 浏览量
2022-01-11
03:26:24
上传
评论
收藏 4KB GZ 举报
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
最新资源
- 6_Advertising-gd_LearningRate.ipynb
- BrushNet电商公司和摄影公司都在用的AI工作流
- 12_base.apk
- 520马上到了两款动态爱心表白HTML代码(附源码)李峋同款爱心,快送给你爱的她或(他)吧12 情侣纪念日代码.zip
- 电子设计竞赛的单相不间断电源设计
- cutcamera1715961370938.png
- 基于MATLAB的图像处理课程设计报告.doc
- tensorflow-gpu-2.6.0-cp38-cp38-manylinux2010-x86-64.whl
- mmexport1715960553858.png
- tensorflow-gpu-2.6.0-cp37-cp37m-manylinux2010-x86-64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈