You are on page 1of 16

DECLARATION

We hereby declare that this submission is my own work and that, to the best of our knowledge
and belief, it contains no material previously submit or written by another person nor material which
to a substantial extent has been accepted for the award of any other degree or diploma of the university
or other institute of higher learning, except where due acknowledgment has been made in the text.

Name: - VISHWAJEET MAURYA


Roll No.:- 5033289
CERTIFICATE

Certified that this is the bona fide record of the project work entitled “SECURE DATA
TRANSMISSION USING SOCKET PROGRAMMING” done by the student VISHWAJEET
MAURYA(5033289) of B.Sc. 3rd Year, Computer Science in the year 2019 in partial fulfilment
of the requirements to the award of degree Bachelor of Science in Computer Science of University
of Allahabad.

Signature of External Examiner Signature of Teacher


ACKNOWLEDGEMENTS

It gives us a great sense of pleasure to present the project report on “SECURE DATA
TRANSMISSION USING SOCKET PROGRAMMING” undertaken during B.Sc.(CS) - IIIrd
Year .We owe special debt of gratitude to Prof. Pooja for his constant support and guidance
throughout the course of work. It gives us a great heal and pleasure to express my sincere gratitude
to faculty members of B.Sc. for their kind, energetic and ever encouraging attitude and interest for
providing us necessary material for preparing the project report. Their affection and warm co-
operation made the task successful.

Last but not the least we acknowledge our friends and family members for their valuable
contribution of knowledge in our project.

VISHWAJEET MAURYA

B.Sc. IIIrdYear
CONTENT
ABSTRACT

In this project, data will be transmitted over a communication medium between server and client.
For a secure data transmission concept of cryptography has been introduced.

Here, socket will help in connecting two nodes on a network to communicate with each other.
Once the connection is established, data will be transmitted in encrypted form at receiver’s end data will
be decrypted first and then used. This attempt will prevent the unauthorised transmission of data from the
computer system.
INTRODUCTION

Technology is used in every sphere of life and people are more dependent on Smartphone
technology that contains a powerful computer processor to exchange data information. This is
because of necessity of our multimedia documents to be protected from unauthorized person. So a
day-to-day use of cryptography in our life is increasing tremendously. Messaging system is a text
or instant messaging service component of phone, web, or mobile communication systems over
the world. The public instant messaging systems, the messages are travel from the client to the
server and back to the second client. This data is potentially visible to eavesdroppers anywhere
along its Internet path or within the network. So the information at any moment it could have gone
to someone else. For this reason, this project work is concern with the development of secure
messaging system using cryptographic technique. Nowadays communication has become the most
desired requirement for each and everyone. for this there need a channel through which the
information can be passed upon due to the growing importance of communication channel it
becomes vulnerable to a large variety of attacks. Its main task is to defend transmission passage
against all sort of attacks and transmit information(i.e message) safely to the receiver. for this
purpose cryptography is used ,which changes the natural form of the data by using different
security algorithm and hence provide security to data transmission over an unreliable channel.

CRYPTOGRAPHY

Cryptography is the study of secret (crypto-) and writing (-graphy), respectively. It is a


technique for sorting and transmitting message in a particular form so that only those for whom it
is intended can read and process it . Cryptography is most often associated with scrambling
ordinary text (also referred as plain text) into cipher text, the process is called encryption then back
again plain text the process known as decryption.

Receiver
Sender
(Message is
( Message is
Cipher Text decrypted)
encrypted)
Cryptography concerns itself with four major objectives such as confidentiality
(information cannot be understood by anyone for whom it was unintended ),integrity(the

information cannot be altered are detected), non-repudiation(the sender of the information cannot
deny at a later stage his or her intentions in the creation or transmission of the information), and
authentication(the sender and receiver can confirm each other's identity at the origin/destination
of the information).

There are a number of algorithm for performing encryption and decryption. Here
symmetric encryption and decryption techniques has been used which uses exchange of key. A
key is simply a parameter to the algorithm that allows encryption and decryption process to occur.

