Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
55 views67 pages

IoT Data Security: Cryptography & Steganography

The Internet of Things (IoT) is a network of connected vehicles, physical devices, software, and electronic items that facilitate data exchange. The purpose of IoT is to provide the IT-infrastructure for the secure and reliable exchange of “Things”. The foundation of IoT mainly consists of the integration of sensors/actuators, radio frequency identification (RFID) tags, and communication technologies. The IoT explains how a variety of physical items and devices can be integrated with the Interne

Uploaded by

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

IoT Data Security: Cryptography & Steganography

The Internet of Things (IoT) is a network of connected vehicles, physical devices, software, and electronic items that facilitate data exchange. The purpose of IoT is to provide the IT-infrastructure for the secure and reliable exchange of “Things”. The foundation of IoT mainly consists of the integration of sensors/actuators, radio frequency identification (RFID) tags, and communication technologies. The IoT explains how a variety of physical items and devices can be integrated with the Interne

Uploaded by

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

Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

1. INTRODUCTION

1.1. INTRODUCTION
The Internet of Things (IoT) is a network of connected vehicles, physical devices,
software, and electronic items that facilitate data exchange. The purpose of IoT is to
provide the IT-infrastructure for the secure and reliable exchange of “Things”. The
foundation of IoT mainly consists of the integration of sensors/actuators, radio frequency
identification (RFID) tags, and communication technologies. The IoT explains how a
variety of physical items and devices can be integrated with the Internet to permit those
objects to cooperate and communicate with each other to reach common goals. The IoT
consists mostly of little materials that are associated together to facilitate collaborative
calculating situations. Constraints of the IoT include energy budget, connectivity, and
computational power.
Although IoT devices have made life easier, little attention has been given to the
security of these devices. Currently, the focus of developers is to increase the capabilities
of these devices, with little emphasis on the security of the devices. The data that is
transferred over the IoT network is vulnerable to attack. This data is needed to be secured
to protect the privacy of the user. If there is no data security, then there is a possibility of
data breach and thus, personal information can be easily hacked from the system. Some
of the important concepts of IoT involve identification and authentication. These
concepts are inter-related to each other as cryptographic functions that are necessary to
ensure that the information is communicated to the correct device and if the source is
trusted or not. With the lack of authentication, a hacker can easily communicate to any
device.
Whenever two devices communicate with each other, there is a transfer of data
between them. The data can also be very sensitive and personal. Therefore, when this
sensitive data is moving from device to device over the IoT network, then there is a need
for encryption of the data. Encryption also helps to protect data from intruders. The data
can be easily encrypted with the help of cryptography, which is the process of converting
simple text into unintelligible text. The primary objectives of cryptography are
confidentiality, integrity, nonrepudiation, and authentication. Elliptic curve cryptography

SRTS , Kadapa Page 1


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

(ECC) is one of the cryptographic algorithms that is used in the proposed work. ECC is a
public key cryptographic technique based on the algebraic structure of elliptic curves
over finite fields.
In addition, to the cryptographic techniques, another method, named
steganography is used in the proposed work which helps to provide additional security to
the data. Steganography hides encrypted messages in such a way that no one would even
suspect that an encrypted message even exists in the first place. In modern digital
steganography, encryption of data occurs using typical cryptographic techniques. Next, a
special algorithm helps to insert the data into redundant data that is part of a file format,
such as a JPEG image. The proposed work uses Matrix XOR steganography to provide
additional security. The image block is optimized with the help of Adaptive Firefly
algorithm in which the encrypted data is hidden in a selected block from a huge image
block.

SRTS , Kadapa Page 2


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

2. LITERATURE SURVEY
1) N. Chervyakov et al., “AR-RRNS: Configurable reliable distributed datastorage
systems for Internet of Things to ensure security”
Benefits of Internet of Things and cloud-fog-edge computing are associated with
the risks of confidentiality, integrity, and availability related with the loss of information,
denial of access for a long time, information leakage, conspiracy and technical failures. In
this article, we propose a configurable, reliable, and confidential distributed data storage
scheme with the ability to process encrypted data and control results of computations.
Our system utilizes Redundant Residue Number System (RRNS) with new method of
error correction codes and secret sharing schemes. We introduce the concept of an
approximate value of a rank of a number (AR), which allows us to reduce the
computational complexity of the decoding from RNS to binary representation, and size of
the coefficients. Based on the properties of the approximate value and arithmetic
properties of RNS, we introduce AR-RRNS method for error detection, correction, and
controlling computational results. We provide a theoretical basis to configure probability
of information loss, data redundancy, speed of encoding and decoding to cope with
different objective preferences, workloads, and storage properties. Theoretical analysis
shows that by appropriate selection of RRNS parameters, the proposed scheme allows not
only increasing safety, reliability, and reducing an overhead of data storage, but also
processing of encrypted data.
2) S. Raza, H. Shafagh, K. Hewage, R. Hummen, and T. Voigt, “Lithe: Lightweight
secure CoAP for the Internet of Things,” IEEE Sensors J., vol. 1, no. 10, pp. 3711–
3720, Oct. 2013.
The Internet of Things (IoT) enables a wide range of application scenarios with
potentially critical actuating and sensing tasks, e.g., in the e-health domain. For
communication at the application layer, resource-constrained devices are expected to
employ the constrained application protocol (CoAP) that is currently being standardized
at the Internet Engineering Task Force. To protect the transmission of sensitive
information, secure CoAP mandates the use of datagram transport layer security (DTLS)
as the underlying security protocol for authenticated and confidential communication.
DTLS, however, was originally designed for comparably powerful devices that are

SRTS , Kadapa Page 3


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

interconnected via reliable, high-bandwidth links. In this paper, we present Lithe-an


integration of DTLS and CoAP for the IoT. With Lithe, we additionally propose a novel
DTLS header compression scheme that aims to significantly reduce the energy
consumption by leveraging the 6LoWPAN standard. Most importantly, our proposed
DTLS header compression scheme does not compromise the end-to-end security
properties provided by DTLS. Simultaneously, it considerably reduces the number of
transmitted bytes while maintaining DTLS standard compliance. We evaluate our
approach based on a DTLS implementation for the Contiki operating system. Our
evaluation results show significant gains in terms of packet size, energy consumption,
processing time, and network-wide response times when compressed DTLS is enabled.
3) M. Vuˇcini´c et al., “OSCAR: Object security architecture for the Internet of
Things,” Ad Hoc Netw., vol. 32, pp. 3–16, Sep. 2015.
Billions of smart, but constrained objects wirelessly connected to the global
network require novel paradigms in network design. New protocol standards, tailored to
constrained devices, have been designed taking into account requirements such as
asynchronous application traffic, need for caching, and group communication. The
existing connection-oriented security architecture is not able to keep up-first, in terms of
the supported features, but also in terms of the scale and resulting latency on small
constrained devices. In this paper, we propose an architecture that leverages the security
concepts both from content-centric and traditional connection-oriented approaches. We
rely on secure channels established by means of (D)TLS for key exchange, but we get rid
of the notion of the “state” among communicating entities. We provide a mechanism to
protect from replay attacks by coupling our scheme with the CoAP application protocol.
Our object-based security architecture (OSCAR) intrinsically supports caching and
multicast, and does not affect the radio duty-cycling operation of constrained objects. We
evaluate OSCAR in two cases: 802.15.4 Low Power and Lossy Networks (LLN) and
Machine-to-Machine (M2M) communication for two different hardware platforms and
MAC layers on a real testbed and using the Cooja emulator. We show significant energy
savings at constrained servers and reasonable delays. We also discuss the applicability of
OSCAR to Smart City deployments.

