encryption algorithms for data security in local area

48
Encryption Algorithms for Data Security in Local Area Network by Asmaa Essam Alhibshi A thesis submitted to the Department of Computer Engineering and Science at Florida Institute of Technology in partial fulfillment of the requirements for the degree of Master of Computer Information Systems in Computer Sciences Department Melbourne, Florida May, 2019

Upload: others

Post on 30-Oct-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Encryption Algorithms for Data Security in Local Area

Encryption Algorithms for Data Security in Local Area Network

by

Asmaa Essam Alhibshi

A thesis submitted to the Department of Computer Engineering and Science

at Florida Institute of Technology

in partial fulfillment of the requirements

for the degree of

Master of Computer Information Systems

in

Computer Sciences Department

Melbourne, Florida

May, 2019

Page 2: Encryption Algorithms for Data Security in Local Area

We the undersigned committee hereby approve the attached thesis

Encryption algorithms for data security in Local Area Network

by

Asmaa Alhibshi

_________________________________________________

David LeVan, Ph.D.

Assistant Professor

Computer Sciences

_________________________________________________

Carlos Otero, Ph.D.

Associate Professor

Electrical Engineering

_________________________________________________

Marius Silaghi, Ph.D.

Associate Professor

Computer Sciences

_________________________________________________

Philip Bernhard, Ph.D.

Associate Professor and Department Head

Computer Engineering and Sciences

Page 3: Encryption Algorithms for Data Security in Local Area

iii

Abstract

Title: Encryption algorithms for data security in Local Area Network

Author: Asmaa Alhibshi

Major Advisor: LeVan, Ph. D.

Cryptography plays an important part in data and information security. An overview

of cryptography is given in the paper. This paper tries to compare most commonly

used encryption algorithms RSA and AES, with their performance analysis on java

and C++.

At first a brief introduction on types of cryptography i.e. symmetric and asymmetric

encryption algorithm. Then previous work on these encryption algorithms is

discussed and their performance comparison in the form of table is given. Then the

objectives of this thesis is given.

In chapter 3, a detailed description of ciphering algorithms, RSA, AES, TCP and

UDP is provided. Chapter 4 explains the development environment that we need it

to implement the client server applications. Chapter 5 is crux of the thesis where the

implementation part is discussed. We ran RSA and AES algorithms, both in JAVA

and C++ and their performance in the form of graph is shown. At the end thesis is

summarized in the form of conclusion of the implementation and testing part.

Page 4: Encryption Algorithms for Data Security in Local Area

iv

Table of Contents

Table of Contents ................................................................................................... iv

List of Figures ......................................................................................................... vi

List of Tables ........................................................................................................ viii

Dedication ............................................................................................................... ix

Chapter 1 Introduction ............................................................................................ 1

1.1 Introduction ............................................................................................................... 1

1.2 Problem Statement .................................................................................................... 2

1.3 Cryptography - Overview ......................................................................................... 2

Chapter 2 Related Work and Research Objectives .............................................. 5

2.1 Related Work ............................................................................................................. 5

2.2 Research Objectives .................................................................................................. 9

Chapter 3 Theory ................................................................................................... 11

3.1 Ciphering algorithm ................................................................................................ 11

3.2 RSA ........................................................................................................................... 11

3.3 AES ........................................................................................................................... 13

3.4 TCP protocol ............................................................................................................ 14

3.5 UDP protocol ........................................................................................................... 14

Chapter 4 Development Environment ................................................................. 16

4.1 Java ........................................................................................................................... 16

4.2 C++ ........................................................................................................................... 16

4.3 Wireshark ................................................................................................................ 17

Chapter 5 Implementation .................................................................................... 19

5.1 Java applications ..................................................................................................... 19

5.2 C++ Applications ..................................................................................................... 19

Page 5: Encryption Algorithms for Data Security in Local Area

v

5.3 Difficulty in programming in C++ in windows ..................................................... 20

5.4 TCP Protocol ........................................................................................................... 20

Chapter 6 Testing ................................................................................................... 21

6.1 DHCP Server Configuration .................................................................................. 21

6.2 Java Client Server Applications ............................................................................. 23