PROBLEM STATEMENT
Messaging system is a text or instant messaging service component of phone, web, or
mobile communication systems over the world. The public instant messaging systems, the
messages are travel from the client to the server and back to the second client. This data is
potentially visible to eavesdroppers anywhere along its Internet path or within the network. So the
information at any moment it could have gone to someone else

OBJECTIVE
The objective of proposed work is to find an effective and secure data transmission. Data
security is a challenging issue of data transmission today that touches many areas including
secured communication channel, strong data encryption technique and trusted third party to
maintain the database. The convention method of encryption can only provide the security, the
data could be accessed by the unauthorised user for malicious purpose. Therefore it is necessary
to apply an effective encryption and decryption method to enhance data security mechanism.
Therefore the concept of cryptography has been introduced. It has been mainstay for defending the
secure data transmission.
REQUIREMENT ANALYSIS
Nowadays communication has become the most desired requirement for each and everyone.
for this there need a channel through which the information can be passed upon due to the growing
importance of communication channel it becomes vulnerable to a large variety of attacks. Its main
task is to defend transmission passage against all sort of attacks and transmit information(i.e
message) safely to the receiver. for this purpose cryptography is used ,which changes the natural
form of the data by using different security algorithm and hence provide security to data
transmission over an unreliable channel.

1. Hardware Analysis

Processor: Minimum Pentium

RAM : 2 GB

2. Software

OS : Windows 7

Language : C ,file handling ( Database)

3. Permission

a) Read External Storage.

b) Sending and receiving of data.

c) Managing files.

FEASIBILITY STUDY
Feasibility study tried to determine whether a given solution would work or not. Its main
objective is not to solve the problem, but to acquire its scope. It focuses on following:
• Meet user requirements

• Best utilization of available resources

• Develop a cost effective system

• Develop a technically feasible system

It is further classified into 3 aspects:-

Technical Feasibility

Issues to be studied are, whether the work for the project will be done with current
equipment, existing S/W technology and available personnel? If the new technology is
required, then what is the likelihood that it can be developed?

This software is technically feasible. The primary technical requirement includes the
availability of Windows 7 or higher version of operating systems installed in the network.
Reliability, access power and data security was also available. The system can also be
developed if the new technology is acquired. Thus, through all the ends technical feasibility
was met.

Economic Feasibility

The new system is cost effective or not? The benefits in the form of reduced cost?
As the hardware was installed from quite beginning, the cost on project of hardware is low.
Similarly, the software loaded for this project are easily available and can be downloaded
from internet. So software cost was under budget. Moreover, the technical requirements
were already available so there was no further expenditure for buying software packages.

Operational Feasibility

Issues to be studied are, is there sufficient support for management and users? Is the
current method acceptable to users? Will the proposed system cause any harm?
Cryptography technique used makes the transmission of data secure. It defend transmission
passage against all sort of attacks and transmit information(i.e message) safely to the
receiver and hence provide security to data transmission over an unreliable channel. Thus
the technique used provides security to the user for data transmission.
SYSTEM IMPLEMENTATION DETAILS

METHOD USED FOR CRYPTOGRAPHY

Data encryption standard (DES) is a math algorithm applied for cryptography and
Decryption of coded binary data. Cryptography converts data to Cipher. Decryption of cipher,
returns to the main data. The mentioned algorithm defines both cryptography and Decryption
based on binary value as key. The data are recovered by cipher, if the same key is used for
Decryption as it was used for encryption.

DES algorithm includes some repetitions of a plain transformation by substitution and


transposition techniques. This algorithm only applies one key for encryption and decryption
and it is called private key encryption. Thus, keeping the key as confidential by sender and
transmitter is of great importance as the algorithm is public and in case of revealing key, any
person can see the confidential message. Thus, in DES cryptography, the life of key is as long
as the life of transaction.

IMPLEMENTATION DETAILS OF DES


The Data Encryption Standard (DES) is a symmetric-key block cipher published by the
National Institute of Standards and Technology (NIST). DES uses two basic concept of
cryptography i.e. confusion and diffusion. At the simplest level, diffusion is achieved through
numerous permutation and confusion is achieved through XOR operation.

OVERVIEW

