Mad MPK
Mad MPK
“IMAGE STEGANOGRAPHY”
FOR THE DIPLOMA IN COMPUTER ENGINEERING
SUBMITTED BY
MANASWI DINESH BORSE
KSHITIJA MUKTESHWAR SHELKE
PRATIKSHA DASHRATH VANJARE
UNDER THE GUIDANCE OF
M. A. DHOPTE
DEPARTMENT OF COMPUTER ENGINEERING
CSMSS OF COLLEGE POLTYECHNIC,
CHHATRAPATI SAMBHAJI NAGAR, MAHARASHTRA,
INDIA
AND
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI
Date:
PRINCIPAL
ACKNOWLEDGEMENT
We would like to express our thanks to the people who have helped us most
throughout our project. We would like to express our sincere thanks to the
principal of CSMSS College of Polytechnic Dr. G. B. Dongre for being always
with us as a motivator. We are thankful to the H.O.D of Computer Engineering
Department Ms.R. S. Pophale for her kind support. We are grateful to our Project
Guide M. A. DHOPTE for nonstop support and continuous motivation for the
project. His help made us possible to complete our project with all accurate
information. A special thanks of our goes to our friends who helped us in
completing the project, where they all exchanged their own interesting ideas. We
wish to thanks our parents for their personal support or attention who inspired us
to go our own way. Finally, we would like to thank God who made all things
possible for us till the end.
2. RATIONALE ....................................................................................................... 3
6. PROGRAM CODE…………………………………………………………..10-18
7. OUTPUT……………………………………………………………………19-20
8. CONCLUSION…………………………………………………………………21
Image steganography has a high capacity to carry secret information as it can hide a large
amount of data within an image. Covert Communication: Image steganography provides a
covert means of communication, as the existence of the secret message is hidden within the
image
2.0 COURSE OUTCOMES ADDRESSED –
1
❖ NAMES OF TEAM MEMBER WITH ROLL NO:
Approved by,
Mr. M. A.DHOPTE
2
2. RATIONALE
Android application development is one of the rising and growing trend in the industry of mobile. This
course examines the principles of mobile application design and covers the necessary concepts which
are required to understand mobile based applications and develop Android based Applications in
particular. After completing this course students will design and build a variety of real-time Apps using
Android.
3
3.AIMS / BENEFITS OF THE MICROPROJECT
❖ Benefits of project:
➢ Hiding information
4
4.COURES OUTCOME ACHIVED
5
5. LITERATURE REVIEW
Image steganography is a technique of hiding information within an image in such a way that it is
difficult to detect. This involves embedding data, such as text or another image, into the pixels of the
original image without significantly altering its appearance. The goal is to conceal the existence of
the hidden message Image steganography is a method where information is concealed within an
image. This is achieved by subtly altering the pixel values of the image to embed hidden data, making
it challenging to perceive without specific decoding methods.
Technology has blitz scaled over the past years leading to a wide usage of multimedia for transferring
data, especially Internet of Things (IoT). Usually, the transfer happens over insecure network
channels. In particular, the internet has gained accelerated popularity for exchanging digital media
and individuals, private companies, institutions, governments use these multimedia data transfer
methods for exchanging data. Though there are numerous advantages attached with it, one prominent
disadvantage is the privacy and security of the data. The availability of numerous readily available
tools capable of exploiting the privacy, data integrity and security of the data being transmitted has
made the possibility of malicious threats, eavesdropping and other subversive activities. The
prominent solution is data encryption where the data is converted into a cipher text domain using
encryption key. At the receiving end, the cipher text is converted into plain text using a decryption
key. Using data encryption the original data is not visible, however, cipher text is visible in a
scrambled form to human eyes leading to suspicion and further scrutiny. A new research topic,
steganography, has gained acceptance in this context to hide the data that is not perceptible to human
eyes.
Steganography can be defined as the process of hiding a secret small multimedia data inside another
but much larger multimedia data such as image, text, file or video . Image steganography is a
technique to hide an image inside another image. In image steganography, the cover image is
manipulated in such a way that the hidden data is not visible thus making it not suspicious as in the
case of cryptography. Inversely, Steganalysis is used to detect the presence of any secret message
covered in the image and to extract the hidden data . Steganalysis helps in classifying if the image is
either a stego image or a normal image. Apart from classifying the image, further investigation is
carried out to detect the location and the content of the secret image inside the cover image.
6
After reviewing all the frameworks available, the methodologies are primarily grouped into three
categories, namely, traditional image steganography methods, CNN-based image steganography
methods and GAN-based image steganography methods. Traditional methods are frameworks which
use methods that are not related to machine learning or deep learning algorithms. Many traditional
methods are based on the LSB technique. CNN-based methods are based on deep convolutional neural
networks for embedding and extracting the secret messages and GAN-based methods use some of the
GAN variants. Figure 1 gives an overview of a steganography and steganalysis architecture. As shown
in figure 1, inputs are cover image and the secret information which can be either text or image. DL
model can be either a CNN-based or GAN-based. While the steganography block generates the stego
image, the steganalysis model takes the stego image as input to detect and perhaps extract the secret
information. In some methods the probability score of the input image being normal or stego image is
given as the output.
General working principle of steganography and steganalysis. The inputs are the cover image and the
secret information and an embedding algorithm is used to generate the container stego image. The
extraction algorithm takes the stego image as input to extract the ingrained secret information.
7
A. Traditional-Based Steganography Methods
Conventionally, Least Significant Bits (LSB) substitution method is employed to perform image
steganography. Images are usually of higher pixel quality, out of which not all the pixels are used. LSB
methods works under the assumption that modifying a few pixel values would not show any visible
changes. The secret information is converted into a binary form. The cover image is scanned to determine
the least significant bits in the noisy area. The binary bits from the secret image are then substituted in
the LSBs of the cover image. The substitution method has to be performed cautiously as overloading the
cover image may lead to visible changes leaking the presence of the secret information and .With the
LSB method as the baseline, a number of related methods have been proposed. For example, a slight
variation in converting the secret message into binary codes is undertaken in . A Huffman encoding
method is used to encode the secret message into the binary bits. The encoded bits are then embedded in
the cover image using the LSB method. In , another version of the LSB method is used for RGB images.
The cover image is in 3 channels and they are bit sliced. The secret message is embedded in all the three
planes in the 2:2:4 ratio for R, G and B planes. Not only spatial domain, quantum images are also
used and . The frequency domain is exploited in quantum image domain and the pixels which are
considered to be affecting the color are used to hide the secret bits. A combination of cryptography and
steganography is utilized where the LSB of the cover image is replaced with the most significant bits of
the secret image . The pseudo random number generator is used to select the pixels and the key is
encrypted using rotation every time. A k-LSB method is proposed where the k least bits are replaced with
the secret message For steganalysis, an entropy filter is used to detect and uncover the secret image .
The LSB methods are used in hiding the secret information inside videos also. Videos are sequences of
images called the video frames. Each video is dissected into image frames and the binary bits of the secret
information is hidden in the LSB of the image frames of the video. A basic form of LSB substitution
method and a combination of the huffman encoding and LSB substitution methods is used on videos .
Another interesting approach is where along with the image frames of the video, audio is also used to
enhance the hiding. Besides the LSB methods, has proposed a combination of Discrete Cosine
Transformation (DCT) and Discrete Wavelet Transformation (DWT) for hiding the secret message inside
a cover video. To find the regions of interest, the multiple object tracking (MOT) method is used. The
secret data is encoded first and then converted to binary bits before embedding it in the cover video.
8
B. CNN-Based Steganography Methods
Image steganography using CNN models is heavily inspired from the encoder-decoder architecture.
Two inputs – cover image and the secret image are fed as the input to the encoder to generate the stego
image and the stego image is given as input to the decoder to output the embedded secret image. The
basic principle is the same except different methods have tried different architectures. The way the
input cover image and the secret image are concatenated are also different in different approaches while
the variations in the convolutional layer, pooling layer are expected. The number of filters used, strides,
filter size, activation function used and loss function vary from method to method. One important point
to note here is the size of the cover image and the secret image has to be same, so every pixel of the
secret image is distributed in the cover image and have proposed a encoder-decoder architecture. U-
Net based encoder-decoder architecture is used for hiding and a CNN with 6 layers for extract by in
The input shape of the U-Net is modified to accept and 6 channels. The secret and cover images are
concatenated to give the input and hence 6 channels. A U-net based Hiding (H-net) and revealing (R-
net) network are used by in . Batch normalization and ReLU activation are used. The cover and the
secret images are concatenated before being sent to the network. Two optimization losses using SSIM
and MSE are used to reduce the loss and hence improve the performance.
A Separable Convolution with Residual Block (SCR) is used to concatenate the cover image and the
secret image . The embedded image is given as the input to the encoder for constructing the stego
image which is fed to the decoder to output the decoded secret image. ELU (Exponential Linear Unit)
and Batch normalization are used. A new cost function to reduce the effect of noise in the generated
container image called the variance loss is proposed . An encoder-decoder architecture was proposed by
Rahim et al. in . This method differs from the others in the way the inputs are given. The encoder part
consists of two parallel architectures each for the cover and the secret image. Features from the cover
image and the secret images are extracted through the convolutional layer and concatenated. The
concatenated features are used to construct the stage image.
A slightly different approach is proposed by considering the styling image along with the secret
information and cover image. The created stego image is converted into the style image given as an input.
The reveal network is used to decode the secret information from the stego image created. Similar to
other methods, an auto encoder-decoder architecture with VGG as base is used. An arbitrary image size
for the secret information and styling image are taken using the adaptive instance normalization (AdaIN)
layer and the output is the size of the cover image.
9
C. GAN-Based Steganography Methods
General Adversarial Networks are a type of deep CNNs introduced by Goodfellow et al. [35] in 2014. A
GAN uses the game theory to train a generative model with adversarial process for image generation
tasks. Two networks – generator and discriminator networks compete against each other to generate a
perfect image in GAN architecture. The generator model is given the data and the output is the close
approximation of the given input image. The discriminator networks classifies the images generated as
either fake or true. The two networks are trained in such a way that the generator model tries to imitate
the input data as close as possible with minimum noise. The discriminator model is trained to effectively
find out the fake images. Many variations on GAN have been proposed ever since, making it more
powerful and suitable for synthetic image generative tasks.GANs are known for their good performance
in the image generation field. Image steganography can be considered as one such image generation task
where two inputs – the cover image and the secret image are given to generate one output – stego image.
The existing methods used for image steganography using a GAN architecture can be grouped into five
categories - a three network based GAN model, cycle-GAN based architectures, sender-receiver
architecture using GAN, coverless model where the cover image is generated randomly instead of being
given as input and an Alice, Bob and Eve based model. Details on all the categories and how they are
executed are given below
Generally, a GAN model consists of two main components: the generator and the discriminator. In the
context of image steganography, a new network named the steganalysis is introduced in some of the
methods. The main functions of these three components are,
• A generator model, G, to generate stego images from the cover image and the random message.
• A discriminator model, D, to classify the generated image from the generator as either real or
fake.
• A steganalysis, S, to check if the input image has a confidential secret data or not.
Automatic Steganographic Distortion Learning framework with GAN (ASDL-GAN for short) was
introduced In this architecture, the generator is used to learn the probabilities for each pixel from the
input cover image and the authors have proposed to use a novel activation function Ternary Embedding
Simulator (TES) for generating the stego images from the generated probabilities.
10
• Datasets Used
There exist one dataset, BOSS Base, that was specifically created to deal with the problems of
steganography. To further evaluate the performances of the algorithms some existing datasets, which are
used for other purposes including object recognition and face recognition, are re-modeled to fit for the
purpose of our experiments. A detailed explanation on the datasets are described.
A. BossBase
Break Our Steganographic System (BOSS) is the first scientific challenge conducted to take image
steganography from being a research topic to a practical application. The main aim of the competition
was to develop a better steganalysis method that can break the steganographic images created by the
HUGO (Highly Undetectable steGO) algorithm . The dataset consists of a training set and testing set
along with the HUGO algorithm that can be used to create the steganography images. The training dataset
consists of 10,000 grayscale cover images with dimensions The testing set consists of 1000 grayscale
images with dimensions There is an option to download the datasets with steganography images solely
for the purpose of steganalysis. Firstly, the raw images are captured using 7 different cameras and they
are converted to PGM images. The links to download the raw images, PGM images, the script used to
convert the raw images into PGM, EXIF data of the raw images can be found in the official website
B. CelebA
Large-scale CelebFaces Attributes dataset, also known as CelebA dataset [62], is a vast dataset with more
than 200K images that can be used for face recognition, face detection, face localization and other face-
related operations. The dataset consists of images from various sources, locations, background and poses
and is best suitable for steganography also. The probability of using a photo/face image as the cover for
hiding secret images is very high. Along with the images, there are 40 different annotations available like
with/without glasses, emotions, hair styles, other accessories like hat.
C. ImageNet
ImageNet [63] is also a very large dataset containing images from the WordNet hierarchy with each node
containing more than 500 to 1000 images. ImageNet does not have any copyrights to the image and
contains only the links or thumbnails to the original image. The dataset consists of images of varying
size. Based on the requirement, the number of images, classes they belong to, background and the image
size can be selected from the wide range available.
11
D. MNIST Handwritten Digits
Modified National Institute of Standards and Technology database (MNIST) [64] is another dataset that
can be used for various computer vision and image processing applications. MNIST handwritten dataset
consists of a training and testing set with images of handwritten digits 0 to 9. Images in this dataset are
normalized, black and white with dimensions pixels. The training set consists of 60,000 images and
testing set consists of 10,000 images
E. COCO
Common Objects in Context (COCO) dataset was mainly developed for object detection, segmentation
and image captioning purposes. This again is a huge dataset with images from 80 object categories. Each
class contains at least 5 images. This dataset comes along with the class annotation and the segmentation
annotation. There is no predefined training and testing split. The dataset split can be carried out based on
the research topic and the user convenience.
F. Others
Other datasets that can be used for image steganography and steganalysis are Div2K, SZUBase, USC-
SIPI, DTD, LFW, and Pascal VOC. Div2K is a commonly used dataset for Single Image Super-
Resolution introduced in the NTIRE 2017 Challenge on Single Image Super-Resolution. It has a total of
1000 images split into 800 for training, 100 for validation and 100 for testing. Images with high resolution
and three grades of low resolution can be found in this dataset. SZUBase is a dataset collected in with
40000 grayscale images of USC-SIPI has a variety of different resolution images and sizes for Image
processing, image analysis, and machine vision purposes. Describable Textures Dataset (DTD) is used
to analysis the textural components containing 5640 jpg images of two sizes and LFW dataset is used for
face recognition and verification tasks . PASCAL Visual Object Classes (VOC) is a challenge conducted
for object detection and classification . below represents some of the images collated from the dataset
described
12
13
6.Program code
• Activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical">
<EditText
android:id="@+id/editTextMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter message to embed"
android:layout_marginBottom="16dp"/>
<Button
android:id="@+id/btnSteganography"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text=" Steganography" />
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="448dp"
android:layout_below="@id/btnSteganography"
android:layout_marginTop="16dp"
android:scaleType="centerCrop"
android:src="@drawable/img" />
</LinearLayout>
• MainAcitity.java
package com.example.imagesteganography;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
14
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity
{
private EditText editTextMessage;
private ImageView imageView;
private Button btnSteganography;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editTextMessage = findViewById(R.id.editTextMessage);
imageView = findViewById(R.id.imageView);
btnSteganography = findViewById(R.id.btnSteganography);
Bitmap originalBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.img);
btnSteganography.setOnClickListener(v -> {
String message = editTextMessage.getText().toString();
if (!message.isEmpty()) {
Bitmap steganographedBitmap = imageSteganography.embedMessage(originalBitmap,
message);
if (steganographedBitmap != null) {
imageView.setImageBitmap(steganographedBitmap);
Toast.makeText(MainActivity.this, "Message embedded successfully",
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(MainActivity.this, "Failed to embed message",
Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(MainActivity.this, "Please enter a message to embed",
15
Toast.LENGTH_SHORT).show();
}
});
}
}
• Acitity_image_ Steganographiy.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".imageSteganography">
</androidx.constraintlayout.widget.ConstraintLayout>
• Acitity_image_ Steganographiy.java
package com.example.imagesteganography;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
public class imageSteganography extends AppCompatActivity {
public static Bitmap embedMessage(Bitmap originalBitmap, String message) {
Bitmap bitmap = originalBitmap.copy(Bitmap.Config.ARGB_8888, true);
int pixelIndex = 0;
int charInde
-x = 0;
int messageLength = message.length();
for (int i = 0; i < bitmap.getWidth(); i++) {
for (int j = 0; j < bitmap.getHeight();
int pixel = bitmap.getPixel(i, j);
int alpha = Color.alpha(pixel);
16
int red = Color.red(pixel);
int green = Color.green(pixel);
int blue = Color.blue(pixel);
if (charIndex < messageLength) {
char character = message.charAt(charIndex);
// Embed character into least significant bits of RGB values
red = (red & 0xFE) | ((character >> 7) & 1);
green = (green & 0xFE) | ((character >> 6) & 1);
blue = (blue & 0xFE) | ((character >> 5) & 1);
bitmap.setPixel(i, j, Color.argb(alpha, red, green, blue));
pixelIndex++;
// Move to next character once all bits embedded
if (pixelIndex % 3 == 0)
charIndex++;
} else {
// Message embedding complete
return bitmap; }
}
}
return bitmap;
}
// Function to extract a message from an image
public static String extractMessage(Bitmap bitmap, int messageLength) {
StringBuilder message = new StringBuilder();
int charIndex = 0;
for (int i = 0; i < bitmap.getWidth(); i++) {
for (int j = 0; j < bitmap.getHeight(); j++) {
int pixel = bitmap.getPixel(i, j);
int red = Color.red(pixel);
int green = Color.green(pixel);
int blue = Color.blue(pixel);
char character = 0;
// Extract the embedded character from least significant bits of RGB values
character |= ((red & 1) << 7);
17
character |= ((green & 1) << 6);
character |= ((blue & 1) << 5);
message.append(character);
charIndex++;
// Assuming you have the steganographedBitmap
Bitmap steganographedBitmap = null;
String extractedMessage = imageSteganography.extractMessage(steganographedBitmap,
message.length());
Log.d("Embedded Message", "Extracted Message: " + extractedMessage);
// If all characters extracted, return message
if (charIndex >= messageLength)
return message.toString(); }
}
return message.toString();
}
}
18
7.OUTPUT
Fig:7.1
19
Fig:7.2
20
8.CONCLUSION
21
6.SKILL DEVELOPED / LEARNING OUTCOMES OF MICRO PROJECT
1) Communication
2) Leadership
3) Team management
4) Negotiation
5) Personal organization
6) Risk management
7) Critical thinking
8) Task management
22
APPLICATIONS OF MICRO – PROJECT
10.REFERERNCE
1) https://cybersecurity.att.com/blogs/security-
essentials/image-steganography
2) https://www.geeksforgeeks.org/image-steganography-
in-cryptography/
3) https://ieeexplore.ieee.org/document/9335027
4) https://chat.openai.com/
23