-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
70 lines (64 loc) · 2.05 KB
/
main.py
File metadata and controls
70 lines (64 loc) · 2.05 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
65
66
67
68
69
70
from utils.utils import display_banner
from RSA.rsa_menu import rsa_menu
from DiffieHellman.dh_menu import dh_menu
from Caesar.caesar_menu import caesar_menu
from XOR.xor_menu import xor_menu
from AES.aes128 import aes
from Base.base import base
from ROT.rot import rot
from utils.menu_utils import display_table_menu
import sys
from utils.utils import display_banner
from Mathematics.mathematics import MathChallengeSolver
def main():
display_banner()
while True:
display_table_menu(
"A-K Cipher Tool",
[
"RSA",
"XOR Cipher",
"Caesar Cipher",
"AES",
"Diffie-Hellman",
"Base Encoding/Decoding",
"ROT",
"Mathematics",
],
)
print("9. Graphical User Interface (GUI)")
choice = input("Enter your choice (0-8, or 9 for GUI): ")
if choice == "1":
rsa_menu()
elif choice == "2":
xor_menu()
elif choice == "3":
caesar_menu()
elif choice == "4":
aes()
elif choice == "5":
dh_menu()
elif choice == "6":
base()
elif choice == "7":
rot()
elif choice == "8":
MathChallengeSolver().mathematics()
elif choice == "9":
try:
from gui.app import main as gui_main
print("Launching GUI interface...")
gui_main()
except ImportError as e:
print(f"Error: Could not import GUI module: {e}")
print("Make sure you have tkinter installed and the gui module is available.")
except Exception as e:
print(f"Error launching GUI: {e}")
elif choice == "0":
print("\nThank you for using A-K Cipher Tool! Goodbye!")
sys.exit(0)
else:
print("\nInvalid choice. Please select 0-7 or 9.")
input("\nPress Enter to continue...")
if __name__ == "__main__":
main()