[go: up one dir, main page]

0% found this document useful (0 votes)
18 views31 pages

Omkar Project

Uploaded by

jashuj885
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views31 pages

Omkar Project

Uploaded by

jashuj885
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

TITLE : TEXT ENCRYPTION AND

DECRYPTION TOOL
GUIDE: PRESENTED BY:
CH. ANIL CH. GRAHESH
KUMAR (21005-CS-018)
M. OMKAR
(21005-CS-027)
K. SAI KIRAN
(21005-CS-029)
M. GNANESHWAR
(21005-CS-038)
A. NIKHIL
(21005-CS-042)
B. MANOJ
(21005-CS-056)
CONTENTS
:

1.Introduction
2.Objectives
3.Requirements and Specification
4.Security parameters
5.Project File Structure
6.Implementation
7.Results
8.Advantages
9.Drawbacks
10.Applications
11.Graph comparative analysis
12.Conclusion
INTRODUCTION
 In this digital era, the need for security is increasing rapidly. Complying
with this requirement, the encryption & decryption algorithms were
devised.
 Data security has become most important aspect while transmission of
data and storage.
 The transmission and exchange of image also needs a high security.
Cryptography is the art of secret writing. Cryptography is used to
maintain security.
 The basic service provided by cryptography is the ability to send
information between participants in a way that prevents others from
reading it.
OBJECTIVE:

The objective of this project is to encode and decode


messages using a common key.
In this,
1. The user first enters the message and key
2. And choose one of the encode or decode options
3. Based on the choice the corresponding operation is
done
4. It is to be noted that the same key used for encryption
needs to be used during the decryption
REQUIREMENTS AND
SPECIFICATIONS:

Here we have used hardware and software products for the


completion of projects and there are user requirements and
project requirements.
Hardware Requirements:
 Processor :Pentium core and above
 Ram:1GB
 Hard disk space :1GB
Software Requirements:
 Operating system: windows 7and above
 python
User requirements:

Every user should be..


 work with a computer.
 He must also have basic knowledge of english.
Python: we use python as a programming language for building the application. Python is a
dynamic , interpreted language.
To build this project we will use basic concept of python, Tkinter, and base64 library.
Tkinter is a standard GUI python library.
->Python when combined with tkinter provides a fast and easy to create GUI applications. It
has a wide range of widgets ranging from basic gui widgets like buttons ,menus etc. to
display data. They have a default configuration which makes us easy to use.
 We have used widgets like
 Label: Used to specify a container box where we can place the text or images.
It is used to provide a message to the user.
 Button: It contains a clickable area with text that calls an associated function
whenever user clicks in the area.
 Radio Button: User is provided with various options and the user can select
only one option.
 Entry: It is used to display the single -line text field for accepting values from
user.
 Frame: It can be used for grouping other widgets together in a complex layout.
 Message Box: It is used to display the messages-box in the desktop
applications.
 base64 module provides a function to encode the binary data to ASCII
characters and decode that ASCII characters back to binary data. It is
simple and efficient way to represent binary data in a text format. It
reduces the data by about 33%, can be useful for transmitting data over a
network or storing it on a disk. Base64 can also called as Privacy
enhanced Electronic mail(PEM) and is primarily used in email encryption
process.
 It is used to store or transfer images ,audio files and media online.
 To install the library we use pip install command on the command prompt
 pip install tkinter
 pip install base64
SECURITY PARAMETERS

 Architecture:-Architecture includes structure and mathematical


operations that an algorithm performs for encryption and decryption.
Characteristics and how they are implemented. It also includes key
used in the algorithm.
 Performance:-Performance includes time required for Encryption and
decryption, Memory required Software hardware performance and
computational cost.
 Security:-Security measures strength of the algorithm form attacks. It
includes required element, possesses and property of algorithm.
Security of an encryption algorithm depends on the key size used to
execute the encryption. Length of key is measured in bits.
 Flexibility:-Flexibility defines whether the algorithm
allows some modification or not.
 Scalability:-We test the algorithm for different size