SRTS , Kadapa Page 4


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

4) Y. Yang, X. Liu, and R. H. Deng, “Lightweight break-glass access control system


for healthcare Internet-of-Things,” IEEE Trans. Ind. Informat., vol. 14, no. 8, pp.
3610–3617, Aug. 2017.
Healthcare Internet-of-things (IoT) has been proposed as a promising means to
greatly improve the efficiency and quality of patient care. Medical devices in healthcare
IoT measure patients' vital signs and aggregate these data into medical files which are
uploaded to the cloud for storage and accessed by healthcare workers. To protect patients'
privacy, encryption is normally used to enforce access control of medical files by
authorized parties while preventing unauthorized access. In healthcare, it is crucial to
enable timely access of patient files in emergency situations. In this paper, we propose a
lightweight break-glass access control (LiBAC) system that supports two ways for
accessing encrypted medical files: attribute-based access and break-glass access. In
normal situations, a medical worker with an attribute set satisfying the access policy of a
medical file can decrypt and access the data. In emergent situations, the break-glass
access mechanism bypasses the access policy of the medical file to allow timely access to
the data by emergency medical care or rescue workers. LiBAC is lightweight since very
few calculations are executed by devices in the healthcare IoT network, and the storage
and transmission overheads are low. LiBAC is formally proved secure in the standard
model and extensive experiments are conducted to demonstrate its efficiency.
5) H. Sun, X. Wang, R. Buyya, and J. Su, “CloudEyes: Cloud-based malware
detection with reversible sketch for resource-constrained Internet of Things (IoT)
devices,” Softw. Pract. Exp., vol. 47, no. 3, pp. 421–441, 2017.
Due to the rapid increasing of malware attacks on the Internet of Things in recent
years, it is critical for resource-constrained devices to guard against potential risks. The
traditional host-based security solution becomes puffy and inapplicable with the
development of malware attacks. Moreover, it is hard for the cloud-based security
solution to achieve both the high performance detection and the data privacy protection
simultaneously. This paper proposes a cloud-based anti-malware system, called
CloudEyes, which provides efficient and trusted security services for resource-
constrained devices. For the cloud server, CloudEyes presents suspicious bucket cross-
filtering, a novel signature detection mechanism based on the reversible sketch structure,

SRTS , Kadapa Page 5


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

which provides retrospective and accurate orientations of malicious signature fragments.


For the client, CloudEyes implements a lightweight scanning agent which utilizes the
digest of signature fragments to dramatically reduce the range of accurate matching.
Furthermore, by transmitting sketch coordinates and the modular hashing, CloudEyes
guarantees both the data privacy and low-cost communications. Finally, we evaluate the
performance of CloudEyes by utilizing both the campus suspicious traffic and normal
files. The results demonstrate that the mechanisms in CloudEyes are effective and
practical, and our system can outperform other existing systems with less time and
communication consumption.

SRTS , Kadapa Page 6


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

3. SYSTEM ANALYSIS

3.1 EXISTING SYSTEM


 Bairagi et al. developed three methods for hiding information so that
communication over the IoT network can be preserved with the help of
steganography. Information is hidden in the deepest layer of the image with the
help of minimal distortion in the least significant bit (LSB) and the sign of the
information can also be utilized. This technique improved imperceptibility and
ability when compared to the actual method.
 Liao et al. proposed a new medical JPEG image steganographic scheme that is
based on the dependencies of interblock coefficients. The basic strategy that is
used in this paper consists of preserving the differences among discrete cosine
transform (DCT) coefficients at the same position in adjacent DCT blocks as
much as possible.
DISADVANTAGES
 The technical heterogeneity, materials, and asymmetric nature of
communication between the Internet and sensor nodes created challenging
security issues.
 Less payload.

3.2 PROPOSED SYSTEM


 In addition, to the cryptographic techniques, another method, named
steganography is used in the proposed work which helps to provide additional
security to the data.
 Steganography hides encrypted messages in such a way that no one would even
suspect that an encrypted message even exists in the first place. In modern digital
steganography, encryption of data occurs using typical cryptographic techniques.
 Next, a special algorithm helps to insert the data into redundant data that is part of
a file format, such as a JPEG image.

SRTS , Kadapa Page 7


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

 The proposed work uses Matrix XOR steganography to provide additional


security. The image block is optimized with the help of Adaptive Firefly
algorithm in which the encrypted data is hidden in a selected block from a huge
image block.
ADVANTAGES
 In the proposed method, a maximum payload is achieved.
 The image can then be easily transferred throughout the Internet such that an
intruder cannot extract the message hidden inside the image.
 Improved efficiency.
 Reduce the complexities.
3.3 FEASIBILTY STUDY
The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During system
analysis the feasibility study of the proposed system is to be carried out. This is to ensure
that the proposed system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential.
Three key considerations involved in the feasibility analysis are
 ECONOMICAL FEASIBILITY
 TECHNICAL FEASIBILITY
 SOCIAL FEASIBILITY
ECONOMICAL FEASIBILITY
This study is carried out to check the economic impact that the system will have
on the organization. The amount of fund that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the
developed system as well within the budget and this was achieved because most of the
technologies used are freely available. Only the customized products had to be purchased.
TECHNICAL FEASIBILITY
This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on the
available technical resources. This will lead to high demands on the available technical
resources. This will lead to high demands being placed on the client. The developed

SRTS , Kadapa Page 8


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

system must have a modest requirement, as only minimal or null changes are required for
implementing this system.
SOCIAL FEASIBILITY
The aspect of study is to check the level of acceptance of the system by the user. This
includes the process of training the user to use the system efficiently. The user must not
real threatened by the system, instead must accept it as a necessity. The level of
acceptance by the users solely depends on the methods that are employed to educate the
user about the system and to make him familiar with it. His level of confidence must be
raised so hat he is also able to make some constructive criticism, which is welcomed, as
he is the final user of the system.
3.4 MODULES OF THE PROJECT
3.4.1. Sender
In this module, Sender has to login with valid username and password. After login
successful he can do some operations such as Browse and encrypt image, Enter message
to hide by secret encrypted key, Hide message into encrypted image using Cryptography
and Steganography Techniques
3.4. 2. Receiver
In this module, there are n numbers of users are present and will do some
operations like Browse and select encrypted image, Decrypt image and extract Hidden
data by ,Cryptography and Steganography Techniques by entering data hidden key, save
message or file
3.4.3 IOT Router
The IOT Router acts as a middleware between sender and receiver to receive and
re route the encrypted image to an appropriate Receiver.

SRTS , Kadapa Page 9


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

4. HARDWARE AND SOFTWARE REQUIREMENT


SPECIFICATIONS
4.1 H/W REQUIREMENTS
 Processor - Pentium –III
 Speed - 1.1 Ghz
 RAM - 256 MB(min)
 Hard Disk - 120 GB
4.2 SOFTWARE REQUIREMENTS
Operating system : Windows XP/7.
Coding Language : Java
IDE : Eclipse

SRTS , Kadapa Page 10


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