6.3 C++ Client Server Applications ............................................................................. 29

6.4 The Final results ...................................................................................................... 35

Chapter 7 Conclusion ............................................................................................ 37

References ............................................................................................................... 39

Page 6: Encryption Algorithms for Data Security in Local Area

vi

List of Figures

Figure 1 — Encryption Flowchart. ............................................................................ 3

Figure 2 — Decryption Flowchart. ............................................................................ 3

Figure 3 — Cryptography overview. ......................................................................... 4

Figure 4 — RSA Flowchart ..................................................................................... 12

Figure 5 — AES Flowchart...................................................................................... 13

Figure 6 — TCP ....................................................................................................... 14

Figure 7 — UDP ...................................................................................................... 15

Figure 8 — System Variable .................................................................................... 16

Figure 9 — MinGW Terminal ................................................................................. 17

Figure 10 — DHCP Server Configuration .............................................................. 21

Figure 11 — DHCP Server Configuration ............................................................... 22

Figure 12 — The server (PC 1) ................................................................................ 22

Figure 13 — The client (PC 2) ................................................................................. 23

Figure 14 — The Server is running ......................................................................... 23

Figure 15 — The client ............................................................................................ 24

Figure 16 — The Server ........................................................................................... 24

Figure 17 — The First Packet .................................................................................. 25

Figure 18 — The Last Packet .................................................................................. 26

Figure 19 — The Server is running ......................................................................... 27

Figure 20 — The client ............................................................................................ 27

Figure 21 — The Server ........................................................................................... 28

Figure 22 — The First Packet .................................................................................. 28

Figure 23 — The Last Packet .................................................................................. 29

Figure 24 — The Server is running ......................................................................... 30

Figure 25 — The client ............................................................................................ 30

Page 7: Encryption Algorithms for Data Security in Local Area

vii

Figure 26 — The client ............................................................................................ 31

Figure 27 — The First Packet .................................................................................. 31

Figure 28 — The Last Packet .................................................................................. 32

Figure 29 — The Server is running ......................................................................... 33

Figure 30 — The Client ........................................................................................... 33

Figure 31 — The Server ........................................................................................... 34

Figure 32 — The First Packet .................................................................................. 34

Figure 33 — The Last Packet .................................................................................. 35

Figure 34 — RSA comparison ................................................................................. 36

Figure 35 — AES Comparison ............................................................................... 36

Page 8: Encryption Algorithms for Data Security in Local Area

viii

List of Tables

Table 1 — Algorithm settings .................................................................................... 8

Table 2 — Comparative execution times of encryption algorithms in ECB mode on

a P-II 266 MHz machine .................................................................................... 8

Table 3 __ Comparative execution times of encryption algorithms in ECB mode on

a P-4 2.4 GHz machine ...................................................................................... 9

Table 4 __ Java AES ................................................................................................ 26

Table 5 __ Java RSA ................................................................................................ 29

Table 6 __ C++ AES ................................................................................................ 32

Table 7 __ C++ RSA ................................................................................................ 35

Table 8 __ The Speed of Java and C++ ................................................................... 37

Page 9: Encryption Algorithms for Data Security in Local Area

ix

Dedication

I would like to thank my advisor, Dr. LeVan for guiding and supporting me over the

years. You have set an example of excellence as a researcher, mentor, instructor, and

role model.

I would like to thank my thesis committee members for all of their guidance through

this process; your discussion, ideas, and feedback have been absolutely invaluable.

This thesis is dedicated to my parents Essam Alhibshi and Fatima Alzaher, who have

been my source of inspiration and gave me strength when I thought of giving up,

who continually provide their moral, spiritual, emotional, and financial support.

To my dear husband Hasan Alzaher, his belief in this thesis kept me motivated and

inspired on even the darkest of days.

To my little son Mohammad Alzaher, who kept me strong and happy, his smile

encouraged me to do even the hard tasks in this thesis.

To my sisters, relatives, friends, and classmates who shared their words of advice

and encouragement to finish this thesis.

And lastly, we dedicated this thesis to the Almighty God, thank you for the guidance,

strength, power of mind, protection and skills and for giving us a healthy life. All of

these, we offer to you.