DES is a block cipher. At the encryption site, DES takes a 64-bit plaintext and creates a
64-bit cipher text, at the decryption site, DES takes a 64-bit cipher text and creates a 64-bit block
of plaintext. The same 56-bit cipher key is used for both encryption and decryption.

64-bit plaintext 64-bit plaintext

DES Cipher DES Reverse Cipher

(Encryption) (Decryption)
56-bit key

64-bit cipher text 64-bit cipher text

The encryption process is made of two permutations (P-boxes), which we call initial and
fi nal permutations, and sixteen Feistel rounds. Each round uses a different 48-bit round key
generated from the cipher key according to a predefined algorithm.

64-bit plaintext

DES
Initial Permutation
t

Round Key Generator


K1 48-bit
Round 1

K2 48-bit
Round 2
56-bit cipher key

K3 48-bit
Round 16

Final Permutation

64-bit cipher text


Fig. General Structure of DES

INITIAL AND FINAL PERMUTATIONS


Each of these permutations takes a 64-bit input and permutes them according to a
predefined rule. These permutations are keyless straight permutations that are the inverse of each
other. The permutation rules for these P-boxes are shown in table. Each side of the table can be
thought of as a 64-element array. The value of each element defines the input port number, and
the order (index) of the element defines the output port number.

Rounds
Table 1.3.1 Initial and final
permutations
DES uses 16 rounds. Each round table
of DES is a Feistel cipher. The round takes LI−1 and RI−1
from previous round (or the initial permutation box) and creates LI and RI, which go to the next
round (or final permutation box). Each round has two cipher elements (mixer and swapper). Each
of these elements is invertible. The swapper is obviously invertible. It swaps the left half of the
text with the right half. The mixer is invertible because of the XOR operation. All noninvertible
elements are collected inside the function f(RI−1, KI).

32-bits 32-bits

LI-1 RI-1

KI
Mixer

F(RI-1, KI)
Round

Swapper
LI RI
32-bits 32-bits

Fig. A Round In DES

DES Function

The DES function applies a 48-bit key to the rightmost 32 bits (RI−1) to produce a 32-bit output.
This function is made up of four sections: an expansion D-box, a whitener (that adds key), a group
of S-boxes, and a straight D-box.

In

32
32-bits

Expansion D-
box
48-bits
F(RI-1,KI) XOR K1 (48-bits)
S Boxes 48-bits

S S S S S S S S
32-bits

Straight D-box
32-bits

Out
Fig. DES function

Expansion box
Since RI−1 is a 32-bit input and KI is a 48-bit key, we first need to expand RI−1 to 48
bits. RI−1 is divided into 8 4-bit sections. Each 4-bit section is then expanded to 6 bits. This
expansion permutation follows a predetermined rule.

Whitener (XOR)

After the expansion permutation, DES uses the XOR operation on the expanded right
section and the round key.

S-Boxes

The S-boxes do the real mixing (confusion). DES uses 8 S-boxes, each with a 6-bit input
and a 4-bit output.

Key Generation

The round-key generator creates sixteen 48-bit keys out of a 56-bit cipher key. However,
the cipher key is normally given as a 64-bit key in which 8 extra bits are the parity bits, which are
dropped before the actual key-generation process.

Key with parity bits

64-bits

Parity Drop
Shifting
Cipher key (56-bits)
Rounds Shift

1, 2, 9, 16 one bit
28-bits 28-bits
Others two bits Shift Left Shift Left

28-bits 28-bits

Compression D-
box
48-bits
Round Key Generator

Round Key 1

28-bits 28-bits
Shift Left Shift Left

Compression D-
Round Key 16 48-bits box

Fig. Key Generation

Parity Drop

The pre-process before key expansion is a compression transposition step that we call parity bit
drop. It drops the parity bits (bits 8, 16, 24, 32, …, 64) from the 64-bit key. Remaining 56-bit
value is the actual cipher key which is used to generate round keys.

Shift Left

After the straight permutation, the key is divided into two 28-bit parts. Each part is shifted left
(circular shift) one or two bits. In rounds 1, 2, 9, and 16, shifting is one bit; in the other rounds, it
is two bits. The two parts are then combined to form a 56-bit.

You might also like