5. SYSTEM DESIGN
5.1 INTRODUCTION
A graphical tool used to describe and analyze the moment of data through a
system manual or automated including the process, stores of data, and delays in the
system. Data Flow Diagrams are the central tool and the basis from which other
components are developed. The transformation of data from input to output, through
processes, may be described logically and independently of the physical components
associated with the system. The DFD is also known as a data flow graph or a bubble
chart.
DFDs are the model of the proposed system. They clearly should show the
requirements on which the new system should be built. Later during design activity this is
taken as the basis for drawing the system’s structure charts. The Basic Notation used to
create a DFD’s are as follows:
1. Dataflow: Data move in a specific direction from an origin to a destination.

2. Process: People, procedures, or devices that use or produce (Transform) Data. The
physical component is not identified.

3. Source: External sources or destination of data, which may be People, programs,


organizations or other entities.

Systems design is the process or art of defining the architecture, components,


modules, interfaces, and data for a system to satisfy specified requirements. One could
see it as the application of systems theory to product development. There is some overlap
and synergy with the disciplines of systems analysis, systems architecture and systems
engineering. Database Designing is a part of the development process. In the linear
development cycle, it is used during the system requirements phase to construct the data
components of the analysis model. This model represents the major data objects and the

SRTS , Kadapa Page 11


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

relationship between them. It should not be confused with data analysis, which takes
place in the system design phase. As in a DFD, a model of data consists of a number of
symbols joined up according to certain conventions. System designers describe these
conceptual modeling using symbols from a modeling method known as entity
relationship analysis.
Entity Relationship Diagram
Entity relationship analysis uses three major abstractions to describe data. These are
1. Entities, which are distinct things in the enterprise.
2. Relationships, which are meaningful interactions between the objects.
3. Attributes, which are the properties of the entities and relationship.
The relative simplicity and pictorial clarity of this diagramming technique may well
account in large part for the widespread use of ER model. Such a diagram consists of the
following major components.
E-R Diagram Components

Rectangles, which represent the entity set.

Ellipse, which represent attributes.

Diamonds, which represent relationship sets.


Lines, which link attributes to entity sets and
entity sets to relationships.

Double Ellipse, which represents multi valued attributes.

Double lines, which indicates total participation of an entity


in a relationship set.
Entity
 An entity is an object that exists and is distinguishable from other objects.
 An entity may be concrete or abstract.

SRTS , Kadapa Page 12


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

 An entity is a set of entities of the same type.


 Entity sets need not be disjoint.
 An entity is represented by a set of attributes.

Mapping Constraints
An E-R diagram may define certain constraints which the contents of a database must
conform.
Mapping Cardinalities
It expresses the number of entities to which another entity can be associated via a
relationship. For binary relationship sets between entity sets A and B, the mapping
cardinality must be one of the following:
One-to-One – An entity in A is associated with at most one entity in B, and an entity in
B is associated with at most one entity in A.
One-to-many -An entity in A is associated with any number in B. An entity in B is
associated with any number in A.
Many-to-many – Entities in A and B are associated with any number from each other.
Cardinality: It indicates that which type relationship the business rule follows is called
cardinality.
Connectivity: It specifies that which type of notation the entities are connected in both
sides that one side or many side.
5.2 DATA DICTIONARY
The logical characteristics of current systems data stores, including name,
description, aliases, contents, and organization, identifies processes where the data are
used and where immediate access to information required, Serves as the basis for
identifying database requirements during system design.
Uses of Data Dictionary
 To manage the details in large systems.
 To communicate a common meaning for all system elements.
 To Document the features of the system.
 To facilitate analysis of the details in order to evaluate characteristics and
determine where system changes should be made.

SRTS , Kadapa Page 13


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

 To locate errors and omissions in the system.


5.3 UML DIAGRAMS
It is a language to specifying, visualizing and constructing the artifacts of
software system as well as for business models. UML was originally motivated by the
desire to standardize the disparate notational system and approaches to software design
developed by Grady Booch, Ivar Jacobson and James Rumbaugh at Rational Software in
1994-95. The UML notation is useful for graphically depicting Object Oriented Analysis
and Object Oriented Design modules. The unified modeling language is a standard
language for specifying, Visualizing, Constructing and documenting the software system
and its components. It is a graphical language that provides a vocabulary and set of
semantics and rules. The UML focuses on the conceptual and physical representation of
the system. It captures the decisions and understandings about systems that must be
constructed. It is used to understand, design, configure, maintain and control information
about the systems.
An Overview of UML
The Unified Modeling Language is a language for
 Visualizing.
 Specifying.
 Constructing.
 Documenting.
UML Models
User model view
 This view represents the system from the user’s perspective.
 The analysis representation describes a usage scenario from the end-users
perspective.
Structural model view
 In this model the data and functionality are arrived from inside the system.
 This model view models the static structures.
Behavioral model view

SRTS , Kadapa Page 14


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

It represents the dynamic of Behavioral as parts of the system, depicting the


interactions of collection between various structural elements described in the user model
and structural model view.
Implementation model view
In this the structural and behavioral as parts of the system are represented as they
are to be built.

Environmental model view


In this the structural and Behavioral aspects of the environment in which the system is to
be implemented are represented. UML is specifically constructed through two different
domains they are
 UML Analysis modeling, this focuses on the user model and structural model
views of the system.
 UML design modeling, which focuses on the Bahavioural modeling,
implementation modeling and environmental model views.
A Conceptual model of UML
 The three major elements of UML are
 The UML’s basic building blocks.
 The rules that dictate how those building blocks may be put together.
 Some common mechanisms that apply throughout the UML.
Basic building blocks of the UML
The vocabulary of UML encompasses three kinds of building blocks
 Things.
 Relationships.
 Diagrams.
Things
Things are the abstractions that are first-class citizens in a model. Relationships
tie these things together. Diagrams group the interesting collection of things. There are
four kinds of things in the UML

SRTS , Kadapa Page 15


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Structural things
Behavioral things
Grouping things
Annotational things
Structural Things
Structural things are the nouns of the UML models. These are mostly static parts
of the model, representing elements that are either conceptual or physical. In all, there
are seven kinds of Structural things.
Use Case
Use case is a description of a set of sequence of actions that a system performs
that yields an observable result of value to a particular things in a model. Graphically,
Use Case is rendered as an ellipse with dashed lines, usually including only its name as
shown below.

Fig : Sample Use case diagram


Class
A class is a description of a set of objects that share the same attributes,
operations, relationships, and semantics. A class implements one or more interfaces.
Graphically a class is rendered as a rectangle, usually including its name, attributes and
operations, as shown below.
Windows
Origin
Size
Open()
Close()
Move()
Display()
Fig :Sample Class Diagram
Interface

SRTS , Kadapa Page 16


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

An interface is a collection of operations that specify a service of a class or


component. An interface describes the externally visible behaviour of element.
Graphically the interface is rendered as a circle together with its name.

Fig : Interface
Collaboration
Collaboration defines an interaction and is a society of roles and other elements
that work together to provide some cooperative behaviour that’s bigger than the sum of
all the elements. Graphically, collaboration is rendered as an ellipse with dashed lines,
usually including only its name as shown below.

Fig : Sample Collaboration Diagram

Component
Component is a physical and replaceable part of a system that conforms to and
provides the realization of a set of interfaces. Graphically, a component is rendered as a
rectangle with tabs, usually including only its name, as shown below.

Fig : Sample Component Diagram