Page 10: Encryption Algorithms for Data Security in Local Area

1

Chapter 1

Introduction

1.1 Introduction

Cryptography assumes an imperative job in system security particularly the way

toward sharing and exchanging information all through open channels. Cryptography

is necessary, to secure the information. There are prominent algorithms, for example,

AES, DEC, 3DES, and Blowfish. These algorithms can be utilized in numerous

applications, for example, online shopping, communication, database, and internet

banking (Bhoomika Modi, Vinit Gupta, 2016)

Today, hacking is a critical issue. In order to secure data transmission over network,

this issue must be dealt with. Hackers can use the fixed plaintext to get the key used

in WLAN (Salem, Tamil Nadu).

The way toward securing information that exchange between various endpoints is

important, so that the data would not be modified or blocked. It is of high importance

in some systems such as online banking. If a hacker gets access to the bank’s

customer database which contains sensitive information like their transaction history,

amount in their account etc., a hacker can then use this information or maybe alter it

to his own benefit. Hackers can even breakthrough firewalls and tamper with routers,

anti-spam filters in the network. They can easily manipulate the communication.

Encryption provides an extra layer of security protection (Kohout, n.d.).

Page 11: Encryption Algorithms for Data Security in Local Area

2

1.2 Problem Statement

Data security is becoming more and more important and the effective way to

communicate it over network is by using encryption algorithms. Everyday new

encryption techniques are introduced. The main goal of this thesis is to enhance

encryption algorithms by comparing their performance over java and C++.

RSA and AES algorithms are tested by creating a client-server model in JAVA and

C++ language using UDP as network protocol. The client programs start sending

encrypted messages to server and server decrypts and displays the messages. The

time in which the packets are received determines the performance of algorithms on

JAVA and C++.

1.3 Cryptography - Overview

Cryptography mainly refers to “study of secrets” which in data security terms refers

to encryption. Encryption is defined as:

"a set of cryptographic algorithms together with the key

management processes that support use of the algorithms in some

application context." (RFC2828)

Through encryption we can achieve non-repudiation, reliability, availability,

integrity, authentication, secrecy and confidentiality.

Fig. 1 and Fig. 2 shows how encryption and decryption algorithms usually work.

Page 12: Encryption Algorithms for Data Security in Local Area

3

Figure 1 — Encryption Flowchart.

Figure 2 — Decryption Flowchart.

1.3.1 Classification of Cryptography

Cryptography provides security goals ensuring data privacy, no modification of data

over communication on network etc. There are two kinds of cryptography

algorithms:

• Symmetric key - encryption algorithms

▪ Both the encryption and decryption keys are same. Symmetric

encryption implies that a similar key will be utilized by the sender and

receiver for encryption and decryption. (Salem, Tamil Nadu)

▪ TRIPLE DES, BLOWFISH, AES, RC4 and RC6 are instances of

symmetric-encryption algorithms. (Data Encryption Standards, 1977)

• Asymmetric key – encryption algorithms.

▪ The key to encrypt message will be different from the key to decrypt

message.

Page 13: Encryption Algorithms for Data Security in Local Area

4

▪ RSA, DSA and Diffie-Hellman etc. are common examples.

Figure 3 — Cryptography overview.

Page 14: Encryption Algorithms for Data Security in Local Area

5

Chapter 2

Related Work and Research Objectives

2.1 Related Work

Cryptography plays an important role in network security especially the process of

sharing and transferring data throughout open channels. In order to secure the data,

cryptography is mandatory. There are popular algorithms such as AES, DEC, 3DES,

and Blowfish. These algorithms can be used in many applications such as shopping,

communication, database, and internet banking (Bhoomika Modi, Vinit Gupta,

2016).

The article “Encryption and Its Importance to Device Networking” explained many

concepts that related to encryption such as cryptography, keys, and common types

of encryption. Also, it explained the importance of protecting data using encryption

algorithms to disable an authorized party from reading crucial data. This article stated

that encryption algorithms give the ability to decrypt and read the data only for an

authorized recipient. In order to decrypt an encrypted file or text, the authorized

recipient can use a key to restore the original file or text. In addition, the key that has

large number of bits which has large number of potential combinations that can be

