-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStorage_handler.py
executable file
·219 lines (115 loc) · 5.08 KB
/
Storage_handler.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
from SQL import DBConnect
from Fileop import File
import os , sys ,time ,sqlite3
from subprocess import call as shell
from Storage import Storage
from input_ex import input_ex
from login_db import LOG
from hashs import Hash_it
storage = Storage()
hash_it = Hash_it()
log = LOG('0')
def Help():
time.sleep(1)
print( '''
\
\xb0 -s -F_Store : STORE FILES \xb0 -d -Delete : DELETE FILES
\xb1 -f -F_Record : STORED FILES \xb1 -e -Extract : EXTRACT FILES
\xb1 -e -P_Store : STORE PASSWORDS \xb1 -Reset : RESET PASSWORD
\xb2 -o -P_Record : STORED PASSWORDS \xb2 -h -help : HELP MESSAGE
''')
def reset():
os.system("cls||clear")
UN = input_ex("\n\xb0 [?] USERNAME : ")
Old = input_ex("\n\xb0 [?] OLD PASSWORD : ")
New = input_ex("\n\xb0 [?] NEW PASSWORD : ")
chk_key = log.reset_key(UN , Old , New)
if chk_key == False :
reset()
if chk_key == 'Done.':
print ("\n\xb0 NEW PASSWORD HAS BEEN SAVED [\xfb]")
def menu():
os.system("cls||clear")
choice = input_ex( '''
\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2
\xb2 \xb2
\xb2 [\xfe] S : STORE FILES [\xfe] O : PASSWORDS RECORD \xb2
\xb2 \xb2
\xb2 [\xfe] E : EXTRACT FILES [\xfe] P : STORE PASSWORDS \xb2
\xb2 \xb2
\xb2 [\xfe] F : FILES RECORD [\xfe] R : RESET PASSWORD \xb2
\xb2 \xb2
\xb2 [\xfe] D : DELETE [\xfe] C : RESET ACCOUNT \xb2
\xb2 \xb2
\xb2 [\xfe] Q : QUIT \xb2
\xb2 \xb2
\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2
\xb0''')
if choice.upper() == "S" : storage.Store()
elif choice.upper() == "E" : storage.Extract()
elif choice.upper() == "F" : storage.Safe()
elif choice.upper() == "P" :
Memo = input_ex("\n\xb0 [?] MEMO : ")
Password = input_ex("\n\xb0 [?] PASSWORD : ")
print (storage.Passwords(Memo , Password))
elif choice.upper() == "O" : storage.Passwords_Safe()
elif choice.upper() == "D" :
user = input_ex("\n\xb0 [?] ALL \xb0 ONE : ")
storage.Delete(user)
elif choice.upper() == "R" : reset()
elif choice.upper() == "C" :
log.reset_account()
storage.Delete('*')
print ('\n\xb1 YOUR ACCOUNT HAS BEEN DELETED [\xfb]\n')
elif choice.upper() == "Q" :
os.system("cls||clear")
sys.exit()
else :
print('\n\xb2 INVALID INPUT [\xfe]')
time.sleep(2)
menu()
count = 1
def on_start(choice):
global count
os.system("cls||clear")
UN = input_ex("\n\xb0 [?] USERNAME : ")
Password = input_ex("\n\xb0 [?] PASSWORD : ")
chk = log.Check(UN = UN , getpw = Password )
if count == 3 :
os.system("cls||clear")
print ("\n TRY LATER [!] ")
time.sleep(3)
sys.exit()
if chk == "Empty." :
log.clear_key("Empty.")
print (log.Save( UN = UN ,getpw = Password ,key = hash_it.get_key()))
time.sleep(3)
menu()
if chk == True :
if choice == 'safe' : storage.Safe()
if choice == "Delete" :
user = input_ex("\n\xb0 [?] ALL \xb0 ONE : ")
storage.Delete(user)
if choice == "Store" : storage.Store()
if choice == "Ext" : storage.Extract()
if choice == 'menu' : menu()
if choice == 'Store_pw' : storage.Passwords()
if choice == 'view_pw' : storage.Passwords_Safe()
if chk == False :
count += 1
on_start(choice)
if __name__ == '__main__':
if (len(sys.argv) > 1) :
if sys.argv[1].lower() == "-f" or sys.argv[1].lower() == "-f_record" : on_start('safe')
elif sys.argv[1].lower() == "-d" or sys.argv[1].lower() == "-delete" : on_start('Delete')
elif sys.argv[1].lower() == "-s" or sys.argv[1].lower() == "-f_store" : on_start('Store')
elif sys.argv[1].lower() == "-e" or sys.argv[1].lower() == "-extract" : on_start('Ext')
elif sys.argv[1].lower() == "-e" or sys.argv[1].lower() == "-p_store" : on_start('Store_pw')
elif sys.argv[1].lower() == "-o" or sys.argv[1].lower() == "-p_record" : on_start('view_pw')
elif sys.argv[1].lower() == "-h" or sys.argv[1].lower() == "-help" : Help()
elif sys.argv[1].lower() == "-Reset" : reset()
else :
print('\n\xb2 INVALID INPUT [\xfe]')
Help()
else :
on_start('menu')