-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.py
47 lines (33 loc) · 1.29 KB
/
main.py
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
import LSB as lsb
import AES as Cipher
import os
def main():
select = input("Enter E for Encoding D for Decoding :")
if select == 'E':
if os.path.exists("out.txt"):
os.remove("out.txt")
if os.path.exists("pls.txt.enc"):
os.remove("pls.txt.enc")
if os.path.exists("pls.txt"):
os.remove("pls.txt")
if os.path.exists("images/out1.png"):
os.remove("images/out1.png")
if os.path.exists("images/in1.png"):
secretMessage = input("Enter the secret message :")
passwordText = input("Password :")
encodedMessage = Cipher.encrypt(secretMessage, passwordText)
print(encodedMessage)
lsb.LsbEncoding(encodedMessage)
if os.path.exists("pls.txt"):
os.remove("pls.txt")
else : print("Image is not Present")
if select == 'D':
if os.path.exists("pls.txt.enc"):
decodedText = lsb.LsbDecoding()
print(decodedText)
password = input("Enter the password :")
finalMessage = Cipher.decrypt(decodedText, password)
print("Final message :", finalMessage)
else :
print("PLS file is not present !")
main()