created, this key will be hard to break comparing with a key that has a smaller number

of bits. The article defined two types of encryption which are asymmetric encryption

and symmetric encryption and each type has many algorithms. Skipjack, DES, Triple

DES, and AES are most common encryption algorithms. Data Encryption Standard

(DES) is an example of symmetric (Secret Key) encryption that operates on 64 – bits

block with a 56- bit key. Another example of symmetric encryption is International

Page 15: Encryption Algorithms for Data Security in Local Area

6

Data Encryption algorithm (IDEA) that operates on 64 – bit blocks with a 128 – bit

key (Encryption and Its Importance to Device Networking, n.d.).

In the article “Encryption Basics: How It Works & Why You Need It”, Carey

Wodehouse explained the type of data that encryption is designed to protect which

are at rest data and data in transit. If hackers have access to a computer, hard drive,

or database, the data will be unreadable using encryption algorithms. In addition,

encryption can protect data that in transit and keep it secured even if it is intercepted

by unauthorized party. Carey Wodehouse explained that encryption can be achieved

by Full disk encryption (FDE), File encryption, End to End (E2E) encryption,

Encrypted web connections, Encrypted email servers, pre- encrypting data that is

synced with the cloud. Also, there are other types of encryption like secret key

algorithms, public key algorithms, block cipher, stream cipher, Elliptic curve

cryptography, and Block chain cryptography. Furthermore, there are some popular

algorithms such as Advanced encryption standard (AES), RSA, International Data

Encryption Algorithm (IDEA), signal protocol, Blowfish, Twofish, and Ring

Learning with errors or Ring- LWE. Carey Wodehouse described the importance of

key management which is a crucial aspect of encryption. It is important to not lose

the encryption key because that lead to lose access to data. She also defined some

methods of key management such as Diffie – Hellman key exchange and double

Ratchet algorithm (WODEHOUSE, n.d.).

The article “Cryptography with High Throughput: A survey” conducted a research

that evaluate and measure the performance and throughput depending on speed, time,

and memory. The research stated that there are three necessary core process which

are key generation, encryption, and decryption. Encryption means encode a text or

Page 16: Encryption Algorithms for Data Security in Local Area

7

file (plain text) using a key. The encrypted text or file called cipher text. On the other

hand, decryption means restoring the original text or file using a key and the encoded

text. In addition, the research defined some encryption algorithms such as Data

Encryption Standard (DES), Triple DES, and Blowfish. The research conducted

several performance comparison of data encryption algorithms. The first comparison

is about Blowfish algorithm and Java language used for implementation. The result

showed that Blowfish was a fast algorithm for implementation, but because Java used

for implementation, the speed was slow. The second comparison was between DES,

AES, and Blowfish. The result showed that AES is better than DES, but Blowfish is

too much better than other two. On the other hand, AES suffers from brute force

attack and Blowfish from weak keys problem. The last comparison was between

UMARAM and UR5 which both can be used for text and image data. For image data,

speed of UMARAM is good in all the above OS. For text data UR5 is the best in

speed on different OS. As a result, UR5 and UMARAM are the better algorithm than

3DES in speed and time consumption. In comparison with AES and Blowfish, UR5

and UMARAM don’t give better performance (Bhoomika Modi, Vinit Gupta, 2016).

To give more perspective about the compared encryption algorithm’s performance

this section of thesis deals with related work done in this field.

One of the major works done in comparing performance is discussed in the

“Performance Analysis of Data Encryption Algorithms” by Abdel-Karim Al Tamim.

A comparison between four algorithms: DES, TDES, Blowfish and AES was

provided. The comparison was conducted by running several encryption settings to

process different sizes of data blocks to evaluate the algorithm's encryption and

decryption speed.

The table below show the settings for each algorithm. (Al Tamimi, 2005)

Page 17: Encryption Algorithms for Data Security in Local Area

8

Table 1 — Algorithm settings

Algorithm Key Size

(Bits)

Block Size

(Bits)

DES 64 64

TDES 192 64

Rijndael 256 128

Blowfish 448 64

Table 2 and 3 gives the results of experiments on two different machines. (Al

Tamimi, 2005)

