-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainUI.py
83 lines (79 loc) · 2.18 KB
/
mainUI.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
try:
import os
import wikigen
import cry_v1
except Exception:
print('Important files missed.\n\nPress ENTER to exit.')
a=input()
exit()
os.system('@title Welcome to wikicrypt')
welcome='''
wikicrypt 0.1b Author:President Bridgman
For more details, read README or visit https://www.github.com/bizwofficial/wikicrypt
MENU
1. Encrypt
2. Decrypt
3. Generate wiki-sqr
4. Exit
'''
print(welcome)
sgn=True
choi=['1','2','3','4']
conf_path='.\\config'
while sgn:
ch=input('wikicrypt>')
if ch in choi:
sgn=False
if ch==choi[0]:
pro='''
ENCRYPT
1. Use existed wiki-sqr
2. Use new wiki-sqr
'''
print(pro)
sgn=True
choi=['1','2']
while sgn:
en=input('encrypt>')
if en in choi:
sgn=False
if en==choi[0]:
file_path=input('Original File Path>')
wikisqr_path=input('Wiki-sqr Path>')
key=input('Set a key>>')
os.system('@cls')
print('Processing ...')
square=wikigen.readsqr(wikisqr_path)
osqr=cry_v1.decry_sqr(square,key)
cry_v1.cry(conf_path,file_path,osqr,key)
else:
file_path=input('Original File Path>')
wikisqr_storage_name=input('Name your new wiki-sqr>')
key=input('Set a key>>')
os.system('@cls')
print('Processing ...')
osqr=wikigen.gen()
square=cry_v1.cry_sqr(osqr,key)
wikigen.backup(conf_path,square,wikisqr_storage_name)
cry_v1.cry(conf_path,file_path,osqr,key)
elif ch==choi[1]:
file_path=input('Encrypted File Path>')
wikisqr_path=input('Wiki-sqr Path>')
key=input('Enter your key>>')
os.system('@cls')
print('Processing ...')
square=wikigen.readsqr(wikisqr_path)
osqr=cry_v1.decry_sqr(square,key)
cry_v1.decry(conf_path,file_path,osqr,key)
elif ch==choi[2]:
wikisqr_storage_name=input('Name your new wiki-sqr>')
key=input('Enter your key>>')
os.system('@cls')
print('Processing ...')
osqr=wikigen.gen()
square=cry_v1.cry_sqr(osqr,key)
wikigen.backup(conf_path,square,wikisqr_storage_name)
else:
exit()
print('Succeeded.')
a=input()