Data Encryption and Decryption
Data Encryption and Decryption
ON
SUBMITTED BY
SUBMITTED TO
THAPATHALI CAMPUS
March 2019
DECLARATION
We hereby declare that the project work report entitled “Data Encryption And
Decryption Using Concept Of Vigenere Cipher submitted for the partial fulfillment of
the requirements for the course of CT 401 Computer Programming is our original
work and the Project Work Report has not formed the basis for the award of any
degree, diploma, or other similar titles.
Signature:
Signature:
Signature:
i
ACKNOWLEDGEMENTS
ii
ABSTRACT
This project is focused on data security. This project converts given data into random
generated numeric and symbolic characters which is better fit for transfer through
internet. Conversion of information into random codes makes difficult for other
person to read your confidential information. Due to advancement of technology and
high internet usage data piracy has become a major concern. Focusing all these factors
we designed a program that helps to increase data security. This program is designed
to take a specific pin from the user and using the pin a random series of numeric and
symbolic characters are generated that makes it very hard for other people to crack the
code. Our program ensures secure data transfer through internet or any other
communication sources.
Key Words:
iii
TABLE OF CONTENTS
DECLARATION............................................................................................................i
ACKNOWLEDGEMENTS...........................................................................................ii
ABSTRACT..................................................................................................................iii
LIST OF FIGURES........................................................................................................v
CHAPTER 1: INTRODUCTION..................................................................................1
3.1 Design................................................................................................................7
REFERENCES.............................................................................................................17
APPENDICES..............................................................................................................18
iv
LIST OF FIGURES
FIGURE PAGE
Figure i: --------------------------------------------------------------------------15
v
CHAPTER 1: INTRODUCTION
1.1 Background
Data encryption is the focus of our project in which we convert given data into random
numbers and symbols using C. Not only in Nepal but all over the world data piracy is one
of the burning problems. Sensitive and confidential data are stolen from remote systems
using internet. This program helps to cover information using random generated codes
which even if stolen is very hard to decipher without a specific program.
We have encountered with various cases where data breach or data piracy during data
transfer has caused a loss of millions of dollars. To avoid these large losses business
organizations use encryption technique to secure their data. This type of encryption
system has multiple uses. It can be used for authentication, secure data storing and during
data transfer.
The main purpose of this project is to secure the data so that it can be transferred through
the internet or any other communication sources. As we are in the peak age of
technological advancement internet usage has become inseparable part of our life.
Communication and data transfer has become a common habit of ours these days. But
with all these facilities there are risks too. People on internet now haw abilities to steal
data from our system or during data transfer through the internet. To solve this problem
we developed our program to generate a secret code using a user defined key to encrypt
the data so it is hard for other people to decipher the code.
1
1.3 Objectives
1.4 Application
It is a C program that takes input from user and encrypts the data using a user defined
key. For the program a group of people with knowledge in C are required. Since, the
project requires multiple databases we need people to be able to create such databases
using either c structures, arrays etc.
2
1.6.3 Operational Feasibility
We need a computer with code blocks or turbo C IDE to operate. A user requires basic
knowledge in computers in order to be able to use the program. He/she must be able to
give input to the computer and be able to understand what the text on the screen means.
All we need is a computer with code blocks or turbo c for our project. We also need
GNICC complier to operate the program.
We need computer system with a keyboard and a mouse to operate our program.
3
CHAPTER 2: LITERATURE REVIEW
2.1 Introduction
Cryptography is about constructing and analyzing protocols that prevent third parties or
the public from reading private messages. Various aspects of information security such as
data confidentiality, data integrity, authentication, and non-repudiation are central to
modern cryptography. There are various types of encryption technology. Most of them
are highly complicated, non user friendly and can not be used under normal
circumstances conveniently. Inspired by these encryption techniques we developed our
own encryption system that is much more user friendly and applicable for general users.
In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's
code or Caesar shift, is one of the simplest and most widely known encryption
techniques. It is a type of substitution cipher in which each letter in the plaintext is
replaced by a letter some fixed number of positions down the alphabet. For example, with
a left shift of 3, D would be replaced by A, E would become B, and so on. The method is
named after Julius Caesar, who used it in his private correspondence.
The Vigenère cipher is a method to encrypt alphabetic text by using the position of the
letter of the input on the key.
The key is a word decided by the user and is kept secret.
The message cannot be decrypted without the key.
4
2.1.3 AES:
AES is based on a design principle known as a substitution–permutation network, and is
efficient in both software and hardware. Unlike its predecessor DES, AES does not use
a Feistel network. AES is a variant of Rijndael which has a fixed block size of 128 bits,
and a key size of 128, 192, or 256 bits. By contrast, Rijndael per se is specified with
block and key sizes that may be any multiple of 32 bits, with a minimum of 128 and a
maximum of 256 bits.
For instance, if there are 16 bytes, these bytes are represented as this two-dimensional
array:
The key size used for an AES cipher specifies the number of transformation rounds that
convert the input, called the plaintext, into the final output, called the cipher text. The
number of rounds are as follows:
Each round consists of several processing steps, including one that depends on the
encryption key itself. A set of reverse rounds are applied to transform cipher text back
into the original plaintext using the same encryption key.
5
Helps for safe data transfer.
It is more secure than other simpler encryption such as the Caesar Cipher.
Modern cryptography provides a robust set of techniques to ensure that the malevolent
intentions of the adversary are thwarted while ensuring the legitimate users get access to
information.
As per the introduction, the main motto of the encrypting software is to encrypt the user
given data and store it and also to decrypt the encrypted data.
To develop this system, we first create a user friendly interface where a user can interact
with our program without any effort and knowledge of computer system. Firstly, the
software asks the user either they want to encrypt or decrypt. Then encrypt file or encrypt
message or decrypt file or decrypt message option is seen as per selection
6
CHAPTER 3: DESIGN & METHODOLOGY
3.1 Design
The design of the software is simple. We have used two functions in the program. The
main function calls both the functions. The first function is for the encryption of the data
and the other is for the decryption of data.
3.2 Methodology
The methods are as follows: -
7
3.2.1 Working Method of Encrypt Function
First It asks user either they want to encrypt or decrypt the file or message then after the
selection of encryption option the following options pop.
>Encrypt file
>Encrypt message
If we select the ‘encrypt message’ the program asks for the message that they want to
encrypt then it asks a key for encryption and also for decryption. Once it is provided by
the user it displays the original message and the encrypted message.
If we select ‘encrypt file’ the program asks for file path. After the path is provided the
program encrypts the text in the file itself.
>Decrypt file
>Decrypt message
This function asks for encrypted message that they want to decrypt then it asks for key
used for encryption earlier. Once the key is provided by the user it converts the
encrypted message into original message using the encryption key.
8
Similarly if the user selects the ‘decrypt file’ the program asks for file path. After the
path is provided the program decrypts the text in the file itself.
Vigenère cipher
The Vigenère cipher is a method to encrypt alphabetic text by using the position of the
letter of the input on the key. The key is a word decided by the user and is kept secret.
The message cannot be decrypted without the key.
Let's encrypt the word "bishal" with the key "web".
Word: bishal
Key: web
Encrypted message: xmtdem
The explanation is as follows:
webweb
b i s hal
w+b=x e+i=m b+s=t
9
Fig:
i
Fig:
10
Fig: iii
Fig:
iv
11
BLOCK DIAGRAM
START
ESC BUTTON
ESC BUTTON
CHOOSE
ENCRYPT
ENCRYPT
/DECRYP
DECRYPT
T
Esc
STOP
Fig 1.1
12
13
E
EN
E
N
CR
N
YP
TE
TE
RT
R
FIL
FI
E/
M
LE
ME
ES
P
SS
SA
AG
AT DECRYPT
GE
E ENTER FILE PATH ENTER MESSAGE
H FILE/MESSAGE
EN
PE
TE
DI
RF
R
SP
O
KE
LA
R
YY
M
EO ENTER KEY
RI
N
GI
CR
IS
YP
PR N
FIL
AL
TI
IN PERFORM DECRYPTION
ETOA
O N
“SN
RUD
NE
CC
ON
ES IS FILE DISPLAY DECRYPTED
TS”
CR PRINT “SUCCESS” OR AND ORIGINAL
?YP NOT ? MESSAGE
TE
Fig 1.2
D
M
ES
SA
Fig 1.3
G
E
14
CHAPTER 4: IMPLEMENTATION AND RESULT
Word: bishal
Key: web
Encrypted message: xmtdem
The explanation is as follows:
webweb
b i s hal
w+b=x e+i=m b+s=t
w+h=d e+a=e b+l=m
15
CHAPTER 5: CONCLUSION AND FURTHER WORK
5.1 Conclusion
Hence, this cryptography method enables the conduct of business over the networks
using the computer systems in extremely efficient and effective manner. And moreover, it
ensures the safety of users critical data. And since it is a simple encryption method it is
easier to use than other complex encryption methods moreover, it is secure enough to
safeguard the sensitive data of the users in contrary to its simpler counterparts.
We encrypt our data by converting the user input data into random alphabets. Our system
can be made much more secure by addition of symbols and numeric characters. The user
interface we created can also be refined. This program only encrypts .txt files. It can be
modified to encrypt other types of files. Our program is case insensitive. It can be
modified to work with upper and lower case characters.
16
REFERENCES
Websites :
1. https://stackoverflow.com/
2. https://www.quora.com/
17
APPENDICES
Increasing use of internet usage has made us vulnerable to data leaks. Due to
development of new and sophisticated computing techniques people can easily breach
into our private files and get access to our personal data. To minimize such risk, we
created a simple and user friendly encryption program that can help for small scale data
encryption and provide extra layer of protection to our private data. Our program is not
much refined like other encryption software but it does the job for encrypting small scale
private data. Using this program user can encrypt their file or encrypt their messages at
the very instant. In our program the data is secured with any key provided by the user.
The encrypted code thus obtained can only be decrypted using the key. We also added the
feature where the user can input the file path with a key and the program encrypts the file
as a whole and saves the encrypted code on the file itself. If the user wants to decrypt the
message the key used for encryption is provided to the program with the file path. The
program decrypts the code onto the same file.
18