ae1b0bc8 by 周伟奇

Merge branch 'master' of gitlab.situdata.com:zhouweiqi/encryption_script

2 parents 29ca3332 3ab5910c
Showing 1 changed file with 10 additions and 5 deletions
## 鉴权与保护
### 0. 运行环境
- python3
- pip install -r requirements.txt
### 1. 鉴权(服务端): verify.py
- 生成公私钥对
```
python RSA/create_keys.py
```
- 根据过期日期(必须)和MAC地址(可选, en0),通过私钥加密,生成认证文件
- help text
```
❯ python RSA/encrypt.py -h
......@@ -25,12 +30,13 @@
```
python RSA/encrypt.py -d 2021-01-12 -m 38:f9:d3:2e:c0:f3
```
- 项目使用
- 拷贝以下文件至项目
- 公钥:RSA/public.pem
- 认证文件:RSA/certification.cert
- 验证脚本:verify.py
- 使用验证脚本鉴权
- 使用验证脚本鉴权(pip install pycryptdome getmac)
```
from verify import verify
is_valid = verify(path_to_public_key, path_to_cert)
......@@ -38,13 +44,12 @@
print('verify success')
else:
print('verify failed')
```
### 2. 保护源码:py2so.py
- description
```angular2html
compile the .py to .so(Linux/Mac) or .pdy(Win)
```
- description: compile the .py to .so(Linux/Mac) or .pdy(Win)
- help text
```
❯ python py2so.py -h
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!