Table 2 — Comparative execution times of encryption algorithms in ECB mode on a P-II 266

MHz machine

Input Size (bytes)

DES 3DES AES BF

20,527 24 72 39 19

36,002 48 123 74 35

45,911 57 158 94 46

59,852 74 202 125 58

69,545 83 243 143 67

137,325 160 461 285 136

158,959 190 543 324 158

166,364 198 569 355 162

191,383 227 655 378 176

Page 18: Encryption Algorithms for Data Security in Local Area

9

232,398 276 799 460 219

Average Time 134 383 228 108

Bytes/sec 835 292 491 1,036

Table 3 __ Comparative execution times of encryption algorithms in ECB mode on a P-4 2.4

GHz machine

Input Size (bytes)

DES 3DES AES BF

20,527 2 7 4 2

36,002 4 13 6 3

45,911 5 17 8 4

59,852 7 23 11 6

69,545 9 26 13 7

137,325 17 51 26 14

158,959 20 60 30 16

166,364 21 62 31 17

191,383 24 72 36 19

232,398 30 87 44 24

Average Time

14 42 21 11

Bytes/sec 7,988 2,663 5,320 10,167

The results clearly showed that Blowfish algorithm has a good overall performance.

The results also confirmed that AES is better than DES and TDES whereas, TDES

is actually three times better in performance than DES. But AES requires more

processing power as compared to other algorithms.

2.2 Research Objectives

The research objectives are stated below:

Page 19: Encryption Algorithms for Data Security in Local Area

10

• Build encrypted client server application using RSA algorithm (java version).

• Build encrypted client server application using AES algorithm (java version).

• Build encrypted client server application using RSA algorithm (C++ version).

• Build encrypted client server application using AES algorithm (C++ version).

• Applications should run on different computers over the LAN.

• Applications should work on computer with Windows 7 and over.

• Analyze packets that generated using these applications.

Page 20: Encryption Algorithms for Data Security in Local Area

11

Chapter 3

Theory

3.1 Ciphering algorithm

A ciphering algorithm is an algorithm designed to protect data. Most cipher

algorithms use a key as a part of encrypting the data. The key is either used to encrypt

the data or is necessary for decryption. Large keys implied more protection but

costing more computation time to encrypt and decrypt data. So, we need to choose a

key carefully that strikes a balance between security and computational cost.

3.2 RSA

RSA is most famous algorithm used by many modern computers for ciphering

purposes. It is a type of asymmetric algorithm as it has two different keys for

encryption and decryption. One key is public and other is private.

Steps involved:

The algorithm is done in three basic steps.

1. Key generation

Two keys are generated. One is public key and other is private key.

2. Encryption

Encryption is done by using public key. Anyone with this key can encrypt

data.

3. Decryption

Decryption is done by private key which is only known to receiver.

The flow chart below describes the process for RSA.

Page 21: Encryption Algorithms for Data Security in Local Area

12

Figure 4 — RSA Flowchart

Page 22: Encryption Algorithms for Data Security in Local Area

13

3.3 AES

AES stands for Advanced Encryption Standard. It is also known as Rijndael. It was

established by NIST (National Institute of Standards and Technology), the purpose

of which was to secure sensitive but unclassified information by U.S. Government

agencies. It is now used worldwide.

It is based on principle called substitution-permutation network. It has a fixed block

size of 128 bits and variable key sizes of 128, 192 or 256 bits.

The flow chart below gives an overview of the algorithm.

Figure 5 — AES Flowchart

Page 23: Encryption Algorithms for Data Security in Local Area

14

3.4 TCP protocol

TCP is acronym for Transmission Control Protocol which is a standard used to

establish point to point connection between sender and receiver. It is the protocol

followed by transport layer of OSI layers. It is reliable as compared to UDP. It is

connection-oriented, manages control flow and is widely used by many internet

applications. It keeps track of missing packets and resend them if lost. Data is sent a

continuous stream. Examples of protocols that uses TCP are HTTPS, FTP, SMTP,

HTTP etc.

3.5 UDP protocol

UDP stands for User Datagram protocol which is connectionless protocol i.e. Data

is sent without connection setup. It is a best effort service that does not keep track of

