-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFile_Encoder.py
More file actions
64 lines (49 loc) · 2.38 KB
/
File_Encoder.py
File metadata and controls
64 lines (49 loc) · 2.38 KB
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
from DirectoryEncoderOrDecoder import Total_files, Total_UnEncryptable_Files, dir_decrypt, dir_encrypt, dir_search,dir_encrypt_test
def front_face_code():
request = input("Decrypt or Encrypt or Search?: ")
request=request.lower()
if(request == "decrypt" or request == 'd'):
user_dir= input("Enter your file directory to Decrypt: ")
try:
dir_decrypt(user_dir)
print(f"Total Files Decrypted = {len(Total_files)}")
except:
print("Something went wrong!")
elif(request == 'encrypt' or request == 'e'):
test_request = input("Do you want to 'Check For Success' before executing Encryption? (Y/N): ")
test_request = test_request.lower()
try:
if(test_request =='n'):
warning = input("Warning: Encryption is being executed without test. Enter 'Y' to continue or 'N' to go back: ")
if(warning.lower()=='y'):
user_dir = input("Enter your directory to Encrypt: ")
dir_encrypt(user_dir)
print(f"Total Files Encrypted = {len(Total_files)}")
if(warning.lower()=='n'):
front_face_code()
elif(test_request == 'y'):
user_dir = input("Enter your directory to Encrypt to 'Check For Success': ")
dir_encrypt_test(user_dir)
print(f"Total Files ={len(Total_files)}")
print(f"Total UnEncryptable Files = {len(Total_UnEncryptable_Files)}")
if(len(Total_UnEncryptable_Files)>0):
print("\n\t\t\t\tXXXXX UNSAFE TO PERFORM ENCRYPTION HERE XXXX\n")
else:
print("\n\t\t\t\t🗸🗸🗸🗸 SAFE TO PERFORM ENCRYPTION 🗸🗸🗸🗸🗸\n")
else:
print("Please Enter a Valid Option")
front_face_code()
except:
print("Something went wrong")
elif(request == 'search' or request == 's'):
user_dir = input("Enter your file directory to Search: ")
try:
dir_search(user_dir)
print(f"Total Files = {len(Total_files)}")
except:
print("Something Went Wrong")
else:
print("\nPlease Enter valid request from | Encrypt | Decrypt | Search |")
front_face_code()
if __name__ =="__main__":
front_face_code()