Node
A Node is a physical element that exists at run time and represents a
computational resource, generally having at least some memory and often, processing
capability. Graphically, a node is rendered as a cube, usually including only its name, as
shown below.

SRTS , Kadapa Page 17


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Fig : Sample Node Diagram

Behavioral Things
Behavioral things are the dynamic parts of UML models. These are the verbs of a
model, representing behavior over time and space.
Interaction
An interaction is a behavior that comprises a set of messages exchanged among a
set of objects within a particular context to accomplish a specific purpose.

Display
Fig : Sample Interaction Diagram
State Machine
A state machine is a behavior that specifies the sequence of states an object or an
interaction goes through during its lifetime on response to events, together with its
responses to those events. Graphically, a state is rendered as rounded rectangle usually
including its name and its sub-states, if any, as shown below.

Fig : Sample State Machine


3. Grouping Things
Grouping things are the organizational parts of the UML models. These are the
boxes into which a model can be decomposed.
Package A package is a general-purpose mechanism for organizing elements into
groups.

Fig : Sample Package Diagram


Annotational Things
Annotational things are the explanatory parts of the UML models.

SRTS , Kadapa Page 18


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Notes
A note is simply a symbol for rendering constraints and comments attached to an
element or a collection of elements. Graphically a note is rendered as a rectangle with
dog-eared corner together, with a textual or graphical comment, as shown below.

Fig : Sample Note Diagram


Relationships in the UML
There are four kinds of relationships in the UML
 Dependency.
 Association.
 Generalization.
 Realization.
These relationships are the basic relational building blocks of the UML. You use
them to write well-formed models. Graphically dependency is rendered as a dashed line,
possibly directed, and occasionally including a label.
------------------->
Fig : Dependency
Second, an association is a structural relationship that describes a set of links, a link being
a connection among objects. Aggregation is a special kind of association, representing a
structural relationship between a whole and its parts. Graphically, an association is
rendered as a solid line, possibly directed, occasionally including a label, and often
containing other adornments, such as multiplicity and role names.
Employer Employee
Fig : Association
Third, a generalization is a specialization/generalization relationship in which objects of
the specialized element are substitutable for objects of the generalized element (the
parent). In this way, the child shares the structure and the behavior of the parent.
Graphically a generalization relationship is rendered as a solid line with a hollow
arrowhead pointing to the parent.

SRTS , Kadapa Page 19


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Fig : Generalization
Fourth, a realization is a semantic relationship between classifiers, wherein one classifier
specifies a contract that another classifier guarantees to carry out. You’ll encounter
realization relationships in two places between interfaces and the classes or components
that realize them and between use cases and the collaborations that realize them.

Fig : Realization
Each UML diagram is designed to let developers and customers view a software system
from a different perspective and in varying degrees of abstraction. Use Case Diagram
displays the relationship among actors and use cases.
Class Diagram models class structure and contents using design elements such as classes,
packages and objects. It also displays relationships such as containment, inheritance,
associations and others.
Interaction Diagrams
Sequence Diagram displays the time sequence of the objects participating in the
interaction. This consists of the vertical dimension (time) and horizontal dimension
(different objects).
 Collaboration Diagram displays an interaction organized around the objects and
their links to one another. Numbers are used to show the sequence of messages.
 State Diagram displays the sequences of states that an object of an interaction
goes through during its life in response to received stimuli, together with its
responses and actions.
Activity Diagram displays a special state diagram where most of the states are action
states and most of the transitions are triggered by completion of the actions in the source
states. This diagram focuses on flows driven by internal processing.
Physical Diagrams
 Component Diagram displays the high level packaged structure of the code itself.
Dependencies among components are shown, including source code components,

SRTS , Kadapa Page 20


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

binary code components, and executable components. Some components exist at


compile time, at link time, at run times well as at more than one time.
 Deployment Diagram displays the configuration of run-time processing elements
and the software components, processes, and objects that live on them. Software
component instances represent run-time manifestations of code.
Diagrams in the UML
5.3.1 Use Case Diagram
Use-case diagram graphically depict system behavior. These diagrams present a
high level view of how the system is used as viewed from an outsider’s (actor’s)
perspective. A use-case diagram may depict all or some of the use cases of a system.
A use-case diagram can contain:
 Actors
 Use cases
Interaction or relationship between actor and use cases in the system including the
associations, dependencies, and generalizations. Use-case diagram can be used during
analysis to capture the system requirements and to understand how the system should
work. During the design phase, you can use use-case diagrams to specify the behavior of
the systems implemented.

Use Case Diagram

SRTS , Kadapa Page 21


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

CLASS DIAGRAM
In software engineering, a class diagram in the Unified Modeling Language (UML)
is a type of static structure diagram that describes the structure of a system by showing
the system's classes, their attributes, operations (or methods), and the relationships among
the classes. It explains which class contains information.

SRTS , Kadapa Page 22


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

FIG: Class Diagram

SEQUENCE DIAGRAM

A sequence diagram in Unified Modeling Language (UML) is a kind of


interaction diagram that shows how processes operate with one another and in what
order. It is a construct of a Message Sequence Chart. Sequence diagrams are sometimes
called event diagrams, event scenarios, and timing diagrams.

SRTS , Kadapa Page 23


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Fig 6.7: Sequence Diagram

ACTIVITY DIAGRAM

SRTS , Kadapa Page 24


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

FIG 6.8: Activity Diagram

SRTS , Kadapa Page 25


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

6. IMPLEMENTATION AND RESULTS


6.1 TECHNOLOGY USED
Java technology is both a programming language and a platform.
The Java Programming Language
The Java programming language is a high-level language that can be
characterized by all of the following buzzwords:
 Simple
 Architecture neutral
 Object oriented
 Portable
 Distributed
 High performance
 Interpreted
 Multithreaded
 Robust
 Dynamic
 Secure
With most programming languages, you either compile or interpret a program so
that you can run it on your computer. The Java programming language is unusual in that
a program is both compiled and interpreted. With the compiler, first you translate a
program into an intermediate language called Java byte codes —the platform-
independent codes interpreted by the interpreter on the Java platform. The interpreter
parses and runs each Java byte code instruction on the computer. Compilation happens
just once; interpretation occurs each time the program is executed. The following figure
illustrates how this works.

SRTS , Kadapa Page 26


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Fig 6.1.1 : Java Compiler Architecture


You can think of Java byte codes as the machine code instructions for the Java
Virtual Machine (Java VM). Every Java interpreter, whether it’s a development tool or a
Web browser that can run applets, is an implementation of the Java VM. Java byte codes
help make “write once, run anywhere” possible. You can compile your program into byte
codes on any platform that has a Java compiler. The byte codes can then be run on any
implementation of the Java VM. That means that as long as a computer has a Java VM,
the same program written in the Java programming language can run on Windows 2000,
a Solaris workstation, or on an iMac.

Fig 6.1.2 : Platform Independent Architecture


The Java Platform
A platform is the hardware or software environment in which a program runs.
We’ve already mentioned some of the most popular platforms like Windows 2000,
Linux, Solaris, and MacOS. Most platforms can be described as a combination of the
operating system and hardware. The Java platform differs from most other platforms in
that it’s a software-only platform that runs on top of other hardware-based platforms.
The Java platform has two components:
 The Java Virtual Machine (Java VM)
 The Java Application Programming Interface (Java API)
You’ve already been introduced to the Java VM. It’s the base for the Java
platform and is ported onto various hardware-based platforms.

