Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
encryption_script
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ae1b0bc8
authored
2021-01-12 16:48:20 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of gitlab.situdata.com:zhouweiqi/encryption_script
2 parents
29ca3332
3ab5910c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
README.md
README.md
View file @
ae1b0bc
## 鉴权与保护
### 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
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment