-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
67 lines (59 loc) · 2.53 KB
/
main.py
File metadata and controls
67 lines (59 loc) · 2.53 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
import subprocess
import tkinter as tk
def main():
title.config(text='Please select your preferred cipher method')
Button1.config(text='Cesar', command=cesar, padx=10, pady=10)
Button12.config(text='Cesar cryptanalyse', command=cryptanalyse, padx=10, pady=10)
Button2.config(text='Vigenere', command=vigenere, padx=10, pady=10)
Button22.config(text='Vigenere cryptanalyse', command=cryptanalyse_vigenere, padx=10, pady=10)
Button3.config(text='Hill', command=hill, padx=10, pady=10)
Button4.config(text='Affine', command=affine, padx=10, pady=10)
Button5.config(text='RSA', command=RSA, padx=10, pady=10)
def cesar():
script_path = 'cesar.py'
subprocess.Popen(['python', script_path], shell=True)
#call(["python3", "cesar.py"]) if you're on linux uncomment the this line and comment the line above
def vigenere():
script_path = 'vigenere.py'
subprocess.Popen(['python', script_path], shell=True)
#call(["python3", "vigenere.py"])
def hill():
script_path = 'hill.py'
subprocess.Popen(['python', script_path], shell=True)
#call (["python3", "hill.py"])
def affine():
script_path = 'affine.py'
subprocess.Popen(['python', script_path], shell=True)
#call (["python3", "affine.py"])
def RSA():
script_path = 'RSA.py'
subprocess.Popen(['python', script_path], shell=True)
#call (["python3", "RSA.py"])
def cryptanalyse():
script_path = 'cryptanalyse_caesar.py'
subprocess.Popen(['python', script_path], shell=True)
#call (["python3", "cryptanalyse_caesar.py"])
def cryptanalyse_vigenere():
script_path = 'cryptanalyse_vigenere.py'
subprocess.Popen(['python', script_path], shell=True)
#call (["python3", "cryptanalyse_vigenere.py"])
window = tk.Tk()
window.title('Cryptography')
title = tk.Label(master=window, text='', font='Cairo')
title.pack()
Button1 = tk.Button(master=window, text='', width=20, height=1, font='Cairo')
Button1.pack(pady=5)
Button12 = tk.Button(master=window, text='', width=20, height=1, font='Cairo')
Button12.pack(pady=5)
Button2 = tk.Button(master=window, text='', width=20, height=1, font='Cairo')
Button2.pack(pady=5)
Button22 = tk.Button(master=window, text='', width=20, height=1, font='Cairo')
Button22.pack(pady=5)
Button3 = tk.Button(master=window, text='', width=20, height=1, font='Cairo')
Button3.pack(pady=5)
Button4 = tk.Button(master=window, text='', width=20, height=1, font='Cairo')
Button4.pack(pady=5)
Button5 = tk.Button(master=window, text='', width=20, height=1, font='Cairo')
Button5.pack(pady=5)
main()
window.mainloop()