├── Output process.docx ├── Project Report.docx ├── README.md └── encoder.py /Output process.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiran-lungade/message-encryption_project/786d10797d12be735cf0001c6d86cf9f7c798f0e/Output process.docx -------------------------------------------------------------------------------- /Project Report.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiran-lungade/message-encryption_project/786d10797d12be735cf0001c6d86cf9f7c798f0e/Project Report.docx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # message-encryption_project 2 | Python based project for message encryption and decryption for the security of the data. 3 | -------------------------------------------------------------------------------- /encoder.py: -------------------------------------------------------------------------------- 1 | ##importing mmodules 2 | from tkinter import * 3 | import base64 4 | 5 | #initialize window 6 | root = Tk() 7 | root.geometry('500x300') 8 | root.resizable(0,0) 9 | 10 | #title of the window 11 | root.title("SANJIVANI - Message Encode and Decode") 12 | 13 | #label 14 | Label(root, text ='ENCODE DECODE', font = 'algerian 20 bold').pack() 15 | Label(root, text ='Group 2', font = 'aharoni 20 bold').pack(side =BOTTOM) 16 | 17 | #define variables 18 | Text = StringVar() 19 | private_key = StringVar() 20 | mode = StringVar() 21 | Result = StringVar() 22 | 23 | #######define function##### 24 | #function to encode 25 | def Encode(key,message): 26 | enc=[] 27 | for i in range(len(message)): 28 | key_c = key[i % len(key)] 29 | enc.append(chr((ord(message[i]) + ord(key_c)) % 256)) 30 | 31 | return base64.urlsafe_b64encode("".join(enc).encode()).decode() 32 | 33 | #function to decode 34 | def Decode(key,message): 35 | dec=[] 36 | message = base64.urlsafe_b64decode(message).decode() 37 | for i in range(len(message)): 38 | key_c = key[i % len(key)] 39 | dec.append(chr((256 + ord(message[i])- ord(key_c)) % 256)) 40 | 41 | return "".join(dec) 42 | 43 | #function to set mode 44 | def Mode(): 45 | if(mode.get() == 'e'): 46 | Result.set(Encode(private_key.get(), Text.get())) 47 | elif(mode.get() == 'd'): 48 | Result.set(Decode(private_key.get(), Text.get())) 49 | else: 50 | Result.set('Invalid Mode') 51 | 52 | #Function to exit window 53 | def Exit(): 54 | root.destroy() 55 | 56 | #Function to reset 57 | def Reset(): 58 | Text.set("") 59 | private_key.set("") 60 | mode.set("") 61 | Result.set("") 62 | 63 | #################### Label and Button ############# 64 | 65 | #Message 66 | Label(root, font= 'arial 12 bold', text='MESSAGE').place(x= 60,y=60) 67 | Entry(root, font = 'arial 10', textvariable = Text, bg = 'ghost white').place(x=290, y = 60) 68 | 69 | #key 70 | Label(root, font = 'arial 12 bold', text ='KEY').place(x=60, y = 90) 71 | Entry(root, font = 'arial 10', textvariable = private_key , bg ='ghost white').place(x=290, y = 90) 72 | 73 | #mode 74 | Label(root, font = 'arial 12 bold', text ='MODE(e-encode, d-decode)').place(x=60, y = 120) 75 | Entry(root, font = 'arial 10', textvariable = mode , bg= 'ghost white').place(x=290, y = 120) 76 | 77 | #result 78 | Entry(root, font = 'arial 10 bold', textvariable = Result, bg ='ghost white').place(x=290, y = 150) 79 | 80 | ######result button 81 | Button(root, font = 'arial 10 bold', text = 'RESULT' ,padx =2,bg ='gray' ,command = Mode).place(x=60, y = 150) 82 | 83 | #reset button 84 | Button(root, font = 'arial 10 bold' ,text ='RESET' ,width =6, command = Reset,bg = 'Green', padx=2).place(x=80, y = 190) 85 | 86 | #exit button 87 | Button(root, font = 'arial 10 bold',text= 'EXIT' , width = 6, command = Exit,bg = 'Orange', padx=2, pady=2).place(x=180, y = 190) 88 | root.mainloop() 89 | --------------------------------------------------------------------------------