of the file or data. So scalability is one of the
important elements for algorithms. Scalability
depends on certain parameters such as Memory
Usage, Encryption rate, Software hardware
performance, Computational efficiency.
PROJECT FILE STRUCTURE

Steps for building the python message encryption decryption


project:
1. Installing the required modules
2. Importing the modules
3. Writing function for encryption
4. Writing function for decryption
5. Creating the window
6. Adding the input and output components
7. Adding the buttons and their functions
INSTALLING REQUIRED MODULES
->The base64 is available by default.
-> The Tkinter module needs to be installed. You can install this module by using the
following command.
pip install tkinter
IMPORTING THE MODULES
The first step is to import the required modules. Here we will be using the tkinter
module for building the GUI and the base64 module for encryption and decryption
purposes.
WRITING FUNCTION FOR ENCRYPTION
a. ord(): This function gives the corresponding ASCII values of a given character.
b. chr(): This function gives the corresponding character to the given ASCII value.
c. append(): Adds the elements to the end of the list
d. ord(msg[i]) + ord(list_key)) % 256 : This gives the remainder of division of
addition of ord(message[i]) and ord( key_c) with 256 and passes that remainder to
chr() function
e. base64.urlsafe_b64encode(): This helps in encoding the string using url and file
system safe alphabets into the binary form.
WRITINF FUNCTION FOR DECRYPTION
a. base64.urlsafe_b64decode(): This helps in decoding the binary string using url and
file system safe alphabets into the normal form of strings.
b. ord(): This function gives the corresponding ASCII values of a given character
c. chr(): This function gives the corresponding character to the given ASCII value
d. 256 + ord(message[i]) – ord(key_c)) % 256 : This gives the remainder of addition
of 256 with subtraction of ord(message[i]) – ord( key_c) and then division with 256
and passes that remainder to chr() function
e. append(): Adds the elements to the end of the list.
CREATING THE WINDOW
a. geometry(): It sets the length and width of the project window.
b. configure(): It sets the background color of the screen
c. title(): It displays the title on the top of the python message encryption-decryption project window.
ADDING INPUT AND OUTPUT COMPONENTS
a. The message and key hold the values in the entries that hold the input message key. And mode checks which radio
button is pressed for encryption/decryption. Output values hold the value shown in the Result entry after doing the
operation.
b. Frame(): It creates a rectangular object that holds various widgets on the screen
c. place(): This is used to place the widgets in a specified location based on coordinates or relative to the parent
component
d. Label(): This creates a label that can be used to show information
e. Entry(): This widget is used to take input from the user
f. Radiobutton(): These help in choosing one of the given options
ADDING BUTTONS AND THEIR FUNCTIONS
a. The result() function
i. it takes the message, key, and the mode that are inputted by the user
ii. Then based on the mode, calls one of the encryption() or decryption() functions
iii. Shows the output in the Result field
iv. If no mode is selected, shows the message to select one of the either
b. Button(): This creates a button with mentioned color, text, etc. and the command parameter represents
the function that is to be executed on clicking the button
c. place(): This is used to place the widgets in a specified location based on coordinates or relative to the
parent component
d. mainloop(): This makes sure the screen runs in a loop till it is manually closed by the user.
IMPLEMENTATION
from tkinter import *
import base64
from tkinter import messagebox
import tkinter.font as font

def encode(key, msg):


enc = []
for i in range(len(msg)):
list_key = key[i % len(key)]
list_enc = chr((ord(msg[i]) + ord(list_key)) % 256)
enc.append(list_enc)
return base64.urlsafe_b64encode("".join(enc).encode()).decode()
def decode(key, code):
dec = []
enc = base64.urlsafe_b64decode(code).decode()
for i in range(len(enc)):
list_key = key[i % len(key)]
list_dec = chr((256 + ord(enc[i]) - ord(list_key)) % 256)
dec.append(list_dec)
return "".join(dec)
def result():
msg = message.get()
k = key.get()
i = mode.get()

if not k:
messagebox.showinfo('Error', 'Please enter a key.')
return