lost packets. It does not reorder packets and transmits them to upper layer as received.

UDP is faster as compared to TCP because it is bare bone protocol with lesser

overhead. Data is sent as individual discrete packets. Examples of protocols that uses

UDP are DNS, TFTP and SNMP.

Figure 6 — TCP

Page 24: Encryption Algorithms for Data Security in Local Area

15

Figure 7 — UDP

Page 25: Encryption Algorithms for Data Security in Local Area

16

Chapter 4

Development Environment

4.1 Java

Java programming language was responsible for implementations of AES and RSA

ciphering algorithms and communication via network. Because we have two

ciphering algorithms to measure their speed, we needed four applications which are

AES Server application, AES Client application, RSA Server application, and RSA

Client application. These applications were written using NetBeans IDE 8.2. In order

to run these applications, the JDK must be installed. The JDK can be install from this

website: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-

downloads-2133151.html

In AES Client Server application, Cygwin terminal must be installed to run the

application. In addition, it is necessary to add the path C:\Cygwin in the system

variable as it is showing below in figure 8.

Figure 8 — System Variable

4.2 C++

C++ programming language was chosen for implementing AES and RSA ciphering

algorithms. The reason why C++ was chosen because it is fast and efficiency

language. Client Server applications were written using NetBeans IDE 8.2. MinGW

Page 26: Encryption Algorithms for Data Security in Local Area

17

terminal must be installed. Also, the path “C:\MinGW\msys\1.0\bin”

,“C:\msys\1.0\bin”, C:\cmake-3.13.4-win64-x64\bin,and “C:\MinGW\bin” must be

added in the system variable in order to run applications. Figure 9 below shows the

installed MinGW terminal in NetBeans program. MinGW is necessary for compiling

and running C++ application in NetBeans program.

Figure 9 — MinGW Terminal

4.3 Wireshark

Wireshark is an open source tool for network analysis and packet analysis tool. It

provides packet sniffing functionality on the computer network which can then be

used for analysis of packets. In case of testing performance of RSA and AES over

the network, Wireshark came in hand. It allows you to filter the packets based on

Page 27: Encryption Algorithms for Data Security in Local Area

18

multiple criteria such as port, source and destination IP address and much more.

Wireshark was chosen to test AES and RSA algorithms.

Page 28: Encryption Algorithms for Data Security in Local Area

19

Chapter 5

Implementation

5.1 Java applications

To test the algorithms, a client-server model was created in JAVA language using

UDP as network protocol. A server is listening to network port 8000 (can be

different) on the computer. Client sends requests to server and server in return

handles client’s requests according to clients requested command. For networking,

DatagramSocket and DatagramPacket classes are used. The server first starts

listening to port assigned and then client application first attempts to connect to the

server to make sure server accepts the connection and then client application starts

sending encrypted message and as soon as server receives message from client it

decrypts it and displays the message and continues listening to network port for more

packets to receive.

5.2 C++ Applications

In a similar fashion as JAVA implementation of encrypted server, we use client-

server model in C++ as well. In C++ we have used sockaddr_in struct for storing IP

address and port information of both server and client in both client and server end

programs and we have used SOCKET class for network communication and have

used SOCK_DGRAM option for socket which specifies that the program will use

UDP packets for communication. Unlike JAVA implementation, the server program

starts and listens to port 8080 (can be different) and client programs starts sending

encrypted messages to server and server decrypts and displays the messages.

Page 29: Encryption Algorithms for Data Security in Local Area

20

5.3 Difficulty in programming in C++ in windows

C++ was originally not made for Windows operating system, in windows we first

have to download and install the C++ compiler first (either Cygwin or MinGW) to

compile C++ code in Windows in contrast to Linux which has pre-installed C++

compiler, and later on, while programming client-server model in windows, regular

socket libraries that usually work in Linux don’t work in Windows. In Windows

“winstock.h” is used.

5.4 TCP Protocol

It was useless to test in TCP protocol because TCP protocol is made on top of UDP

protocol with additional security and packet loss recovery mechanism, TCP takes a

lot of network overhead as compared to UDP because of its additional functionality