SRTS , Kadapa Page 27


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

The Java API is a large collection of ready-made software components that


provide many useful capabilities, such as graphical user interface (GUI) widgets. The
Java API is grouped into libraries of related classes and interfaces; these libraries are
known as packages. The next section, What Can Java Technology Do? Highlights what
functionality some of the packages in the Java API provide.
The following figure depicts a program that’s running on the Java platform. As
the figure shows, the Java API and the virtual machine insulate the program from the
hardware.

Native code is code that after you compile it, the compiled code runs on a specific
hardware platform. As a platform-independent environment, the Java platform can be a
bit slower than native code. However, smart compilers, well-tuned interpreters, and just-
in-time byte code compilers can bring performance close to that of native code without
threatening portability.
What Can Java Technology Do?
The most common types of programs written in the Java programming language
are applets and applications. If you’ve surfed the Web, you’re probably already familiar
with applets. An applet is a program that adheres to certain conventions that allow it to
run within a Java-enabled browser.
However, the Java programming language is not just for writing cute, entertaining
applets for the Web. The general-purpose, high-level Java programming language is also
a powerful software platform. Using the generous API, you can write many types of
programs.
An application is a standalone program that runs directly on the Java platform. A
special kind of application known as a server serves and supports clients on a network.
Examples of servers are Web servers, proxy servers, mail servers, and print servers.
Another specialized program is a servlet. A servlet can almost be thought of as an applet
that runs on the server side. Java Servlets are a popular choice for building interactive

SRTS , Kadapa Page 28


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

web applications, replacing the use of CGI scripts. Servlets are similar to applets in that
they are runtime extensions of applications. Instead of working in browsers, though,
servlets run within Java Web servers, configuring or tailoring the server.
How does the API support all these kinds of programs? It does so with packages
of software components that provides a wide range of functionality. Every full
implementation of the Java platform gives you the following features:
 The essentials: Objects, strings, threads, numbers, input and output, data
structures, system properties, date and time, and so on.
 Applets: The set of conventions used by applets.
 Networking: URLs, TCP (Transmission Control Protocol), UDP (User
Data gram Protocol) sockets, and IP (Internet Protocol) addresses.
 Internationalization: Help for writing programs that can be localized for
users worldwide. Programs can automatically adapt to specific locales and
be displayed in the appropriate language.
 Security: Both low level and high level, including electronic signatures,
public and private key management, access control, and certificates.
 Software components: Known as JavaBeansTM, can plug into existing
component architectures.
 Object serialization: Allows lightweight persistence and communication
via Remote Method Invocation (RMI).
 Java Database Connectivity (JDBCTM): Provides uniform access to a
wide range of relational databases.
The Java platform also has APIs for 2D and 3D graphics, accessibility, servers,
collaboration, telephony, speech, animation, and more. The following figure depicts what
is included in the Java 2 SDK.

SRTS , Kadapa Page 29


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Fig 6.1.3 : JRE

6.2 METHODS OF IMPLEMENTATIONS


JDBC
In an effort to set an independent database standard API for Java; Sun
Microsystems developed Java Database Connectivity, or JDBC. JDBC offers a generic
SQL database access mechanism that provides a consistent interface to a variety of
RDBMSs. This consistent interface is achieved through the use of “plug-in” database
connectivity modules, or drivers. If a database vendor wishes to have JDBC support, he
or she must provide the driver for each platform that the database and Java run on.
To gain a wider acceptance of JDBC, Sun based JDBC’s framework on ODBC.
As you discovered earlier in this chapter, ODBC has widespread support on a variety of
platforms. Basing JDBC on ODBC will allow vendors to bring JDBC drivers to market
much faster than developing a completely new connectivity solution.
JDBC was announced in March of 1996. It was released for a 90 day public
review that ended June 8, 1996. Because of user input, the final JDBC v1.0 specification
was released soon after.
The remainder of this section will cover enough information about JDBC for you to know
what it is about and how to use it effectively. This is by no means a complete overview of
JDBC. That would fill an entire book.

SRTS , Kadapa Page 30


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

JDBC Goals
Few software packages are designed without goals in mind. JDBC is one that,
because of its many goals, drove the development of the API. These goals, in conjunction
with early reviewer feedback, have finalized the JDBC class library into a solid
framework for building database applications in Java.
The goals that were set for JDBC are important. They will give you some insight as to
why certain classes and functionalities behave the way they do. The eight design goals
for JDBC are as follows:
IP datagram’s
The IP layer provides a connectionless and unreliable delivery system. It
considers each datagram independently of the others. Any association between datagram
must be supplied by the higher layers. The IP layer supplies a checksum that includes its
own header. The header includes the source and destination addresses. The IP layer
handles routing through an Internet. It is also responsible for breaking up large datagram
into smaller ones for transmission and reassembling them at the other end.
UDP
UDP is also connectionless and unreliable. What it adds to IP is a checksum for
the contents of the datagram and port numbers. These are used to give a client/server
model - see later.
TCP
TCP supplies logic to give a reliable connection-oriented protocol above IP. It
provides a virtual circuit that two processes can use to communicate
Internet addresses
In order to use a service, you must be able to find it. The Internet uses an address
scheme for machines so that they can be located. The address is a 32 bit integer which
gives the IP address. This encodes a network ID and more addressing.
Network address
Class A uses 8 bits for the network address with 24 bits left over for other
addressing. Class B uses 16 bit network addressing. Class C uses 24 bit network
addressing and class D uses all 32.
Subnet address

SRTS , Kadapa Page 31


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Internally, the UNIX network is divided into sub networks. Building 11 is


currently on one sub network and uses 10-bit addressing, allowing 1024 different hosts.
Host address
8 bits are finally used for host addresses within our subnet. This places a limit of 256
machines that can be on the subnet.
Total Address
The 32 bit address is usually written as 4 integers separated by dots.

Port addresses
A service exists on a host, and is identified by its port. This is a 16 bit number. To
send a message to a server, you send it to the port for that service of the host that it is
running on. This is not location transparency! Certain of these ports are "well known".
Sockets
A socket is a data structure maintained by the system to handle network
connections. A socket is created using the call socket. It returns an integer that is like a
file descriptor. In fact, under Windows, this handle can be used with Read File and Write
File functions.
#include <sys/types.h>
#include <sys/socket.h>
int socket(int family, int type, int protocol);
Here "family" will be AF_INET for IP communications, protocol will be zero, and type
will depend on whether TCP or UDP is used. Two processes wishing to communicate
over a network create a socket each. These are similar to two ends of a pipe - but the
actual pipe does not yet exist.
JFree Chart
JFreeChart is a free 100% Java chart library that makes it easy for developers to
display professional quality charts in their applications. JFreeChart's extensive feature set
includes:
A consistent and well-documented API, supporting a wide range of chart types;
A flexible design that is easy to extend, and targets both server-side and client-side
applications;