if i == 1:
output.set(encode(k, msg))
elif i == 2:
output.set(decode(k, msg))
else:
messagebox.showinfo('Error', 'Please choose either
Encryption or Decryption.')
def reset():
message.set("")
key.set("")
mode.set(0)
output.set("")

top = Tk()
top.geometry("500x500")
top.maxsize(500, 500)
top.minsize(500, 500)
top.configure(bg='lightblue')
top.title("Encrypt and Decrypt your Messages")
message = StringVar()
key = StringVar()
mode = IntVar()
output = StringVar()

headingLabel = Label(top, text=" Welcome to Encryption and \nDecryption ", bg='gold', font=('arial', 16, 'bold'))
headingLabel.place(x=10, y=10, width=480, height=100)

label1 = Label(top, text='Enter the Message', font=('arial', 10),bg="lightblue")


label1.place(x=10, y=150)
msg = Entry(top, textvariable=message, width=35, font=('calibre', 10, 'normal'))
msg.place(x=200, y=150)

label2 = Label(top, text='Enter the key', font=('arial', 10),bg="lightblue")


label2.place(x=10, y=200)
inp_key = Entry(top, textvariable=key, show='*', width=35, font=('calibre', 10, 'normal’))
inp_key.place(x=200, y=200)
label3 = Label(top, text='Check one of encrypt or decrypt', font=('arial', 10),bg="lightblue")
label3.place(x=10, y=250)
Radiobutton(top, text='Encrypt', variable=mode, value=1,bg="lightblue").place(x=100, y=300)
Radiobutton(top, text='Decrypt', variable=mode, value=2,bg="lightblue").place(x=200, y=300)

label4 = Label(top, text='Result', font=('arial', 10),bg="lightblue")


label4.place(x=10, y=350)
res = Entry(top, textvariable=output, width=35, font=('calibre', 10, 'normal'), state='readonly')
res.place(x=200, y=350)

result_button = Button(top, text="Show Message", bg='lightgreen', fg='black', width=15, height=1,


command=result)
result_button['font'] = font.Font(size=12)
result_button.place(x=180, y=400)
reset_button = Button(top, text='Reset', bg='red', fg='black', width=15, height=1, command=reset)
reset_button['font'] = font.Font(size=12)
reset_button.place(x=15, y=400)

quit_button = Button(top, text='Exit', bg='yellow', fg='black', width=15, height=1,


command=top.destroy)
quit_button['font'] = font.Font(size=12)
quit_button.place(x=345, y=400)

top.mainloop()
RESULTS
OUTPUT FOR ENCRYPTION
OUTPUT FOR DECRYPTION
ADVANTAGES

 You Can Use It Across a Variety of Devices


 Could Help You Avoid Regulatory Fines
 It It Helps You Stay Safer When Working Remotely
 It Supports Data Integrity
 Data Encryption Is a Privacy Safeguard
 Data Encryption Could Provide a Competitive Advantage
 Using Encryption Technology for Data Protection Could Increase Trust
 Encryption is Cheap to Implement.
DRAWBACKS

Whilst encryption does have some major advantages, there are


numerous drawbacks that you should take into consideration before
adopting the strategy. Encrypting all of your files that contain personal
data, for example, may make them more secure, but it will also make
it nearly impossible for your employees to get any work done.
File systems are places where employees are constantly creating,
moving, modifying, copying, and sharing data (in spreadsheets,
documents, ppts, and more) that they are working on at that present
moment. Adding encryption to this could potentially create an untidy
work environment that is more difficult to manage.
APPLICATIONS

1.Authentication/Digital Signatures
2.Time Stamping
3.Electronic Money
4.Encryption/Decryption in email
5.Encryption in WhatsApp
5.Encryption in Instagram
7.Sim card Authentication
CONCLUSION

The proposed method is used for message communication.


Short message can be send securely using encryption
techniques. The proposed approach is based on number of
characters in message and simple calculation and operations
are performed to minimize the execution time.
THANK YOU

You might also like