which makes it slow, and since we are testing the speed of our own encryption

algorithm, we don’t need additional overhead so that’s why we use UDP protocol

instead of TCP.

Page 30: Encryption Algorithms for Data Security in Local Area

21

Chapter 6

Testing

Client Server applications were tested under Windows 7 x64 operating system. The

testing was considering of four parts:

1) Configure the DHCP Server

2) Run the Server and the client applications for each algorithm (include java

and C++)

3) Capture UDP packets using Wireshark program.

4) Calculate the speed of packets.

6.1 DHCP Server Configuration

Before we start writing the configuration in the Clear Terminal program, we need to

make sure that we plug in the two computer’s network cables to the router. After that

we can configure the router’s DHCP server. The figure 10 below shows that VLAN

was created and after that we configured the DHCP.

Figure 10 — DHCP Server Configuration

Page 31: Encryption Algorithms for Data Security in Local Area

22

Figure 11 — DHCP Server Configuration

After we did the configuration, we need to ping each PC as it is shown in the figure

below. PC 1 represents the server with the IP 192.168.1.31.

Figure 12 — The server (PC 1)

PC 2 represents the client with the IP 192.168.1.32.

Page 32: Encryption Algorithms for Data Security in Local Area

23

Figure 13 — The client (PC 2)

6.2 Java Client Server Applications

6.2.1 AES

The Server:

The figure below shows that the server is running and listing on port 8000

Figure 14 — The Server is running

The client:

The client connected to the server using the server’s IP (192.168.1.31) and the port

number (8000). Then the client sent 100 messages to the server.

Page 33: Encryption Algorithms for Data Security in Local Area

24

Figure 15 — The client

The server received 100 messages from the Client

Figure 16 — The Server

Page 34: Encryption Algorithms for Data Security in Local Area

25

Wireshark screenshot:

The first packet was received in 16: 27: 16.484563 and the last packet was received

in 16:27:16.657768. The speed of packets = 16.657768 - 16.484563 = 0.1732

seconds. The two figures below show the first packet and the last packet.

Figure 17 — The First Packet

Page 35: Encryption Algorithms for Data Security in Local Area

26

Figure 18 — The Last Packet

Calculate the average:

To get an accurate result I run the application four times.

Table 4 __ Java AES

Run 1 Run 2 Run 3 Run 4 Average

0.1732 0.179 0.1784 0.1508 0.17035

6.2.2 RSA

The server:

The figure below shows that the server is running and listing on port 8080

Page 36: Encryption Algorithms for Data Security in Local Area

27

Figure 19 — The Server is running

The client:

The client connected to the server using the server’s IP (192.168.1.31) and the port

number (8080). Then the client sent 100 messages to the server.

Figure 20 — The client

The server received 100 messages from the Client

Page 37: Encryption Algorithms for Data Security in Local Area

28

Figure 21 — The Server

Wireshark screenshot:

Figure 22 — The First Packet

Page 38: Encryption Algorithms for Data Security in Local Area

29

Figure 23 — The Last Packet

Calculate the average:

To get an accurate result I run the application four times.

Table 5 __ Java RSA

Run 1 Run 2 Run 3 Run 4 Average

1.8771 2.0169 2.0116 1.8016 1.9268

6.3 C++ Client Server Applications

6.3.1 AES

The Server:

The figure below shows that the server is running and listing on port 8080

Page 39: Encryption Algorithms for Data Security in Local Area

30

Figure 24 — The Server is running

The client:

The client connected to the server using the server’s IP (192.168.1.31) and the port

number (8080). Then the client sent 100 messages to the server.

Figure 25 — The client

The server received 100 messages from the Client

Page 40: Encryption Algorithms for Data Security in Local Area

31

Figure 26 — The Server

Wireshark screenshot:

Figure 27 — The First Packet

Page 41: Encryption Algorithms for Data Security in Local Area

32

Figure 28 — The Last Packet

Calculate the average:

To get an accurate result I run the application four times.

Table 6 __ C++ AES

Run 1 Run 2 Run 3 Run 4 Average

1.7227 1.6851 1.0699 1.078 1.388925

6.3.2 RSA

The server:

The figure below shows that the server is running and listing on port 8080