SRTS , Kadapa Page 32


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Support for many output types, including Swing components, image files
(including PNG and JPEG), and vector graphics file formats (including PDF, EPS and
SVG);
JFreeChart is "open source" or, more specifically, free software. It is distributed under the
terms of the GNU Lesser General Public Licence (LGPL), which permits use in
proprietary applications.
1. Map
Charts showing values that relate to geographical areas. Some examples include:
(a) population density in each state of the United States, (b) income per capita for each
country in Europe, (c) life expectancy in each country of the world. The tasks in this
project include:
Sourcing freely redistributable vector outlines for the countries of the world,
states/provinces in particular countries (USA in particular, but also other areas).
Creating an appropriate dataset interface (plus default implementation), a rendered, and
integrating this with the existing XYPlot class in JFreeChart;
Testing, documenting, testing some more, documenting some more.
Implement a new (to JFreeChart) feature for interactive time series charts --- to display a
separate control that shows a small version of ALL the time series data, with a sliding
"view" rectangle that allows you to select the subset of the time series data to display in
the main chart.
1. Dashboards
There is currently a lot of interest in dashboard displays. Create a flexible dashboard
mechanism that supports a subset of JFreeChart chart types (dials, pies, thermometers,
bars, and lines/time series) that can be delivered easily via both Java Web Start and an
applet.
2. Property Editors
The property editor mechanism in JFreeChart only handles a small subset of the
properties that can be set for charts. Extend (or reemployment) this mechanism to provide
greater end-user control over the appearance of the charts.
J2ME (Java 2 Micro edition)

SRTS , Kadapa Page 33


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Sun Microsystems defines J2ME as "a highly optimized Java run-time environment
targeting a wide range of consumer products, including pagers, cellular phones, screen-
phones, digital set-top boxes and car navigation systems." Announced in June 1999 at the
JavaOne Developer Conference, J2ME brings the cross-platform functionality of the Java
language to smaller devices, allowing mobile wireless devices to share applications. With
J2ME, Sun has adapted the Java platform for consumer products that incorporate or are
based on small computing devices.
6.3 DATABASE
SQL Level API
The designers felt that their main goal was to define a SQL interface for Java.
Although not the lowest database interface level possible, it is at a low enough level for
higher-level tools and APIs to be created. Conversely, it is at a high enough level for
application programmers to use it confidently. Attaining this goal allows for future tool
vendors to “generate” JDBC code and to hide many of JDBC’s complexities from the end
user.
1. SQL Conformance
SQL syntax varies as you move from database vendor to database vendor. In an effort
to support a wide variety of vendors, JDBC will allow any query statement to be passed
through it to the underlying database driver. This allows the connectivity module to
handle non-standard functionality in a manner that is suitable for its users. 1. JDBC must
be implemental on top of common database interfaces
The JDBC SQL API must “sit” on top of other common SQL level APIs. This goal
allows JDBC to use existing ODBC level drivers by the use of a software interface. This
interface would translate JDBC calls to ODBC and vice versa.
2. Provide a Java interface that is consistent with the rest of the Java system
Because of Java’s acceptance in the user community thus far, the designers feel
that they should not stray from the current design of the core Java system.
3. Keep it simple
This goal probably appears in all software design goal listings. JDBC is no
exception. Sun felt that the design of JDBC should be very simple, allowing for only one

SRTS , Kadapa Page 34


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

method of completing a task per mechanism. Allowing duplicate functionality only


serves to confuse the users of the API.
4. Use strong, static typing wherever possible
Strong typing allows for more error checking to be done at compile time; also,
less error appear at runtime.
5. Keep the common cases simple
Because more often than not, the usual SQL calls used by the programmer are
simple SELECT’s, INSERT’s, DELETE’s and UPDATE’s, these queries should be
simple to perform with JDBC. However, more complex SQL statements should also be
possible.
They are,
1. TABLE
2. QUERY
3. FORM
4. REPORT
5. MACRO
Table: A database is a collection of data about a specific topic.
Views Of Table: We can work with a table in two types,
1. Design View
2. Datasheet View
Design View: To build or modify the structure of a table we work in the table design
view. We can specify what kind of data will be hold.
Datasheet View: To add, edit or analyses the data itself we work in tables datasheet view
mode.
Query: A query is a question that has to be asked the data. Access gathers data that
answers the question from one or more table. The data that make up the answer is either
dynaset (if you edit it) or a snapshot (it cannot be edited).Each time we run query, we get
latest information in the dynaset. Access either displays the dynaset or snapshot for us to
view or perform an action on it, such as deleting or updating.

SRTS , Kadapa Page 35


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

7. SAMPLE CODE
Sendimage.java
import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import java.util.*;

import java.math.*;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.ObjectOutputStream;

import javax.swing.event.*;

import javax.swing.filechooser.*;

import java.beans.*;

import java.awt.event.ActionListener;

import java.sql.*;

import java.lang.*;

import java.awt.event.ActionEvent;

import java.awt.font.*;

import java.lang.String;

import java.awt.Component;

import java.awt.geom.*;

import javax.swing.text.EditorKit;

import javax.swing.event.MouseInputAdapter;

SRTS , Kadapa Page 36


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

import java.awt.image.BufferedImage;

import javax.swing.text.*;

import javax.crypto.Cipher;

import java.security.*;

import java.lang.Exception;

import java.io.DataOutputStream;

import java.io.DataInputStream;

import java.io.Serializable;

import java.util.Random;

import java.io.FilterInputStream;

import javax.crypto.*;

import java.math.BigInteger;

import java.io.BufferedReader;

import java.io.BufferedWriter;

import java.io.InputStream;

import java.io.OutputStream;

import javax.crypto.spec.*;

import java.security.spec.*;

import java.applet.*;

import java.net.*;

public class SendImage extends JFrame implements ActionListener,Runnable{

JLabel label1;

JLabel label2;

JTextField textfield1;

JButton button1;

SRTS , Kadapa Page 37


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

JButton button2;

JButton button3;

JFileChooser filechooser;

File f,tempfilename,Ofilename,Sfilename;

InputStream ins;

OutputStream outs;

InetAddress ipaddress;

String address,name;

int Copened;

Thread t;

String fName,fName1, content;byte b[];

public SendImage() {

SendImageLayout customLayout = new SendImageLayout();

getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));

getContentPane().setLayout(customLayout);

getContentPane().setBackground(Color.ORANGE);

label1 = new JLabel("Note :: Select only image files like .jpg, .bmp, .gif");

getContentPane().add(label1);

label1.setVisible(false);

label1.setFont(new Font("Century",Font.BOLD,18));

label2 = new JLabel("IMAGE");

getContentPane().add(label2);

label2.setFont(new Font("Garamond",Font.BOLD,18));

textfield1 = new JTextField();

getContentPane().add(textfield1);

SRTS , Kadapa Page 38


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

textfield1.setFont(new Font("Century",Font.BOLD,15));

textfield1.setEditable(false);

textfield1.setBackground(Color.LIGHT_GRAY);

textfield1.setToolTipText("Choose the encrypted image file");

button1 = new JButton("BROWSE");

getContentPane().add(button1);

button1.setFocusable(true);

button1.addActionListener(this);

button1.setRolloverEnabled(true);

button1.setContentAreaFilled(true);

button1.setBorderPainted(true);

button1.setVerifyInputWhenFocusTarget(true);

button1.setFont(new Font("Garamond", Font.BOLD, 16));

button2 = new JButton("CANCEL");

getContentPane().add(button2);

button2.setFocusable(true);

button2.addActionListener(this);

button2.setRolloverEnabled(true);

button2.setContentAreaFilled(true);

button2.setBorderPainted(true);

button2.setToolTipText("Cancels the current operation and returns to the main menu");

button2.setVerifyInputWhenFocusTarget(true);

button2.setFont(new Font("Garamond", Font.BOLD, 16));

