-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSTEGNOGRAPHER.pyw
233 lines (123 loc) · 7.04 KB
/
STEGNOGRAPHER.pyw
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
import tkinter as tk #importing tkinter module
from PIL import ImageTk, Image #importing PIL for image processing.
import tkinter.filedialog as tf
from stegano import exifHeader as stg
from tkinter import messagebox
def close_open():
window.destroy()
First_Screen()
def back_decode():
Decode_tk.destroy()
First_Screen()
def back():
Encode_tk.destroy()
First_Screen()
def Encode():
S_Screen.destroy()
global Encode_tk
Encode_tk = tk.Tk()
Encode_tk.title("Encode")
Encode_tk.geometry("700x700")
bg_img_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\bg_en.jpg")
bg_img = ImageTk.PhotoImage(bg_img_load)
bg_label = tk.Label(master= Encode_tk, image = bg_img)
bg_label.place(x = 0, y= 0)
back_button_img_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\bb.png")
back_button_img = ImageTk.PhotoImage(back_button_img_load)
back_button = tk.Button(master= Encode_tk, image = back_button_img,bd = 0,command = back)
back_button.place(x = 0,y= 2)
file_name_entry = tk.Entry(bd = 0.1)
file_name_entry.place(x = 330, y = 194,height = 30,width = 242)
message_text = tk.Text(bd = 0)
message_text.place(x = 330 , y = 260,width = 240, height = 120)
Encode_button_img_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\encode_b.png")
Encode_button_img = ImageTk.PhotoImage(Encode_button_img_load)
def openfile():
global fileopen
fileopen = tk.StringVar()
fileopen = tf.askopenfilename(initialdir = "/Desktop", title = "Select File", filetypes = (("jpeg file", "*jpg"), ("all files","*.*")))
dirlabel = tk.Entry(master = Encode_tk,bd= 0)
dirlabel.insert(0, fileopen)
dirlabel.place(x = 329, y = 402, width = 240, height = 35)
def Encodee():
response = messagebox.askyesno("pop up", "Do you want to encode?")
if response == 1:
stg.hide(fileopen, file_name_entry.get()+'..jpg',message_text.get(1.0, tk.END))
messagebox.showinfo("pop up", "Successfully encode")
else:
messagebox.showwarning('pop up', "Unsuccessful")
Encode_button = tk.Button(master=Encode_tk, image = Encode_button_img, bd = 0, command = Encodee)
Encode_button.place(x = 240, y = 520,height = 68)
select_img_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\selcet.png")
select_img = ImageTk.PhotoImage(select_img_load)
select_button = tk.Button(master=Encode_tk,image = select_img, bd = 0,relief = tk.GROOVE, command = openfile)
select_button.place(x = 160, y = 400)
Encode_tk.mainloop()
def Decode():
S_Screen.destroy()
global Decode_tk
Decode_tk = tk.Tk()
Decode_tk.title("Decode")
Decode_tk.geometry("700x700")
bg_img_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\bg_en.jpg")
bg_img = ImageTk.PhotoImage(bg_img_load)
bg_label = tk.Label(master= Decode_tk, image = bg_img)
bg_label.place(x = 0, y= 0)
back_button_img_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\bb.png")
back_button_img = ImageTk.PhotoImage(back_button_img_load)
back_button = tk.Button(master= Decode_tk, image = back_button_img,bd = 0,command = back_decode)
back_button.place(x = 0,y= 2)
file_name_entry = tk.Entry(bd = 0.1)
file_name_entry.place(x = 330, y = 194,height = 30,width = 242)
message_text = tk.Text(bd = 0)
message_text.place(x = 330 , y = 260,width = 240, height = 100)
def openfile():
global fileopen1
fileopen1 = tk.StringVar()
fileopen1 = tf.askopenfilename(initialdir = "/Desktop", title = "Select File", filetypes = (("jpeg file", "*jpg"), ("all files","*.*")))
file_name_entry.insert(0,fileopen1)
def Decodee():
message = stg.reveal(fileopen1)
message_text.insert("1.0", message)
select_img_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\selcet1.png")
select_img = ImageTk.PhotoImage(select_img_load)
select_button = tk.Button(master=Decode_tk,image = select_img, bd = .3,command = openfile)
select_button.place(x = 280, y = 130)
Decode_button_img_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\decodeb.jpg")
Decode_button_img = ImageTk.PhotoImage(Decode_button_img_load)
Decode_button = tk.Button(master=Decode_tk, image = Decode_button_img, bd = 0,command = Decodee)
Decode_button.place(x = 250, y = 520)
Decode_tk.mainloop()
def First_Screen():
global S_Screen
S_Screen = tk.Tk() #creating tkinter instance.
S_Screen.title("Steganographer By D")
S_Screen.geometry("1200x800")
S_Screen.maxsize(1200,800)
S_Screen.minsize(1200,800)
Logo_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\data-encryption.png")
Logo_image = ImageTk.PhotoImage(Logo_load)
Logo_label = tk.Label(master= S_Screen, image = Logo_image)
Logo_label.place(x = 420, y = 80)
encode_img = ImageTk.PhotoImage(file="C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\button.png")
encode_b = tk.Button(master=S_Screen, image = encode_img , bd =0, activebackground = "#d8d8d8",relief = tk.GROOVE, command = Encode)
encode_b.place(x = 230, y = 400)
decode_img = ImageTk.PhotoImage(file="C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\button (1).png")
decode_b = tk.Button(master=S_Screen, image = decode_img , bd =0, activebackground = "#d8d8d8",relief = tk.SOLID,command = Decode)
decode_b.place(x = 670 , y= 400)
S_Screen.mainloop()
window = tk.Tk()
window.title("Steganographer By D")
window.geometry("1200x800")
Background_image = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\bg.jpg")
rendered_image = ImageTk.PhotoImage(Background_image)
Background_Label = tk.Label(master=window, image = rendered_image)
greeting = tk.Label(master = window,text = "WEL-COME IN STEGANOGRPHER")
greeting.config(font = ("Courier", 44))
Close_button_image_load = Image.open("C:\\Users\\u\\Desktop\\py programmes\\Tkinter_Programmes\\Stegnographer\\click.png")
Close_button_image = ImageTk.PhotoImage(Close_button_image_load)
window_close_button = tk.Button(image = Close_button_image, bd = 0, command = close_open)
window_close_button.place(x = 460, y = 400)
greeting.place(x = 200, y = 250)
Background_Label.place(x = 0, y = -3)
window.mainloop()