-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.py
More file actions
29 lines (25 loc) · 868 Bytes
/
Copy pathexample.py
File metadata and controls
29 lines (25 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
from cryptopycode.cryptopycode import CryptoModule
crypto_module = CryptoModule()
# encrypt
# read decrypted secret.py file and create encrypted secured.py file
crypto_module.create_secured_module(
path_to_opened_module=os.path.join(
os.path.abspath(os.path.dirname(__file__)), "secret.py"
),
path_to_secured_module=os.path.join(
os.path.abspath(os.path.dirname(__file__)), "secured.py"
),
create_key=True,
delete_source_opened_module=False,
)
# decrypt
# read encrypted secured.py file and create decrypted secret.py file
crypto_module.create_opened_module(
path_to_secured_module=os.path.join(
os.path.abspath(os.path.dirname(__file__)), "secured.py"
),
path_to_opened_module=os.path.join(
os.path.abspath(os.path.dirname(__file__)), "secret.py"
),
)