Secure Data Encryption and Decryption Using Crypto-Stego
Secure Data Encryption and Decryption Using Crypto-Stego
A PROJECT REPORT
Submitted by
M. VENKATESH 316126510028
G. SATISH 316126510010
K. RAM SUDEEP 316126510018
M. SUDARSHAN 316126510051
i
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
ANIL NEERUKONDA INSTITUTE OF TECHNOLOGYAND SCIENCES
(UGC Autonomous)
(Affiliated to AU, Approved by AICTE and Accredited by NBA & NAAC with ‘A’
Grade)
Sangivalasa, bheemili mandal, visakhapatnam dist.(A.P)
BONAFIDE CERTIFICATE
ii
DECLARATION
This is to certify that the project work entitled “SECURE DATA ENCRYPTION
AND DECRYPTION USING CRYPTO-STEGO” is a bonafide work carried
out by M.VENKATESH, G.SATISH, K.SUDDEP, M.SUDARSHAN as a part
of B.Tech final year second semester of Computer Science & Engineering from
Anits during the year 2019-2020.
M. VENKATESH 316126510028
G. SATISH 316126510010
iii
ACKNOWLEDGEMENT
An endeavor over a long period can be advice and support of many well-
wishers. We take this opportunity to express our gratitude and appreciation to all of
them.
We wish to express our sincere thanks and gratitude to our project guide
Mrs. T.Anitha Assistant professor Department of COMPUTER SCIENCE AND
ENGINEERING, ANITS, for the simulating discussions, in analyzing problems
associated with our project work and for guiding us throughout the project. We
express our sincere thanks for the encouragement, untiring guidance and the
confidence they had shown in us.
M. VENKATESH 316126510028
G. SATISH 316126510010
M. SUDARSHAN 316126510051
iv
ABSTRACT
v
LIST OF FIGURES
vi
TABLE OF CONTENTS
ABSTRACT v
LIST OF FIGURES vi
1. INTRODUCTION 1
1.1 Introduction 1
1.1.1 Cryptography 2
1.1.2 Steganography 3
2. LITERATURE SURVEY 10
3. METHODOLOGY 12
3.1System Architecture 12
3.3.1 Base-64 16
vii
3.3.2 RSA 17
3.3.3 Steganography 21
3.4Algorithm Illustration 24
4. DESIGN 26
4.1 Class Diagram 27
7 REFERENCES 60
viii
1. INTRODUCTION
1.1 INTRODUCTION
Digital communication witnesses a noticeable and continuous development in
many applications in the Internet. Hence, secure communication sessions must be
provided. The security of data transmitted across a global network has turned into a
key factor on the network performance measures. So, the confidentiality and the
integrity of data are needed to prevent eavesdroppers from accessing and using
transmitted data. Steganography and Cryptography are two important techniques
that are used to provide network security.
The aim of this project is to develop a new approach to hiding a secret information
in an image, by taking advantage of benefits of combining cryptography and
steganography.
1.1.1 Cryptography
Cryptography is one of the traditional methods used to guarantee the privacy of
communication between parties. This method is the art of secret writing, which is
used to encrypt the plaintext with a key into ciphertext to be transferred between
parties on an insecure channel. Using a valid key, the ciphertext can be decrypted
to the original plaintext. Without the knowledge of the key, nobody can retrieve the
plaintext. Cryptography plays an essential role in many factors required for secure
communication across an insecure channel, like confidentiality, privacy, non-
repudiation, key exchange, and authentication.
1
Fig 1.1.1 : Cryptography as a flow model.
2
1.1.1.2 Asymmetric / Public Key Cryptography
1.1.2 Steganography
It can be defined as the science of hiding and communicating data through
apparently reliable carriers in attempt to hide the existence of the data. So, there is
no knowledge of the existence of the message in the first place. If a person views
the cover which the information is hidden inside, he or she will have no clue that
there is any covering data, in this way the individual won’t endeavour to decode
the data. The secret information can be inserted into the cover media by the stego
system encoder with using certain algorithm. A secret message can be plaintext, an
image, ciphertext, or anything which can be represented in form of a bitstream.
after the secret data is embedded in the cover object, the cover object will be called
as a stego object also the stego object sends to the receiver by selecting the suitable
channel, where decoder system is used with the same stego method for obtaining
original information as the sender would like to transfer .
3
Fig 1.1.2 : Stegonography as a flow model.
A. Text Files
The technique of embedding secret data inside a text is identified as text stego.
Text steganography needs a low memory because this type of file can only store
text files. It affords fast transfer or communication of files from a sender to
receiver.
B. Image Files
It is the procedure in which we embed the information inside the pixels of image.
So, that the attackers cannot observe any change in the cover image. LSB approach
is a common image steganography algorithm.
4
C. Audio Files
It is the process in which we hide the information inside an audio. There are many
approaches to hide secret information in an audio files for examples Phase Coding,
LSB .
D. Video Files
It is the process of hiding some secret data inside the frames of a video.
Steganography and cryptography are used for the purpose of data transmission over an
insecure network without the data being exposed to any unauthorized persons.
Steganography embeds the data in a cover image while cryptography encrypts the data.
The advantage of Steganography is that, the look of the file isn’t changed and this it will
not raise any doubt for the attacker to suspect that there may be some data hidden unlike
cryptography that encrypts the data and sends it to network.
(i) Secret Communication : Steganography does not advertise secret communication and
therefore avoids scrutiny of the sender message. A trade secret, blueprint, or other
sensitive information can be transmitted without alerting potential attackers.
(ii) Feature Tagging : Elements can be embedded inside an image, such as the names of
the individuals in a photo or location in a map. Copying the stego image also copies all of
the embedded features and only parties who possess the decode stego key will be able to
extract and view the features.
(iii) Copyright Protection : Copy protection mechanisms that prevent the data, usually
digital data from being copied. The insertion and analysis of water marks to protect
copyrighted material is responsible for the percent rise of interest digital steganography
and data embedding.
Motivation is very important function for any project. It is one of the methods to induce
the man on the job to get the work done effectively to have the best results towards the
common objectives. It is necessary for the better performance.
Motivation can be seen as the inner drive, which prompts people to act in a way either
towards achieving their personal goals or organizational goals. To a large extent,
motivation is “leadership” as it involves getting the whole staff to learn to work willingly
6
and well in the interest of the business. A leader can influence his subordinate only when
they are convinced.
Conviction can only come when the entire subordinate accepts those factors that propel
actions of individuals, which are referred to as motivation. They may be highly paid,
prestigious titles promotion, praises, bonus, etc. The word is an abstract noun applying to
the entire class of desired need wishes and similar forces. Motivation has to do with
action which results, to satisfaction closely associated with motivation is the word
“miracle” it is injecting of moral and loyalty into the working team so that they will carry
their duties properly and effectively with maximum economy.
The main reason and motivation for choosing this project is, Due to recent developments
in stego analysis, providing security to personal contents, messages, or digital images
using steganography has become difficult. By using stego analysis, one can easily reveal
existence of hidden information in carrier files. So, after been exposed to such problems it
motivated us to do this project where the complete process of transferring of information
is done using two different techniques. All that is required is to select a cover image and
transfer the information using that image.
The purpose of this project is to provide the correct data with security to the users. For
some of the users the data might be lost during the transmission process in the network
and for some, the data might be changed by the unauthorized person in the network and
there are some other security problems in the network. Our application will give you more
Security to the data present in the network and there will be able to reduce the loss of data
in the network which will be transmitted from the sender to the receiver using the latest
technologies. Only the Authorized persons i.e., who are using our application will be
7
there in the Network. The proposed algorithm is to hide the audio data effectively in an
image without any suspicion of the data being hidden in the image. It is to work against
the attacks by using a distinct new image that isn’t possible to compare.
The aim of the project is to hide the data in an image using steganography and ensure that
the quality of concealing data must not be lost.
We used a method for hiding the data in a distinct image file in order to securely send
over the network without any suspicion the data being hidden. This algorithm, though
requires a distinct image which we can use as a carrier and hide the data which is well
within the limits of the threshold that the image can hide, that will secure the data.
Chapter-1 is about introduction which gives an idea about of our project domain i.e
Network Security and title is explained i.e., Secure Data Encryption and Decryption
Using Crypto-Stego, how the data is transmitted between two private parties.
Chapter-2 is about literature survey where all previous methods and existing models are
examined.
Chapter-3 contains methodology, where algorithm is implemented for hiding the data in
an image. Even architecture of the system is explained thoroughly.
Chapter-4 consists of design which includes UML diagrams such as class diagram, use-
case, sequence and activity diagram.
8
Chapter-5 consists experimental analysis and results in this sample code, testing results,
system configurations such as software and hardware requirements, input and output
images are displayed.
Chapter-6 explains conclusion and future work about our project i.e Secure Data
Encryption And Decryption Using Crypto-Stego.
9
2. LITERATURE SURVEY
As we said the significance of network security is increased day by day as the size
of data being transferred across the Internet. This issue pushes the researchers to do
many studies to increase the ability to solve security issues. A solution for this
issue is using the advantage of cryptography and steganography combined in one
system. Many studies propose methods to combine cryptography with
steganography systems in one system. This Project has been implemented on the
basis of the requirements of security i.e. authentication, confidentiality, and
robustness.
There has been a continuous rise in the number of data security threats in the recent
past and it has become a matter of concern for the security experts. Cryptography
and steganography are the best techniques to nullify this threat. The researchers
today are proposing a blended approach of both techniques because a higher level
of security is achieved when both techniques are used together.
We present a method based on combining both the strong encrypting algorithm and
steganographic technique to make the communication of confidential information
safe, secure and extremely hard to decode. An encryption technique is employed
for encrypting a secret message into a Cipher text using the Senders Private Key
and receiver public key. The Cipher Text is finally embedded in a suitable cover
10
image and transferred securely to deliver the secret information. They utilized a
least significant bit method to accomplish the digital image steganography.
At the receiver’s side, the secret data is retrieved through the decoding process.
Thus, a three-level security has been rendered for them a secret message to be
transferred.
11
3. METHODOLOGY
12
3.2 Proposed System
In this section, we will discuss proposed method which combines two different
hiding techniques, which are Cryptography and Steganography. In this proposed
method first, the message is encrypted by use RSA algorithm. After that, we use
the modified LSB technique to embed the encrypted information in image. So, this
technique combines the features of both cryptography and steganography and
provides a high level of security. It is better than either of the technique used
separately. There will be an agreement between the sender and the receiver about
the key for the concealment algorithm as well as the key for the encryption
algorithm or these keys may be exchanged by a secure communication method.
Our method starts by encryption first then hide encrypted data.
START
APPLICATION
ENCRYPTION DECRYPTION
STEGO -IMAGE
Image + Message
5
+
STEGO -IMAGE IMAGE MESSAGE
13
Before applying the cryptography and steganography, initially we convert our
input to Base-64. And we save the obtained text in a text file. Then we proceed to
cryptography and steganography.
The Sender side consists of cryptographic and steganography stages. This method
starts with cryptographic then steganography.
Cryptography Stage :
In encryption stage, we use RSA (Rivest Shamir Adelson) algorithm. This technique
takes two prime numbers. The Encryption can be done using the Plain Text and with
“e” values which was generated using the two prime numbers. Then we will get a
cipher text, which is communicated to the receiving end for decryption. This
encrypted data will be used in steganography stage.
Steganography Stage :
In stenography stage, we use LSB (Least Significant Bit) algorithm with some
modification to hide information (encrypted data from cryptography stage) inside a
cover. In our experiment, we use the image as cover to present our method, but this
method can be applied to other files such as audio, and video. The general LSB
method used to hide secret information into a file; the last bit in each pixel or sample
or frame used sequentially to hide one of the binary stream bits Encryption of the
cover image.
Output= Stego-Image.
14
3.2.2 Receiver side
Receiver side consists of steganography and cryptography stages. In receiver side we
will first extract embedded data then decrypt it.
Steganography Stage :
In the receiver side, we start with steganography then cryptography. We will use the
same steps which are used in sender side.
Cryptography Stage :
In cryptography stage, we use the data which is extracted from stego file and use RSA.
We will use the same steps which are used in sender side. The Decryption can be done
using the Encrypted message, receivers private key and senders public key.
Now the Plain Text is in the form of Base-64. After getting the plain text apply Base-
64 coversion to change the Plain-text to given input, which can be Text, Image,
Video, Audio.
15
3.3 MODULE DIVISION
3.3.1 Base-64
Base 64 is an encoding scheme that converts binary data into text format so that encoded
textual data can be easily transported over network un-corrupted and without any data
loss. Base64 is used commonly in a number of applications including email via MIME,
and storing complex data in XML. Problem with sending normal binary data to a network
is that bits can be misinterpreted by underlying protocols, produce incorrect data at
receiving node and that is why we use this method. The term Base64 is taken from the
Multipurpose Internet Mail Extension (MIME) standard, which is widely used for HTTP
and XML, and was originally developed for encoding email attachments for transmission.
16
3.3.1.3 Base64 Decoding
Base64 decoding is the opposite of Base64 encoding. In other words, it is carried out by
reversing the steps described in the Encoding. So, the Each character in the string is
changed to its Base64 decimal value. The decimal values obtained are converted into their
binary equivalents. The first two bits of the binary numbers are truncated from each of the
binary numbers obtained, and the sets of 6 bits are combined, forming one large string of
binary digits. The large string of binary digits obtained in the previous step is split into
groups of 8 bits. The 8-bit binary numbers are converted into their decimal equivalents.
Finally, the decimal values obtained are converted into their ASCII equivalent.
3.3.1.4 Usage
Base64 is most commonly used to encode binary data (for example images, or sound
files) for embedding into HTML, CSS, EML, and other text documents. In addition,
Base64 is used to encode data that may be unsupported or damaged during transfer,
storage, or output.
Some of the applications of the algorithm:
Attach files when sending emails
Embed images in HTML or CSS via data URI
Preserve raw bytes of cryptographic functions
Output binary data as XML or JSON in API responses
Save binary files to database when BLOB is unavailable
3.3.2 RSA
The RSA algorithm is the basis of a cryptosystem a suite of cryptographic algorithms that
are used for specific security services which enables public key encryption and is widely
used to secure sensitive data, particularly when it is being sent over an insecure network
17
such as the internet. RSA was first publicly described in 1977 by Ron Rivest, Adi Shamir
and Leonard Adleman of the Massachusetts Institute of Technology, though the 1973
creation of a public key algorithm by British mathematician Clifford Cocks was kept
classified by the U.K.'s GCHQ until 1997. In RSA cryptography, both the public and the
private keys can encrypt a message; the opposite key from the one used to encrypt a
message is used to decrypt it. This attribute is one reason why RSA has become the most
widely used asymmetric algorithm, It provides a method to assure the confidentiality,
integrity, authenticity, and non-repudiation of electronic communications and data
storage.
RSA derives its security from the difficulty of factoring large integers that are the product
of two large prime numbers. Multiplying these two numbers is easy, but determining the
original prime numbers from the total or factoring is considered infeasible due to the time
it would take using even today's supercomputers.
The public key consists of the modulus n and a public exponent e. The e doesn't have to
be a secretly selected prime number, as the public key is shared with everyone.
The private key consists of the modulus n and the private exponent d, which is calculated
using the Extended Euclidean algorithm to find the multiplicative inverse with respect to
the totient of n.
18
3.3.2.2 RSA Security
RSA security relies on the computational difficulty of factoring large integers. As
computing power increases and more efficient factoring algorithms are discovered, the
ability to factor larger and larger numbers also increases. Encryption strength is directly
to key size, and doubling key length can deliver an exponential increase in strength,
although it does impair performance. RSA keys are typically 1024-bits or 2048-bits long,
but experts believe that 1024-bit keys are no longer fully secure against all attacks. This is
why the government and some industries are moving to a minimum key length of 2048-
bits.
Modern hardware and software are ECC-ready, and its popularity is likely to grow, as it
can deliver equivalent security with lower computing power and battery resource usage,
making it more suitable for mobile apps than RSA. Finally, a team of researchers, which
included Adi Shamir, a co-inventor of RSA, has successfully created a 4096-bit RSA key
using acoustic cryptanalysis; however, any encryption algorithm is vulnerable to attack.
19
3.3.2.3 Description of Algorithm
Plaintext is taken from a specified file and then encrypted using RSA Algorithm.
Encryption and decryption are of following form for same plaintext M and
ciphertext C.
C=(M^e)modn
M=(C^d)modn
M=((M^e)^d)modn
M=(M^ed)modn
Both sender and receiver must know the value of n.
The sender knows the value of e, and the receiver knows the value of d.
Thus this is a public key encryption algorithm with a public key of PU = {c, n} and
private key of PR= {d, n}.
20
b) Encryption :
Plaintext : M
Ciphertext: C = (M^e) mod n
c) Decryption:
Ciphertext: C
Plaintext : M= (C^d) mod n
Note 1 : (n) -> Euler’s totient function
Note 2: Relationship between C and d is expressed as:
ed (mod (n)) =1
ed = 1 mod (n)
d =e−1 mod (n)
3.3.3 STEGANOGRAPHY
Data hiding is of important in many applications. For hobbyists, secretive data
transmission, privacy of users etc. the basic methods are: Steganography and
Cryptography. Steganography is a simple security method. Generally there are three
different methods used for hiding information: steganography, cryptography,
watermarking. In cryptography, the information to be hidden is encoded using certain
techniques; this information is generally understood to be coded as the data appears
nonsensical. Steganography is hiding information; this generally cannot be identified
because the coded information doesn’t appear to be abnormal i.e. its presence is
undetectable by sight. Detection of steganography is called Stego analysis.
Steganography is of 4 different types:
Text steganography
Image steganography
Audio steganography
Video steganography
21
In all of these methods, the basic principle of steganography is that a secret message is to
be embedded in another cover object. So it cannot be detected easily to be containing
hidden information unless proper decryption is used.
Every steganography consists of three components:
Cover object
Message object
Resulting Steganographic object
Image Steganography
Image Steganography deals with the hiding of data within the image, data can be any file,
such as an image, audio, text or another file. We have to wrap up the data using an image.
We have chosen to bind data in an image. This kind of embedding an audio in an image
helps to authenticate the sender, verify whether valid user is receiving the data or not and
to find whether a third party attacker is present in the channel of communication or not.
Since, image is used as a cover file, we have to make sure that the image must be
accountable for the data that is being embedded. Hence a 24-bit image format proved to
be the best solution for hiding the data, since it holds a large memory space and
convenient to hide a considerable amount of data. Furthermore, the threshold sure of the
image must be calculated for the given image size which will be explained in the laier
parts.
22
24-bit color : every pixel can have one in 2^24 colors, and these are represented as
different quantities of three basic colors : red(R), green(G), blue(b) given by 8 bits
(256) each.
8-bit color : every pixel can have one in 256 (2^28) colors, chosen from a palette,
or a table of colors.
8-bit gray-scale : every pixel can have one in 256 (2^28) shades of gray.
LSB insertion modifies the LSBs of each color in 24-bit images, or the LSBs of the 8-bit
value for 8-bit images. The most basic of LSBs insertion for 24-bit pictures inserts 3
bits/pixel.
For image steganography we are using Spatial methods. In spatial method, the most
common method used is LSB substitution method. Least significant bit (LSB) method is a
common, simple approach to embedding information in a cover file. In steganography,
LSB substitution method is used. I.e. since every image has three components (RGB).
This pixel information is stored in encoded format in one byte. The first bits containing
this information for every pixel can be modified to store the hidden text. For this, the
preliminary condition is that the text to be stored has to be smaller or of equal size to the
image used to hide the text. LSB based method is a spatial domain method. But this is
vulnerable to cropping and noise. In this method, the MSB (most significant bits) of the
message image to be hidden are stored in the LSB (least significant bits) of the image
used as the cover image.
The Human visual system (HVS) cannot detect changes in the colour or intensity of a
pixel when the LSB bit is modified. This is psycho-visual redundancy since this can be
23
used as an advantage to store information in these bits and yet notice no major difference
in the image.
3.3.3.1 Algorithm
Encryption :
b) age
c) Audio
d) Video
Step 8 : Consider an image, And hide the encrypted message(cm) in the given
image with the secret key Using Stegnography Algorithm.
DECRYPTION :
Step 2 : Using the Secrert Key , Obtain the hidden message from the Stego-
Image.
Step 4 : And the obtained message is a Cipher Text. We must decrypt the message.
Step 5 : The Decyption of the message can be done using RSA Algorithm.
Step 6: By Using RSA we will be getting Plain Text.
Step 7 : And thus the receiver will decrypt the message and it is in the form of
Base-64.
Step 8 : Finally by using Base-64 algorithm the Base-64 text is converted into the
original input, Which can be Text, Image, Audio, Video.
25
4. DESIGN
Project design is a major step towards a successful project. A project design is a strategic
organization of ideas, materials and processes for the purpose of achieving a goal. Project
managers rely on a good design to avoid pitfalls and provide parameters to maintain
crucial aspects of the project. Project design is an early phase of the project where a
project's key features, structure, criteria for success, and major deliverables are all
planned out. The point is to develop one or more designs which can be used to achieve
the desired project goals. Stakeholders can then choose the best design to use for the
actual execution of the project. The project design phase might generate a variety of
different outputs, including sketches, flowcharts, HTML screen designs, and more.
So, the design can be implemented using Unified Modeling Language. diagrams such as
class diagram, use case diagram, sequence diagram, activity diagrams. UML offers a way
to visualize a system’s architectural blueprints in a diagram, including elements such as :
Any activites
UML is a common language for business analysts, software architects and developers
used to describe, specify, design, and document existing or new business processes,
structure and behaviour of artifacts of software systems. The key to making a UML
diagram is connecting shapes that represent an object or class with other shapes to
illustrate relationships and the flow of information and data.
26
4.1 Class Diagram
A class diagram in the Unified Modelling Language 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 objects. Class diagram is a static
diagram. It represents the static view of an application. Class diagram is not only used for
visualizing, describing, and documenting different aspects of a system but also for
constructing executable code of the software application. Class diagram describes the
attributes and operations of a class and also the constraints imposed on the system. The
class diagrams are widely used in the modelling of object-oriented systems because they
are the only UML diagrams, which can be mapped directly with object-oriented
languages.
27
4.2 Use Case Diagram
A use case diagram at its simplest is a representation of a user's interaction with the
system that shows the relationship between the user and the different use cases in which
the user is involved. A use case diagram can identify the different types of users of a
system and the different use cases and will often be accompanied by other types of
diagrams as well. The use cases are represented by either circles or ellipses.
28
4.3 Sequence Diagram
A sequence diagram shows object interactions arranged in time sequence. It depicts the
objects and classes involved in the scenario and the sequence of messages exchanged
between the objects needed to carry out the functionality of the scenario. Sequence
diagrams are typically associated with use case realizations in the Logical View of the
system under development. Sequence diagrams are sometimes called event diagrams or
event scenarios.
A sequence diagram shows, as parallel vertical lines, different processes or objects that
live simultaneously and as horizontal arrows, the messages exchanged between them, in
the order in which they occur. This allows the specification of simple runtime scenarios in
a graphical manner.
29
4.4 Activity Diagram
30
5. EXPERIMENTAL ANALYSIS AND RESULTS
5.1 SYSTEM CONFIGURATION
5.1.1 Software Requirements:
Processor: INTEL
31
5.2 SAMPLE CODE
<html >
<head >
<title>Home</title>
<link href= "{{ url_for('static',filename = 'css/bulma.css') }}" rel="stylesheet">
</head>
<body background="{{ url_for('static',filename = 'images/image15.jpg') }}">
5.2.1.1 Encryption
<html>
<head>
<title>Encryption</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename = 'css/bulma.css') }}">
</head>
<body style="padding-left: 20%; padding-top: 5%;padding-right: 20%" background="{{
url_for('static',filename = 'images/encrypt_body.jpg') }}">
32
<div style="padding-left: 20%; padding-top: 10%;padding-right: 20%; padding-bottom: 20">
<img src="">
<h1 class="title is-2 has-text-white">Sender Side</h1>
<form method="post">
<div class="field">
<label class="label has-text-white" >Source Name</label>
<div class="control">
<input class="input" type="text" name="source_name" placeholder="Source Name"
required>
</div>
</div>
<div class="field">
<label class="label has-text-white">Prime 1</label>
<div class="control">
<input class="input" type="text" name="prime_1" placeholder="Enter Prime no.1"
required>
</div>
</div>
<div class="field">
<label class="label has-text-white">Prime 2</label>
<div class="control">
<input class="input" type="text" name="prime_2" placeholder="Enter Prime no.2"
required>
</div>
</div>
<div class="field">
<label class="label has-text-white">Cover Name</label>
<div class="control">
<input class="input" type="text" name="cover_name" placeholder="Cover name" required>
</div>
</div>
<div class="field">
<label class="label has-text-white">New Image Name</label>
<div class="control">
<input class="input" type="text" name="new_name" placeholder="Enter New Name for
saving Image" required>
</div>
</div>
<input type="submit" name="" class="button" value="Submit">
</form>
</div>
</body>
</html>
33
5.2.1.2 Decryption
<html>
<head>
<title>Decryption</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename = 'css/bulma.css') }}">
</head>
<body style="padding-left: 20%; padding-top: 5%;padding-right: 20%" background="{{
url_for('static',filename = 'images/encrypt_body.jpg') }}">
<div style="padding-left: 20%; padding-top: 10%;padding-right: 20%; padding-bottom: 20">
<img src="">
<h1 class="title is-2 has-text-white">Reciever Side</h1>
<form method="post">
<div class="field">
<label class="label has-text-white">Cover Name</label>
<div class="control">
<input class="input" type="text" name= "cover_name" placeholder="Source Name"
required>
</div>
</div>
<div class="field">
<label class="label has-text-white">Prime 1</label>
<div class="control">
<input class="input" type="text" name= "prime_1" placeholder="Enter Prime no.1"
required>
</div>
</div>
<div class="field">
<label class="label has-text-white">Prime 2</label>
<div class="control">
<input class="input" type="text" name= "prime_2" placeholder="Enter Prime no.2"
required>
</div>
</div>
<div class="field">
<label class="label has-text-white">new Cover Name</label>
<div class="control">
<input class="input" type="text" name= "new_cover_name" placeholder="enter new Name"
required>
</div>
</div>
</div>
34
</body>
</html>
5.2.1.3 Connectivity
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/Encryption')
def encrypt():
return render_template('Encryption.html')
@app.route('/Decryption')
def decrypt():
return render_template('Decryption.html')
@app.route('/Encryption', methods=['POST'])
def getdata_enc():
import os
source_name = request.form['source_name']
p = int(request.form['prime_1'])
q = int(request.form['prime_2'])
cover_name = request.form['cover_name']
new_img_name = request.form['new_name']
import base_enc
base_enc.base_enc(source_name)
import rsa_enc
rsa_enc.call_rsa('s.txt', p, q)
import stego_enc
cover_name = os.path.dirname(os.path.abspath(__file__))+'/static/coverimages/'+cover_name
stego_enc.encode(cover_name, new_img_name)
return render_template('thank.html')
35
@app.route('/Decryption', methods=['POST'])
def getdata_dec():
cover_name = request.form['cover_name']
p = int(request.form['prime_1'])
q = int(request.form['prime_2'])
new_cover_name = request.form['new_cover_name']
import stego_dec
stego_dec.decode(cover_name)
import rsa_dec
rsa_dec.rsa_dec(p,q)
import base_dec
base_dec.base_dec(new_cover_name)
return render_template('thank.html')
if __name__ == '__main__':
app.run(debug=True)
5.2.2 Base-64
5.2.2.1 Encryption:
import base64
with open('C:/Users/HP/Desktop/Project/ping.jpg', "rb") as File:
str1= base64.b64encode(File.read())
print(str1)
filename = 's.txt'
# we are considering a file to store the string.
with open(filename, 'wb') as f:
f.write(str1)
36
5.2.2.2 Decryption:
import base64
with open('s.txt', "rb") as File:
str1= (File.read())
imgdata = base64.b64decode(str1)
filename = 'C:/Users/HP/Desktop/Project/pingsss.jpg'
with open(filename, 'wb') as f:
f.write(imgdata)
5.2.3 RSA
5.2.3.1 Encryption:
def convert(txt):
if (txt == "A"):
k=1
elif (txt == "B"):
k=2
elif (txt == "C"):
k=3
elif (txt == "D"):
k=4
elif (txt == "E"):
k=5
elif (txt == "+"):
k = 74
elif (txt == "/"):
k = 75
37
elif (txt == "!"):
k = 63
elif (txt == "@"):
k = 64
elif (txt == "#"):
k = 65
elif (txt == "$"):
k = 66
elif (txt == "%"):
k = 67
elif (txt == "^"):
k = 68
elif (txt == "&"):
k = 69
elif (txt == "*"):
k = 70
elif (txt == "("):
k = 71
elif (txt == ")"):
k = 72
elif (txt == "-"):
k = 73
elif (txt == "+"):
k = 74
elif (txt == "/"):
k = 75
else:
k = "ERROR"
return k
38
def revconvert(num):
if (num == 1):
k = "A"
elif (num == 2):
k = "B"
elif (num == 3):
k = "C"
elif (num == 4):
k = "D"
elif (num == 5):
k = "E"
elif (num == 6):
k = "F"
elif (num == 63):
k = "!"
elif (num == 64):
k = "@"
elif (num == 65):
k = "#"
elif (num == 66):
k = "$"
elif (num == 67):
k = "%"
elif (num == 68):
k = "^"
elif (num == 69):
k = "&"
elif (num == 70):
k = "*"
39
elif (num == 71):
k = "("
elif (num == 72):
k = ")"
elif (num == 73):
k = "-"
elif (num == 74):
k = "+"
elif (num == 75):
k = "/"
else:
k = "Error"
return k
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
if name ==" main ":
p = int(input('Enter the value of p = '))
q = int(input('Enter the value of q = '))
# Input Text..........
file = open("s1.txt","r")
text=file.read()
file.close()
lk = []
#text = input('Enter the value of text = ')
l1 = len(text)
k10 = ""
k20 = ""
for i in range(0, l1):
40
no = convert(text[i])
n=p*q
if (no > n):
print("Please enter correct text ......... ")
else:
t = (p - 1) * (q - 1)
for e in range(2, t):
if gcd(e, t) == 1:
break
for i in range(1, 10):
x=1+i*t
if (x%e==0)
d = int(x /e)
break
ctt=Decimal(0)
ctt = pow(no, e)
ct = ctt % n
lk.append(ct)
ct1 = ct % 75
print('n = ' + str(n) + ' e = ' + str(e) + ' t = ' + str(t) + ' d = ' + str(d) + ' cipher text = ' +
str(ct1)) k1 = revconvert(ct1)
k10 = k10 + k1
print("Cipher Value", k10)
print("Original Value : ",lk)
def get_lk():
return lk
file = open("sample1.txt","w")
file.write(k10)
file.close()
file = open("sample2.txt","w")
for i in lk:
file.write(str(i)+" ")
file.close()
41
5.2.3.2 Decryption:
def convert(txt):
if (txt == "A"):
k=1
elif (txt == "B"):
k=2
elif (txt == "C"):
k=3
elif (txt == "D"):
k=4
elif (txt == "E"):
k=5
elif (txt == "+"):
k = 74
elif (txt == "/"):
k = 75
elif (txt == "!"):
k = 63
elif (txt == "@"):
k = 64
elif (txt == "#"):
k = 65
elif (txt == "$"):
k = 66
elif (txt == "%"):
k = 67
elif (txt == "^"):
k = 68
elif (txt == "&"):
42
k = 69
elif (txt == "*"):
k = 70
elif (txt == "("):
k = 71
elif (txt == ")"):
k = 72
elif (txt == "-"):
k = 73
elif (txt == "+"):
k = 74
elif (txt == "/"):
k = 75
else:
k = "ERROR"
return k
def revconvert(num):
if (num == 1):
k = "A"
elif (num == 2):
k = "B"
elif (num == 3):
k = "C"
elif (num == 4):
k = "D"
elif (num == 5):
k = "E"
elif (num == 6):
43
k = "F"
elif (num == 63):
k = "!"
elif (num == 64):
k = "@"
elif (num == 65):
k = "#"
elif (num == 66):
k = "$"
elif (num == 67):
k = "%"
elif (num == 68):
k = "^"
elif (num == 69):
k = "&"
elif (num == 70):
k = "*"
elif (num == 71):
k = "("
elif (num == 72):
k = ")"
elif (num == 73):
k = "-"
elif (num == 74):
k = "+"
elif (num == 75):
k = "/"
else:
k = "Error"
44
return k
45
5.2.4 Steganography
5.2.4.1 Encryption :
def genData(data):
# list of binary codes
newd = []
for i in data:
newd.append(format(ord(i), '08b'))
return newd
for i in range(lendata):
pix = [value for value in imdata. next ()[:3] + imdata. next ()[:3] +
imdata. next ()[:3]]
if (pix[j] % 2 != 0):
pix[j] -= 1
if (i == lendata - 1):
if (pix[-1] % 2 == 0):
pix[-1] -= 1
else:
if (pix[-1] % 2 != 0):
pix[-1] -= 1
46
pix = tuple(pix)
yield pix[0:3]
yield pix[3:6]
yield pix[6:9]
def encode():
img = input("Enter image name(with extension) : ")
image = Image.open(img, 'r')
file = open("sample1.txt", "r")
data = file.read()
file.close()
print(len(data))
if (len(data) == 0):
raise ValueError('Data is empty')
def main():
a = print(":: Welcome to Steganography ::\n")
47
encode()
5.2.4.2 DECRYPTION
def decode():
img = input("Enter image name(with extension) : ")
image = Image.open(img, 'r')
data = ''
imgdata = iter(image.getdata())
while (True):
pixels = [value for value in imgdata. next ()[:3] +imgdata. next ()[:3] + imgdata. next
(i % 2 == 0):
binstr += '0'
else:
binstr += '1'
48
return data
def main():
print(":: Welcome to Steganography ::\n") sq
= decode()
print("Decoded word- " + sq)
file = open("s09.txt", "w")
file.write(sq)
file.close()
49
5.3 Testing
Fig 5.3.1 Cover Image without any Data Embedded in its key Channel
Fig 5.3.2 : Cover Image with Data Embedded in its key Channel
50
Performance is usally calculated as a number of correct outputs that we get for the given
data set input. The schedule performance index is a measure of how close the project is to
be being completed compared to the schedule. As a ratio it is calculated by dividing the
budgeted cost of work performed, or earned value, by the planned value.
Module File
8 Name Resolution Encryption Decryption
. (w*h) Time (In Time (In
1 Sec) Sec)
Base-64 Ping.png 1080*2160 0.15621 0.0189
Base-64 Sample.jpg 512*320 0.03124 0.0065
Base-64 Anits.jpg 1024*768 0.015 0.0053
Base-64 Picture.jpg 1024*760 0.015 0.0049
Base-64 Audio.mp3 - 0.18856 0.0613
Base-64 Video.mp4 - 0.28654 0.0862
RSA - - 8.5 18.0
Steganograp Flower.png 1080*2160 26.0 6.9
hy
5.3 Performance Measure
The performance measure depends on the success rate of the implementation of the
overall system with respect to the following points.
a) The integrity of the hidden information should not change after embedding.
b) The stego object must remain almost remain unchanged to the naked eye.
c) There should be accuracy in the extracted data.
52
5.4 RESULTS
54
Fig:5.4.4 Image Encryption
55
Fig.5.4.6 Audio Encryption
56
Fig 5.4.8 RSA Encryption
58
6. CONCLUSION AND FUTURE SCOPE
In this project, we deal with the concepts of security of digital data communication
across the network. This project is designed for combining the steganography and
cryptography features factors for better performance. We performed a new
steganography method and combined it with RSA algorithm. The data is hidden in
the image so there will be no chances for the attacker to know that data is being
hidden in the image. We performed our method on image by implementing a
program written in Python language. The method proposed has proved successful
in hiding various types of text, images, audio and videos in color images. We
concluded that in our method the Image files and RSA are better. Because of their
high capacity.
This work presents a scheme that can transmit large quantities of secret
information and provides secure communication between two private parties. Both
steganography and cryptography can be woven in this scheme to make the
detection more complicated. Any kind of text data can be employed as secret msg.
The secret message employing the concept of steganography is sent over the
network. In addition, the proposed procedure is simple and easy to implement.
The Embedding of data is done such as Audio, Video, Image is done in the image,
by choosing a distinct and new image, we can prevent the chance for the attacker to
detect the data being hidden. Results achieved indicate that our proposed method is
encouraging in terms of security, and robustness.
59
7. REFERENCES
[6] Mr. Vikas Tyagi(2012), “Data Hiding in Image Using least significant bit
with cryptography”, International Journal of Advanced Research in computer
science and Software Engineering, Volume 2, Issue 4.
60
Survey Vol.4,NO.1,February.
61
62
International Journal of Computer Applications (0975 – 8887)
Volume 108 – No. 3, December 2014
16
International Journal of Computer Applications (0975 – 8887)
Volume 108 – No. 3, December 2014
17
International Journal of Computer Applications (0975 – 8887)
Volume 108 – No. 3, December 2014
The pseudo random bit generator is used for generating 3. Compute 𝑒2 (𝑥2 , 𝑦2 ) =d × 𝑒1 (𝑥1 , 𝑦1 )
random numbers in cryptography. Seed, two large prime
numbers, and the range is the inputs for the pseudo random bit 4. Q = {𝑒1 , 𝑒2 ,E}
generators. The mathematical formulae has shown below, 5. Return(Q, d)
2
𝑋𝑖+1 = 𝑃𝑋𝑖 + 𝑄 𝑚𝑜𝑑 𝑛 (5)
3.2 Encryption and LSB Embedding
Where P, Q are two large prime numbers, 𝑋𝑖 is the seed. 𝑛 be INPUT:
the range.
Elliptic Curve Domain parameters (p, E, P, n),
2.2.4 Encryption Algorithm public key Q, Plaintext m, message image I, Cover
The secret information may be in any form like text, image image C.
etc. is compressed by wavelet transforms [10]. The OUTPUT: Stego-image CI, Stego key
compressed text is converted into its corresponding ASCII
value, next the ACSII is converted into its 8-bit binary value. 1. Represent the message ‘m’ as a point M in
By using Control NOT gate, the 8-bit binary value is encoded. E (𝐹𝑝 ).
Now these bits are ready to embedded into an image using
2. Select K ∈𝑅 [1, n-1].
LSB insertion. The encrypted message is ready to be
embedded in the cover image. Before embedding the message, 3. Compute 𝐶1 =k× 𝑒1 (𝑥1 , 𝑦1 )
the image is converted into its corresponding pixel values.
These values are arranged in the r × c matrix form, r and c 4. Compute 𝐶2 = M +k× 𝑒2 (𝑥2 , 𝑦2 ).
represent rows and columns respectively. The bit of the secret 5. RGB cover image=C.
information has to be embedded in the random positions in the
cover image. To identify the random positions, Random 6. Hide (C1, C2) into I using LSB
number generator is used. Random numbers act like a key in Steganography.
this technique. Blum/blum/shub generator and Pseudo random
7. Hide I into C using Steganography.
generator are used to se1ect the random rows and columns
respectively. Random numbers are generated by the generator, 8. Return (CI)
using the key (seed). Randomness will be varying from
generator to generator. The randomness is achieved by 3.3 Decryption
padding the bits in the sequence. After selecting the random INPUT:
positions in the image (pixel values) now the secret message
Elliptic Curve Domain parameters (p, E, P, n),
is embedded in the corresponding bits using the LSB insertion
Private key d, stego-image CI, stego key.
technique.
OUTPUT: (message m, image I)
2.2.5 Decryption Process
Decryption is the repeal process of the encryption 1. Extract I from CI Extract 𝐶1 , 𝐶2 from I
process[10]. After receiving the stego image, the receiver will
2. Compute M = 𝐶2 -d× 𝐶1 and compute m
convert the image into its corresponding pixels (matrix form).
from M
With the help of Key (seed) the receiver will be generating the
random number using the random generators to identify in 3. Return (m, I)
which positions the bits have been embedded. After getting
the pixel positions, applying reverse LSB insertion technique 3.4 Background work
will give the encoded bits. Applying the Control NOT gates Consider the elliptical curve is y2 = x3 +4x+20 over finite field
on the encoded bits, the compressed text is retrieved. By F29
applying wavelet, transformation technique (decompression)
the original secret information is retrieved.
3. PROPOSEDMODEL
In the proposed model elliptic curve parameters are(p, E, P,
n,) where p is the prime number Fp denoted as field of integers
modulo p. E is the elliptic curve over Fp is defined by the
equation y2=x3+ax+b where (a,b) are the real numbers over Fp
and satisfy 4a3+27b2≠0 (mod p). The point infinity ∞ is also in
the curve. The abelian subgroup of E(Fp) generated by p is
P={∞, P,2P,3P,………(n-1)P}
2. Select 𝑒1 (𝑥1 , 𝑦1 ).
18
International Journal of Computer Applications (0975 – 8887)
Volume 108 – No. 3, December 2014
Table 2: Different points in elliptical curve mask different C1* ∈{C11, C12, C13……….}
characters.
C2* ∈{C21, C22, C23………} respectively.
∞ 1,5 4,19 20,3 15,27 6,12 17,19
4. Embedded C1* and C2* into the image I
a b c d e f g
5. Choose one cover image C
24,22 8,10 14,23 13,23 10,25 19,13 16,27
6. CI = Embedded I into C
h i j k l m n
5,22 3,1 0,22 27,2 2,23 2,6 27,27 3.4.3 Decryption
INPUT: stego-object, stego key
o p q r s t u
OUTPUT: message ‘m’
0,7 3,28 5,7 6,2 19,16 10,4 13,6
v w x y z 0 1 To extract the cipher text and image from stego object ,the
stego key is used that used to construct a stego object.
14,6 8,19 24,7 17,10 6,17 15,2 20,26
To get the text message from cipher text we use private key
2 3 4 5 6 7 8 that is
4,10 1,24 20,3
M = 𝐶2 -d× 𝐶1
9 space . Consider the above example
3. Separate all C1, C2 and make array of Figure 4. Cover image (animal.jpg)
19
International Journal of Computer Applications (0975 – 8887)
Volume 108 – No. 3, December 2014
Cipher text
huge amount of data will transmit in public network without
(c1, c2)
security violence.
6. ACKNOWLEDGEMENT
The author would like to thank Ms. J. Hyma, assistant
professor, cse department, GITAM University, for various
help and guidance.
7. REFERENCES
[1] M. M Amin, M. Salleh, S .Ibrahim, M.R.K atmin, and
M.Z.I.Shamsuddin, Information Hiding using
Steganography, National Conference on
Telecommunication Technology Proceedings, Shah
(stego object) Alam, Malaysia, 2003 IEEE.
[2] S Ushll , G A SathishKumal, K Boopathybagan,A Secure
Figure5. Total process of proposed model
Triple Level Encryption Method Using Cryptography
The cover image is the main image in which the hidden and Steganography, 20 II International Conference on
information will be embedded. The resultant image is the Computer Science and Network Technology, 978-1-
stego image which is the same type of image as the cover 4577-1587-7/111$26.00 ©20111EEE, December 24-26,
image. To measure the quality of stego image, Peak Signal-to- 2011
Noise Ratio (PSNR) is calculated. PSNR is a statistical [3] X. Zhang and S. Wang, Steganography using multiple-
measurement used for digital image or video quality base notational system and human vision sensitivity,
assessment [6]. PSNR is most easily defined via the mean IEEE Signal Process. Lett., vol.12, no. I, pp. 67-70, Jan.
squared error (MSE) which for two m×n monochrome images 2005.
I and K where one of the images is considered a noisy
approximation of the other is defined as: [4] BehrouzA.Forouan, Debdeep Mukhopadhyay, 2 nd edition
Cryptography and network security, McGraw Hill
1 𝑚 −1 𝑛−1
𝑀𝑆𝐸 = 𝑖=0 𝑗 =0 [𝐼 𝑖, 𝑗 − 𝑘(𝑖, 𝑗)]2 (6) Education, pp.295-296
𝑚𝑛
[5] S. M. Masud Karim, Md. Saifur Rahman, Md. Ismail
The PSNR is defined as: Hossain, A New Approach for LSB Based Image
𝑀𝐴𝑋𝐼2 𝑀𝐴𝑋1 Steganographyusing Secret Key987-161284-908-
𝑃𝑆𝑁𝑅 = 10 log10 = 20 log10 (7) 9/11/$26.00 2011 IEEE
𝑀𝑆𝐸 𝑀𝑆𝐸
Larger PSNR indicates better quality of the image or in other [6] M. Hossain, S.A. Haque, F. Sharmin, Variable
terms lower distortion. The larger the PSNR value the smaller RateSteganography in Gray Scale Digital Images Using
the possibility of visual attack by human eye. Neighborhood Pixel Information, Proceedings of
200912th International Conference on Computer and
Table 3 Represent the PSNR value after embedding different Information Technology (ICCIT 2009) 21-23 December
size of input data and image into cover image. 2009, Dhaka, Bangladesh.
Table5. PSNR table [7] Controlled NOT gate, From Wikipedia, http://en ,
wikipedia . org/wiki/Controlled_NOT _gate .
Cover input PSNR [8] Ivan W. Selesniek "Wavelet Transforms A Quick Study",
image Physies Today magazine, üetober, 2007.
size(pixel) Text(bytes) Image(pixel)
[9] "Blum Blum Shub", From Wikipedia, http://en.wikipe
800x600 84 294x184 56.3741 dia.org/wiki/Bluffi_Bluffi_Shub
800x600 168 294x184 56.3747 [10] R Praveen Kumar, V Hemanth, MShareef, Securing
Information Using Sterganoraphy, 2013 International
800x600 168 256x256 55.5312 Conference on Circuits, Power and Computing
800x600 848 256x256 55.5314 Technologies [ICCPCT-2013]
[11] Ipsita sahoo , SEMINAR REPORT SUBMITTED IN
800x600 2539 256x256 55.5310 PARTIAL FULFILMENT OF THE REQUIREMENTS
http://www.facweb.iitkgp.ernet.in/~isg/ICTSEMINAR/R
5. CONCLUSION EPORT-Ipsita.pdf
The proposed model introduced above is a combination of [12] M Venkteswara Reddy, M Lakshman Naik, Securing
cryptography and Steganography. The goal of the technique is Information Using Steganography, International Journal
to put the unauthorized person in a difficult position to of Science and Research (IJSR) ISSN (Online): 2319-
determine the presence of information. The dual security 7064
makes the information more secure. With this model any one
can easily send multiple information to the receiver using [13] Darrel Hankerson, Alfred Menezes, Scott Vanstone,
public network. This model is very useful for defense, Guide to elliptic curve cryptography, springer
corporate, banking, communication and different government [14] Ahaiwe J. Document Security within Institutions Using
portals where information exchange is more crucial. The data Image Steganography Technique, International Journal
hiding capacity in audio and video is more than image, so in of Science and Research (IJSR) ISSN (Online): 2319-
future using audio or video steganography and cryptography 7064
IJCATM : www.ijcaonline.org 20
© 2020 IJRAR March 2020, Volume 7, Issue 1 www.ijrar.org (E-ISSN 2348-1269, P- ISSN 2349-5138)
1. INTRODUCTION
Digital communication witnesses a clear and continuous development in many applications within the Internet. Hence, secure
communication sessions must be provided. The security of data that is transmitted across a world wide network has become a key
factor on the network performance measures. So, the confidentiality and integrity of transmitted data are needed to stop from accessing
and using transmitted data. Steganography and Cryptography are 2 techniques that are provided for network security. The aim of this
paper is to develop an approachto cover secret data in an image, by taking advantage of combination of cryptography and
steganography.
Cryptography
Cryptography is one of the secure method used to guarantee the privacy of communication between parties. This method is used for
secret writing, which is used to encrypt the plaintext with a key into ciphertext to be transferred between parties on an insecure
channel. Using a valid key, the ciphertext are often decrypted to the given plaintext. Cryptography provides a secure communication
across an insecure channel, like: confidentiality, privacy, non-repudiation, key exchange, and authentication. There are two kinds of
Cryptography techniques :
i) Symmetric / Secret Key Cryptography
ii) Asymmetric / Public Key Cryptography
The other name for Secret key encryption is symmetric-key, shared key, single-key, and eventually private-key encryption. By using
the key we can encrypt the given plain text, similary by using the same key at receiver side we can decrypt the message to obtain the
plaintext. The key will be known only by a people who are authorized to the encryption or decryption.
We can call this technique as asymmetric cryptography or public key cryptography, here we use two keys which are mathematically
associated, used separately for encrypting and decrypting the information. In this technique, when we use the private key, there are no
possibilities to obtain the data or simply discover the other key. The key used for encryption is public key, and the decryption key is
private key.
Steganography
It can be defined as the science of concealment and communicating data through apparently reliable carriers in attempt to hide the
existence of the data. So, there is no knowledge of the existence of the message in the cover image. If an individual views the given
cover which the information is hidden inside of he or she will have no clue that there is any covering data. The proposed model is a
combinational of Rivest-Shamir-Adelman(RSA) and Image Steganography.
IJRAR2001645 International Journal of Research and Analytical Reviews (IJRAR) www.ijrar.org 546
© 2020 IJRAR March 2020, Volume 7, Issue 1 www.ijrar.org (E-ISSN 2348-1269, P- ISSN 2349-5138)
2. RELATED WORK
2.1 Rivest-Shamir-Adelman
Let P and Q be the two prime numbers. The operations are “e” and “d”. Product of P and Q is considered as “n”. Product of (P-1) and
(Q-1) is considered as ϕ(n).
let “e ” be the public Exponent, it can be calculated using GCD between e and ϕ(n) , e values varies from 1 to n. If Gcd of e and
ϕ(n) is “1” then that value can be considered as “e”.
let “d” be the secret exponent and ed mod ϕ(n) = 1. The Extended Euclidean is based on the formula gcd(e, ϕ(n)) = 1, where d should
be equal to s + ϕ(n) in order to satisfy the ed mod ϕ(n) = 1 condition.
a) Key Generation
1. Select p and q such that both are the prime numbers, p≠q.
2. Calculate n=p*q,
(n) -> Euler’s totient function
3. Calculate q(n) = (p-1)*(q-1)
4. Select an integer e such that gcd ( q(n), e)) =1 & 1< e < (n)
5. Calculate d; d= e-1 mod (n)
6. Public Key, PU= {e, n}
7. Private Key, PR ={d,n}
b) Encryption
Input : PlainText
c) Decryption
Input : CipherText
1. Ciphertext: C
2. Plaintext : M= C^d mod n
2.2 Steganography
It can be defined as the science of concealment and communicating data through apparently reliable carriers in attempt to hide the
existence of the data. A secret message are often plaintext, an image, ciphertext, or anything which can be represented in form of a
bitstream. After the secret data is embedded in the cover object, the cover object will be called as a stego object and the stego object
sends to the receiver by selecting the suitable channel, where decoder system is used with the same stego method for obtaining original
information as the sender would like to transfer .We are having 4 kinds of steganography , Text steganography, Image steganography,
Video steganography, Audio steganography. In this paper we are using Image steganography.
IJRAR2001645 International Journal of Research and Analytical Reviews (IJRAR) www.ijrar.org 547
© 2020 IJRAR March 2020, Volume 7, Issue 1 www.ijrar.org (E-ISSN 2348-1269, P- ISSN 2349-5138)
Encryption Algorithm
Inputs: Image,Data,Key
3. Now hide the data in the given image by using the secret key.
Decryption Algorithm
2. Using the Secrert Key ,Obtain the hidden message from the Stego-Image.
3. METHODOLOGY
In proposed model RSA , the inputs are two prime numbers P and Q , and a plain text. For Steganogtraphy the
inputs are text, key and image.
3.1 Encryption
a) Text
b) Image
d) AudioVideo
2. Convert the input to Base-64 using Base-64 conversion Algorithm.
3. After converting into Base-64 we will be getting a String.
4. Store the entire string in a Text File and save the file.
5. From that file consider each character and apply Rivest Shamir Adelman(RSA).
6. For RSA we must generate two different prime numbers. Using that prime numbers, Calculate Eulers Toient and q(n).
7. Select integer e such that gcd ( q(n), e)) =1 & 1< e < (n), Where e is called as Public Exponent.
8. Now sender “A” will Encrypt the message using the Public Exponent.
10. Consider an image, And hide the encrypted message(cm) in the given image with the secret key Using Stegnography
Algorithm.
11. And the secret key will be considerd from RSA algorithm.
12. Now send the Stegno-Image to the Receiver.
IJRAR2001645 International Journal of Research and Analytical Reviews (IJRAR) www.ijrar.org 548
© 2020 IJRAR March 2020, Volume 7, Issue 1 www.ijrar.org (E-ISSN 2348-1269, P- ISSN 2349-5138)
3.2 Decryption
4. EXPERIMENT RESULTS
The above stated hybrid method was applied to the data such as image, video, audio as shown in figure(4). The cover image used for
this process is shown in figure(3). Total process of entire method is shown in figure(5).
+ =
Figure 3 : Cover Image Figure 4 : Encryption Data
Figure 5 : Stego_Object
In this project, we deal with the concepts of security of digital data communication across the network. This project is designed by
using the steganography and cryptography features factors for better performance. We performed a new steganography method and
combined it with RSA Encrption algorithm. We performed our method on image by implementing a program written in Python
language. The method proposed has proved successful in hiding various types of text, images, audio and videos in colour images. We
concluded that in our method the Image files and RSA Cryptography are better . Because of their high capacity. Results achieved
indicate that our proposed method is encouraging in terms of security and robustness.
6. REFERENCES
[1] H.Abdulzahra, R. AHMAD, and N. M. NOOR, “Security enhancement; Combining cryptograhy and steganography for data
hiding in images,” ACACOS, Applied Computational Science,pp.978-960,2014.
[3] M. H. Rajyaguru, “Cryptography-combination of cryptography and steganography with rapidly changing keys ,”Interntional
Journal of Emerging Technology and Advanced Engineering,ISSN
,pp.2250-2459,2012.
IJRAR2001645 International Journal of Research and Analytical Reviews (IJRAR) www.ijrar.org 550