-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathencUI.py
More file actions
86 lines (59 loc) · 1.9 KB
/
encUI.py
File metadata and controls
86 lines (59 loc) · 1.9 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
from tkinter import *
from tkinter import filedialog
import os
import encryption
import database
from datetime import date
todayDate = str(date.today())
def choose_File():
filename = filedialog.askopenfilename()
entry1.insert(0,str(filename))
def performEncryption():
filePath = entry1.get()
fileNameArr = filePath.split("/")
file_name = fileNameArr[len(fileNameArr)-1]
print(file_name)
iterations_str = entry2.get()
iterations = int(iterations_str)
email = entry3.get()
encryption.inputImg(file_name, iterations, email)
database.insert(email, todayDate)
def view_history():
list1.delete(0,END)
for row in database.view():
list1.insert(END,row)
def delete_command():
database.delete()
window = Tk()
Frame1 = Frame(window)
Frame1.pack(side=TOP)
Frame2 = Frame(window)
Frame2.pack(side=TOP)
Frame3 = Frame(window)
Frame3.pack(side=TOP)
Frame4 = Frame(window)
Frame4.pack(side=TOP)
label_1 = Label(Frame1, text ="Image to be Encrypted : ",width = 100)
entry1 = Entry(Frame1,width =100)
button1 = Button(Frame1, text = "Select Image",command = choose_File)
label_2 = Label(Frame2,text = " No. Of Iterations:")
entry2 = Entry(Frame2, width = 45)
label_3 = Label(Frame3,text = "Enter Email address:")
email_text = StringVar()
entry3 = Entry(Frame3, textvariable=email_text, width = 45)
button2 = Button(window, text="Perform Encryption", command=performEncryption, width=20)
button3 = Button(window, text="History", command=view_history)
button4 = Button(window, text="Delete History", command=delete_command)
list1=Listbox(window, height=8,width=100)
label_1.pack()
entry1.pack()
button1.pack()
label_2.pack(side=LEFT)
entry2.pack(side=LEFT)
label_3.pack(side=LEFT)
entry3.pack(side=LEFT)
button2.pack()
button3.pack()
list1.pack()
button4.pack()
window.mainloop()