button3 = new JButton("EXIT");

getContentPane().add(button3);

SRTS , Kadapa Page 39


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

button3.setFocusable(true);

button3.addActionListener(this);

button3.setRolloverEnabled(true);

button3.setContentAreaFilled(true);

button3.setBorderPainted(true);

button3.setVerifyInputWhenFocusTarget(true);

button3.setFont(new Font("Garamond", Font.BOLD, 16));

t=new Thread(this);

t.start();

filechooser=new JFileChooser();

filechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);

setSize(getPreferredSize());

addWindowListener(new WindowAdapter() {

public void windowClosing(WindowEvent e) {

System.exit(0);

});

public void run()

try

recv r=new recv();

catch(Exception e)

SRTS , Kadapa Page 40


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

System.out.println(e);

public static void main(String args[]) {

SendImage si = new SendImage();

si.setTitle("Upload encrypted image");

si.pack();

si.show();

JFrame.setDefaultLookAndFeelDecorated(true);

JDialog.setDefaultLookAndFeelDecorated(true);

try

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
);

//javax.swing.UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");

catch (Exception ex)

System.out.println("Failed loading L&F: ");

System.out.println(ex);

public void actionPerformed(ActionEvent e)

SRTS , Kadapa Page 41


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

try

String cmd;

cmd = e.getActionCommand();

if(cmd.equals("CANCEL"))

dispose();

Stegno s = new Stegno();

s.show();

s.pack();

s.setTitle("Main Menu - Implementation of Steganography");

if(cmd.equals("BROWSE"))

try {

JFileChooser file = new JFileChooser();

file.setCurrentDirectory(new File(System.getProperty("user.home")));

//filter the files

FileNameExtensionFilter filter = new FileNameExtensionFilter("*.Images",


"jpg","gif","png");

file.addChoosableFileFilter(filter);

int result = file.showSaveDialog(null);

//if the user click on save in Jfilechooser

if(result == JFileChooser.APPROVE_OPTION){

File selectedFile = file.getSelectedFile();

SRTS , Kadapa Page 42


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

String path = selectedFile.getAbsolutePath();

fName1 = selectedFile.getName();

FileInputStream fis = new FileInputStream(path);

byte b[] = new byte[fis.available()];

fis.read(b);

String content = new String(b);

textfield1.setText(path+fName1);

JOptionPane.showMessageDialog(null, path+fName1);

String[] Recivers = { "Select Reciver","A", "B", "C"};

String Reciver = (String) JOptionPane.showInputDialog(null,

"Select Receiver", "Select", JOptionPane.QUESTION_MESSAGE,

null, Recivers, Recivers[0]);

String ip = JOptionPane.showInputDialog(null,

"Enter Receiver IP Address");

Socket sc1 = new Socket(ip, 456);

ObjectOutputStream out = new ObjectOutputStream(sc1.getOutputStream());

out.writeObject(Reciver);

out.writeObject(ip);

out.writeObject(fName1);

out.writeObject(b);

//if the user click on save in Jfilechooser

} catch (Exception e1) {

e1.printStackTrace();

SRTS , Kadapa Page 43


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

if(cmd.equals("EXIT"))

dispose();

Stegno s = new Stegno();

s.show();

s.pack();

s.setTitle("Main Menu - Implementation of Steganography");

} // end try

catch(Exception xe)

//xe.printStackTrace();

JOptionPane.showMessageDialog(this,xe,"Error",JOptionPane.ERROR_MESSAGE);

class recv extends JFrame implements Runnable

JFileChooser fc;

ServerSocket ss;

Socket s;

InputStream ins;

OutputStream out;

byte b[];

int len;

SRTS , Kadapa Page 44


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

public recv() throws Exception

b=new byte[100];

fc=new JFileChooser();

fc.setFileSelectionMode(JFileChooser.FILES_ONLY);

ss=new ServerSocket(6000);

torun();

public void torun() throws Exception

while(true)

s=ss.accept();

ins=s.getInputStream();

String string="You have received an Image File,Save it";

JOptionPane.showMessageDialog(this,string,"Information",JOptionPane.INFORMATIO
N_MESSAGE);

int r=fc.showSaveDialog(this);

File file=fc.getSelectedFile();

out=new FileOutputStream(file);

Thread t=new Thread(this);

t.start();

public void run()

SRTS , Kadapa Page 45


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

try

while(true)

int n=ins.read();

if(n==-1) break;

out.write(n);

ins.close();

out.close();

s.close();

JOptionPane.showMessageDialog(null,"\nYour encrypted image file has been


uploaded successfully\n","message",JOptionPane.INFORMATION_MESSAGE);

catch(Exception e)

System.out.println(e);

//e.printStackTrace();

} // end of run

} //end of class

class SendImageLayout implements LayoutManager {

public SendImageLayout() {

SRTS , Kadapa Page 46


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

public void addLayoutComponent(String name, Component comp) {

public void removeLayoutComponent(Component comp) {

public Dimension preferredLayoutSize(Container parent) {

Dimension dim = new Dimension(0, 0);

Insets insets = parent.getInsets();

dim.width = 579 + insets.left + insets.right;

dim.height = 188 + insets.top + insets.bottom;

return dim;

public Dimension minimumLayoutSize(Container parent) {

Dimension dim = new Dimension(0, 0);

return dim;

public void layoutContainer(Container parent) {

Insets insets = parent.getInsets();

Component c;

c = parent.getComponent(0);

if (c.isVisible()) {c.setBounds(insets.left+70,insets.top+16,550,34);}

c = parent.getComponent(1);

if (c.isVisible()) {c.setBounds(insets.left+46,insets.top+64,96,32);}

c = parent.getComponent(2);

if (c.isVisible()) {c.setBounds(insets.left+112,insets.top+64,330,32);}

SRTS , Kadapa Page 47


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

c = parent.getComponent(3);

if (c.isVisible()) {c.setBounds(insets.left+448,insets.top+62,114,35);}

c = parent.getComponent(4);

if (c.isVisible()) {c.setBounds(insets.left+152,insets.top+120,124,38);}

c = parent.getComponent(5);

if (c.isVisible()) {c.setBounds(insets.left+295,insets.top+120,124,38);}

SRTS , Kadapa Page 48


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

8. TESTING
Testing is a process, which reveals errors in the program. It is the major quality
measure employed during software development. During software development, during
testing, the program is executed with a set of test cases and the output of the program for
the test cases is evaluated to determine if the program is performing as it is expected to
perform.

8.1 Testing Methodologies

In order to make sure that the system does not have errors, the different levels of
testing strategies to that are applied to at differing phases of software development.

Unit Testing

Unit testing is done on individual modules as they are completed and become
executable. It is confined only to the designer's requirements.
Each module can be tested using the following two Strategies,

Black Box Testing

In this strategy some test cases are generated as input conditions that fully execute all
functional requirements for the program. This testing has been uses to find errors in the
following categories:
 Incorrect or missing functions
 Interface errors
 Errors in data structure or external database access
 Performance errors
 Initialization and termination errors.
In this testing only the output is checked for correctness. The logical flow of the data
is not checked.

SRTS , Kadapa Page 49


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

White Box Testing

In this the test cases are generated on the logic of each module by drawing flow
graphs of that module and logical decisions are tested on all the cases. It has been uses to
generate the test cases in the following cases:
 Guarantee that all independent paths have been executed.
 Execute all logical decisions on their true and false Sides.
 Execute all loops at their boundaries and within their operational bounds
 Execute internal data structures to ensure their validity.

Integrating Testing

Integration testing ensures that software and subsystems work together a whole.
It tests the interface of all the modules to make sure that the modules behave properly
when integrated together.

System Testing

Here the entire software system is tested. The reference document for this process
is the requirements document, and the goal is to see if software meets its requirements.
Here entire ‘Cybernetic Protectors Application’ has been tested against requirements of
project and it is checked whether all requirements of project have been satisfied or not.

Acceptance Testing

Acceptance Test is performed with realistic data of the client to demonstrate that
the software is working satisfactorily. Testing here is focused on external behavior of the
system; the internal logic of program is not emphasized. In this project ‘Cybernetic
Protectors Application’ I have collected some data and tested whether project is working
correctly or not. Test cases should be selected so that the largest number of attributes of
an equivalence class is exercised at once. The testing phase is an important part of
software development. It is the process of finding errors and missing operations and also
a complete verification to determine whether the objectives are met and the user
requirements are satisfied.

SRTS , Kadapa Page 50


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

Test Approach
Testing can be done in two ways:

 Bottom up approach
 Top down approach
Bottom Up Approach

Testing can be performed starting from smallest and lowest level modules and
proceeding one at a time. For each module in bottom up testing a short program executes
the module and provides the needed data so that the module is asked to perform the way
it will when embedded with in the larger system.

Top down Approach


This type of testing starts from upper level modules. Since the detailed activities
usually performed in the lower level routines are not provided stubs are written. A stub is
a module shell called by upper level module and that when reached properly will return a
message to the calling module indicating that proper interaction occurred. No attempt is
made to verify the correctness of the lower level module.
Validation

The system has been tested and implemented successfully and thus ensured that all
the requirements as listed in the software requirements specification are completely
fulfilled. In case of erroneous input corresponding error messages are displayed.

Test Cases

SRTS , Kadapa Page 51


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

S. TEST EXPECTED ACTUAL


INPUT STATUS
No. CASES RESULT RESULT

Enter
Admin Admin Main Page
1 username and pass
Login Should login displayed
password

Enter Invalid Invalid


Admin Admin
2 username and username/pass fail
Login Should login
password word

Browse the Message


Encrypt and
Image File should be
3 Stegano embedded pass
and Enter the embedded
successfully
Msg into the image

Select the Image should Image Saved


4 Save Image Pass
Save Button be Save Successfully

Image Received
Browse the Image Should
by Router and
5 Send Image Encrypted be send to the pass
send to
Image Router
Receiver

Browse the
Encrypted
Message
Image and Message
6 Receiver should be Pass
Enter Decrypted
decrypt
Encryption
key

Table: Test Case Results

SRTS , Kadapa Page 52


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9. OUTPUT SCREENS
9.1 Login

SRTS , Kadapa Page 53


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.2 Main Menu

SRTS , Kadapa Page 54


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.3 Encrypt Image

SRTS , Kadapa Page 55


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.4 Encryption Key

SRTS , Kadapa Page 56


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.5 Save Encrypted Image

SRTS , Kadapa Page 57


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.6 saved Encrypted Image

SRTS , Kadapa Page 58


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.7 Send Encrypted Image

SRTS , Kadapa Page 59


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.8 Select Receiver

SRTS , Kadapa Page 60


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.9 Enter IP Address

SRTS , Kadapa Page 61


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.10 Router

SRTS , Kadapa Page 62


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.11 Enter Decrypted Key

SRTS , Kadapa Page 63


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

9.12 Received the Data

SRTS , Kadapa Page 64


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

10. CONCLUSION

CONCLUSION
The EGC protocol generated high levels of data security to serve
the purpose of protecting data during transmission in the IoT. With the
novel ECC over Galois field, the proposed EGC protocol provided better
security. Due to the enhanced embedding efficiency, advanced data
hiding capacity can be achieved. With the help of the proposed
protocol and Adaptive Firefly optimization, any amount of data can be
easily transmitted over the IoT network securely hidden within the
profound layers of images. Performance is evaluated with parameters,
such as embedding efficiency, PSNR, carrier capacity, time complexity,
and MSE. Finally, the proposed work is implemented in a MATLAB
simulator, and approximately 86% steganography embedding
efficiency was achieved. Results from this proposed protocol were
compared to existing methods, such as OMME, FMO, and LSB.

SRTS , Kadapa Page 65


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

11. FUTURE ENHANCEMENTS

It is not possible to develop a system that makes all the requirements of the user. User
requirements keep changing as the system is being used. Some of the future enhancements that
can be done to this system are
1) It is further to implement to send the encryption to key to receiver mail.
2) It is also to implement forgot secret keys to recover

SRTS , Kadapa Page 66


Securing Data in Internet of Things (IoT) Using Cryptography and Steganography Techniques

12. BIBLIOGRAPHY
[1] R. H.Weber, “Internet of Things—New security and privacy challenges,” Comput.
Law Security Rev., vol. 26, no. 1, pp. 23–30, 2010.
[2] A. Ukil, J. Sen, and S. Koilakonda, “Embedded security for Internet of Things,” in
Proc. 2nd Nat. Conf. Emerg. Trends Appl. Comput. Sci. (NCETACS), Mar. 2011, pp. 1–6.
[3] W. Daniels et al., “SμV-the security microvisor: A virtualisation-based security
middleware for the Internet of Things,” in Proc. ACM 18th ACM/IFIP/USENIX
Middleware Conf. Ind. Track, Dec. 2017, pp. 36–42.
[4] U. Banerjee, C. Juvekar, S. H. Fuller, and A. P. Chandrakasan, “eeDTLS: Energy-
efficient datagram transport layer security for the Internet of Things,” in Proc.
GLOBECOM IEEE Glob. Commun. Conf., Dec. 2017, pp. 1–6.
[5] G. Manogaran, C. Thota, D. Lopez, and R. Sundarasekar, “Big data security
intelligence for healthcare industry 4.0,” in Cybersecurity for Industry 4.0. Cham,
Switzerland: Springer, 2017, pp. 103–126.
[6] H. Sun, X. Wang, R. Buyya, and J. Su, “CloudEyes: Cloud-based malware detection
with reversible sketch for resource-constrained Internet of Things (IoT) devices,” Softw.
Pract. Exp., vol. 47, no. 3, pp. 421–441, 2017.
[7] N. Chervyakov et al., “AR-RRNS: Configurable reliable distributed data storage
systems for Internet of Things to ensure security,” Future Gener.Comput. Syst., vol. 92,
pp. 1080–1092, Mar. 2019.
[8] S. Raza, H. Shafagh, K. Hewage, R. Hummen, and T. Voigt, “Lithe: Lightweight
secure CoAP for the Internet of Things,” IEEE Sensors J., vol. 1, no. 10, pp. 3711–3720,
Oct. 2013.
[9] M. Vuˇcini´c et al., “OSCAR: Object security architecture for the Internet of Things,”
Ad Hoc Netw., vol. 32, pp. 3–16, Sep. 2015.
[10] Y. Yang, X. Liu, and R. H. Deng, “Lightweight break-glass access control system
for healthcare Internet-of-Things,” IEEE Trans. Ind. Informat., vol. 14, no. 8, pp. 3610–
3617, Aug. 2017.

SRTS , Kadapa Page 67

You might also like