Page 42: Encryption Algorithms for Data Security in Local Area

33

Figure 29 — The Server is running

The client:

The client connected to the server using the server’s IP (192.168.1.31) and the port

number (8080). Then the client sent 100 messages to the server.

Figure 30 — The Client

The server received 100 messages from the Client

Page 43: Encryption Algorithms for Data Security in Local Area

34

Figure 31 — The Server

Wireshark screenshot:

The first packet:

Figure 32 — The First Packet

Page 44: Encryption Algorithms for Data Security in Local Area

35

The last packet:

Figure 33 — The Last Packet

Calculate the average:

To get an accurate result I run the application four times.

Table 7 __ C++ RSA

Run 1 Run 2 Run 3 Run 4 Average

2.8547 3.6472 2.7558 2.56 2.954425

6.4 The Final results

These graphs given below shows the performance of AES encryption over the

network in both C++ and JAVA, it is clear from the graph that the client-server model

with AES encryption is much faster in JAVA as compared to C++. Almost 80-90%

faster.

Page 45: Encryption Algorithms for Data Security in Local Area

36

Figure 34 — AES comparison

In case of RSA, JAVA model of client-server takes lead as well, with almost 35%

more faster performance than C++.

Figure 35 — RSA Comparison

Page 46: Encryption Algorithms for Data Security in Local Area

37

Chapter 7

Conclusion

In this thesis I used the Standard Java implementations for AES and RSA algorithms

while in C++ I wrote the encryption algorithm by myself. In Java (AES) all packets

are received in 0.17035 seconds and in Java (RSA) all packets are received in 1.9268

seconds. In C++ (AES) all packets are received in 1.388925 seconds and in C++

(RSA) all packets are received in 2.954425 seconds. Hence concluding that AES and

RSA both perform better in Java. The speed of packets was depending on the average

time.

Table 8 __ The Speed of Java and C++

Algorithm JAVA C++

AES 0.17035 seconds 1.388925 seconds

RSA 1.9268 seconds 2.954425 seconds

The model under test was faster in JAVA because JAVA is advance language as

compared to C++, JAVA programs run under java runtime environment (JRE) which

allows automatic garbage collection and avoid memory leakage, the things which we

must do in C++ manually. Also, in Windows C++ do not work efficiently because

Windows is not its native development operating system, Linus is. It may work better

in Linux, but it won’t in Windows.

It was difficult to program the encryption algorithm in C++ because there was very

little help available for C++ in such case, also as said earlier, in C++ we must delete

data variables manually and avoid memory leakage, in JAVA it is done

automatically. Furthermore, in JAVA there are well defined data types to use in

Page 47: Encryption Algorithms for Data Security in Local Area

38

programming, in C++ there are no well-defined data types because of which it is not

easy to program in C++.

Page 48: Encryption Algorithms for Data Security in Local Area

39

References

Al Tamimi, A.-K. (2005). Performance Analysis of Data Encryption Algorithms.

International Conference on Information and Communication

Technologies. Karachi: IEEE. doi:10.1109/ICICT.2005.1598556

Bhoomika Modi, Vinit Gupta. (2016, March). Cryptography with High

Throughput:A survey. p. 7.

Data Encryption Standards. (1977). National Bureau of Standards, 46.

Encryption and Its Importance to Device Networking. (n.d.). Retrieved from

Lantronix: https://www.lantronix.com/wp-content/uploads/pdf/Encryption-

and-Device-Networking_WP.pdf

Kohout, J. (n.d.). Why Is Data Encryption Necessary even in Private Networks?

Retrieved from Teska Labs: https://www.teskalabs.com/blog/seacat-

encryption

RFC2828. (n.d.). Internet Security Glossary. Retrieved from

http://www.faqs.org/rfcs/rfc2828.html

Salem, Tamil Nadu. (n.d.). DATA SECURITY IN LOCAL AREA NETWORK

BASED ON FAST ENCRYPTION. p. 7.

WODEHOUSE, C. (n.d.). Encryption Basics: How It Works & Why You Need It.

Retrieved from Upwork:

https://www.upwork.com/hiring/development/introduction-to-encryption-

data-security/