0% found this document useful (0 votes)
24 views37 pages

A Project Report On Image Steganography Using LSB Algorithm

The project report titled 'Knowledge Base Refuge Through LSB Amendment' explores the integration of steganography with data transmission protocols to enhance security against cyber threats. It focuses on the Least Significant Bit (LSB) algorithm for embedding secret messages within digital images using MATLAB, addressing the limitations of traditional encryption methods. The report includes a comprehensive literature review, methodology, results, and applications of the proposed technique in various fields.

Uploaded by

rrsindhurani
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)
24 views37 pages

A Project Report On Image Steganography Using LSB Algorithm

The project report titled 'Knowledge Base Refuge Through LSB Amendment' explores the integration of steganography with data transmission protocols to enhance security against cyber threats. It focuses on the Least Significant Bit (LSB) algorithm for embedding secret messages within digital images using MATLAB, addressing the limitations of traditional encryption methods. The report includes a comprehensive literature review, methodology, results, and applications of the proposed technique in various fields.

Uploaded by

rrsindhurani
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/ 37

A Project Report on

KNOWLEDGE BASE REFUGE THROUGH LSB AMENDMENT


Submitted in fulfillment of requirements for the award of degree
BACHELOR OF TECHNOLOGY

Submitted by

N. Sai Phaneendra - O180379

G. Sarath - O190061

R. Hemanth - S190813

R. Sindhu Rani - O190857

M. Amrutha - O190215

Under the Supervision of

Mrs. Bethala Priyanka Reddy


Assistant Professor

Department of ECE

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

RAJIV GANDHI UNIVERISTY OF KNOWLEDGE AND TECHNOLOGIES


ONGOLE CAMPUS
(2023-2024)
Approval Sheet
This report entitled “KNOWLEDGE BASE REFUGE THROUGH LSB AMENDMENT Using
MATLAB” by N. Sai Phaneendra - (O180379), G. Sarath - (O190061), R.
Hemanth - (S190813) , R. Sindhu Rani – (O190857) and M. Amrutha - (O190215)
is approved for the degree of Bachelor of Technology Electronics and
Communication Engineering.

Examiner(s) : ……………………………………………..

Supervisor(s) : …………………………………………...

Chairman : ………………………………………………..

Date: …………………………………..
Place: …………………………………..

Candidate’s Declaration
I declare that this written submission represents my ideas in my own words and
where others’ ideas or words have been included.
I have adequately cited and referenced the original sources. I also declare that I
have adhered to all principles of academic honesty and integrity and have not
misrepresented or fabricated or falsified any idea/data/fact/source in my
submission.
I understand that any violation of the above will be cause for disciplinary
action by the Institute and can also evoke penal action from the sources which
have thus not been properly cited or from whom proper permission has not
been taken when needed.

Signature :

N. Sai Phaneendra (O180379) ………………………


G. Sarath (O190061) ………………………
R. Hemanth (S190813) ………………………
R. Sindhu Rani (O190857) ………………………
M. Amrutha (O190215) ………………………

Date :
Place :

RAJIV GANDHI UNIVERSITY OF


KNOWLEDGE TECHNOLOGIES ONGOLE CAMPUS
ELECTRONICS AND COMMUNICATION ENGINEERING
(2023-2024)

Certificate
This is to certify that the report entitled “ KNOWLEDGE BASE REFUGE
THROUGH LSB AMENDMENT” submitted by N. Sai phanenndra , G. Sarath ,
R. Hemanth, R. Sindhu Rani , M. Amrutha bearing ID numbers : O180379,
O190061, S190813 ,O190857 ,and O190215 respectively in partial fulfilment of
the requirements for the award of Bachelor of Technology in Electronics and
Communication Engineering is a bonafide work carried by them under my
supervision and guidance.

Project Internal Guide Head of the Department

Mrs. B. Priyanka Reddy Ms. Padmavathi


Assistant Professor Assistant Professor

Department of ECE Department of ECE

Acknowledgement
We take this opportunity to express our sincere gratitude to all those
supported and guided us throughout the completion of our mini project.
Firstly, we wish our deepest sense of gratitude and respect to our guide
Mrs. Bethala Priyanka Reddy. for her constant support, invaluable
mentorship, guidance and insightful feedback. The constant
encouragement and timely suggestion have helped us to complete this
mini project.
We extend our heartful thankfulness to head of department (HOD) of
ECE Ms. Padmavathi Madam for his support and encouragement.
We would liketo acknowledge the sir's encouragement and expertise in
shaping our project and ensuring its successful execution.
We would like to extend our gratitude to RAJIV GANDHI UNIVERSITY
OF KNOWLEDGE AND TECHNOLOGIES(RGUKT), ONGOLE for providing
all the resources and facilities for the completion of the project
successfully.
We are thankful to our team mates and other classmates for their
constructive support. We are also grateful to family for their constant
encouragement and support, which motivated us to complete this
project successfully.
.

With Sincere Regards,


N. Sai phanenndra(O180379)

G. Sarath(O190061)

R. Hemanth (S190813)

R. Sindhu Rani (O190857)

M. Amrutha (O190215)
ABSTRACT

In the contemporary landscape of ubiquitous internet communication, the


transmission of data is an indispensable facet of everyday activities. However,
this convenience is accompanied by a myriad of challenges, including the
persistent threat of malware attacks, data breaches, unauthorized access, and
various cyber threats. The vulnerability of data during transmission raises
concerns about the integrity and confidentiality of sensitive information.
Addressing these challenges requires innovative approaches that go beyond
conventional encryption methods such as steganography.
The fusion of steganography with data transmission protocols to bolster
security measures. Steganography, the art of concealing information(TEXT
IN IMAGE ) within the digital image information, provides an additional
layer of protection by making it arduous for adversaries to detect and
compromise transmitted data. The collaborative integration of steganography
aims to overcome the limitations of traditional security measures, such as
encryption, and mitigate the risks associated with modern cyber threats.
This process hides the data in such a manner that there will be no noticeable
changes in an image. It basically hides the existence of the data. Each and
every byte of data is converted into its binary equivalent and then are
processed to get stored in the image pixel. one of the most common methods
Of implementation is Least Significant Bit (LSB-Algorithm) insertion. In which the
least significant bit of every byte is altered by the bit- string representing the
embedded file. This encryption and decryption of the images will be done
using MATLAB code.

Keywords: Steganography, LSB Algorithm, Information hiding, MATLAB.


Table of Contents

1. INTRODUCTION 9
1.1.Cryptography 9
1.2.Steganography 10
1.2.1. Definition 11
2. BACKGROUND 12
3. LITERATURE REVIEW 13
4. STEGANOGRAPHY TYPES 14
4.1 Text Steganography 14
4.2 Audio Steganography 16
4.3Video Steganography 17
4.4 Email Steganography 18
4.5 Network Steganography 19
4.6 Image Steganography 21
5. METHODOLOGY 22
6. IMAGE STEGANOGRAPHY USING LSB ALGORITHM 23
6.1 LSB Method 21
6.2 Using MATLAB 24
6.3 Program explanation 33
7. RESULTS 34
8. APPLICATIONS 35
8.1 Copyright Control 35
8.2 Covert Communication 35
8.3 Smart Id’s 35
8.4 Printers 35
9. CONCLUSION 36

10.REFERENCES 37
List of Figures

 Figure:1.1 How secrete image is sent to cryptography 09


 Figure: 1.2 Secret message is hiding in steganography 10
 Figure :1.3 sending secrete message in steganography 11
 Fig: 4.1.1. Types of Steganography 14
 Fig 4.1.2. Block Diagram of text Steganography 15
 Fig 4.2.1. Block Diagram of audio Steganography 16
 4.3.1. Block diagram of video Steganography 17
 Fig: 4.5.1 block diagram of network Steganography 20
 Fig 6.1.1. Least significance bit Steganography 23
 Fig 6.1.2 Hiding and extraction of a secret message using LSB
algorithm24
 Fig 6.3.1 secret image 28
 Fig 6.3.2 carrier image 29
 Fig6.3.3 Segmented image 30
 Fig6.3.4. Recovered image 32
 Fig6.3.5 MATLAB output 33
1.INTRODUCTION

The growth of high-speed computer networks and the internet has indeed
revolutionized communication but has also brought concerns about data
security and privacy. To address these issues, there are primarily two
techniques commonly used.

1. Cryptography
2. Steganography

Before considering Steganography, we will just have a glance of its


premises technique which is called Cryptography.

1.1 Cryptography:-
“Cryptography” is a method of protecting information and communications
through the using of mathematical techniques. So that only those for whom the
information is intended can read and process it. Cryptography is derived form a
Greek word.
"crypt" means "hidden"
“graphy” means “writing”

It requires two steps: Encryption and Decryption.

1.1.1. The Encryption process uses a cipher in order to encrypt plain text and turn
it into cipher text.
1.1.2. The Decryption process applies the same cipher to turn the ciphertext back
into plain text.

Figure:1.1 How secrete image is sent to cryptography.


Only the intended receiver with the decryption key can extract the actual
message. There when an attacker discoveries the message it is very difficult for him
to get the secret message. Where Cryptography is a strong way to encrypt and
secure communication.

1.1.3 Then why do we need a new technique: The answer is very simple, when
we are using any cryptography technique, we need to send a secret key and third
person can easily judge that secret communication is going on.
This is where Steganography comes in to picture.

1.2. Steganography:

Steganography” is a technique of concealing a message within another


message. In another words Steganography define hiding the information in another
information. The word Steganography comes from Greek steganographia, which
combines the words steganos , meaning "covered or concealed", and graphia
meaning "writing".

Figure: 1.2 Secret message is hiding in steganography


The main reason of using steganography is that you are hiding your secret
message behind an ordinary file, no one will suspect that a communication or some
secret communication is going on.

Figure :1.3 sending secrete message in Steganography

Steganography conceals the fact that message is being communicated


without knowledge of other person.

1.2.1 Definition:
Steganography is the art of science of embedding secret messages in
cover message in such a way that no one, apart from the sender and the intended
recipient, suspects the existence of the message.
2.BACKGROUND

Steganography is the practice of concealing information within other information, in


such a way that it is not easily detectable. The use of steganography dates back to
ancient times, where people would write secret messages on the underside of wax
tablets or hide them in invisible ink.
In the digital age, steganography has become an increasingly popular
means of secure communication. One of the most common forms of digital
steganography is image steganography, which involves embedding messages within
digital images.

The advantage of image steganography is that images are a ubiquitous form of


digital content, and it is often difficult to detect the presence of hidden data within
an image. Image steganography can be used for a wide range of purposes, from
digital watermarking and copyright protection to secret communication and covert
surveillance.

There are several techniques for image steganography, including the least
significant bit (LSB) algorithm, the discrete cosine transform (DCT) algorithm, and
the wavelet transform algorithm. The LSB algorithm is one of the simplest and
most widely used techniques, and involves replacing the least significant bits of
each pixel in an image with the message bits.

The LSB algorithm is particularly effective for grayscale images, and can also be
used for colour images by embedding messages in each colour channel separately.
The disadvantage of the LSB algorithm is that it is susceptible to certain types of
attacks, such as visual analysis and statistical analysis. However, with proper
implementation and security measures, image steganography using the LSB
algorithm can be a powerful tool for secure communication and information
hiding.
3.LITERATURE REVIEW

The use of image steganography to hide information within digital images has
been a topic of research and development for many years. Numerous techniques
have been proposed, with the least significant bit (LSB) algorithm being one of the
most widely used.
In 2001, Westfield and Pitzmann proposed a modification to the LSB algorithm
called the "randomized LSB algorithm" which can reduce the risk of detection by
creating a random sequence of pixels to be used for embedding. The approach has
shown to be resistant to statistical analysis and visual inspection by human eyes.

In 2002, Alattar proposed a modification to the LSB algorithm called the


"enhanced LSB algorithm" which improves the algorithm's security and embedding
capacity by dividing the cover image into small blocks, and embedding the
message bits in the blocks with the largest variances.

In 2008, Singh and Singh proposed a modification to the LSB algorithm called the
"histogram based LSB algorithm" which improves the algorithm's security by
creating a histogram of the pixel values, and embedding the message bits only in
the least significant bits of the pixels that have the most frequent values. This
approach is less vulnerable to statistical analysis than traditional LSB.

In 2014, Kumar et al. proposed a modification to the LSB algorithm called the
"stochastic LSB algorithm" which uses a pseudo-random sequence generator to
select the pixels for message embedding. The method has shown to be resistant to
statistical analysis and visual inspection by human eyes.

Overall, the LSB algorithm remains one of the most widely used techniques for
image steganography due to its simplicity and efficiency. However, while it can be
an effective means of hiding information, it is susceptible to certain types of
attacks and there are other more advanced techniques available that may provide
higher security.
4.STEGONAGRAPHY TYPES

The majority of steganographic systems uses multimedia objects like image,


audio, video as cover media- is a place where you actually store the hidden
information.

Fig: 4.1.1. Types of Steganography

4.1 TEXT STEGANOGRAPHY:

• Hiding secrete information in a text file.


• User needs to register first and the user can login to the application while the
user supposed to enter a PIN as a multi-factor authentication when user
login’s with username and password.
• After logging in, user can write text and encode it and can share with the
person whom the user wants to send the secret message.
• This is how the text Steganography, hide text within text works.

Advantages
➢ It is safe to login.
➢ It has multi factor authentication.
➢ It encodes and decode text.
Fig 4.1.2. Block Diagram of text Steganography

Disadvantages:
➢ Text Steganography will only works on internet.

Applications:

• This system can be used by the multiple peoples to get the counselling sessions
online.

4.2 AUDIO STEGANOGRAPHY:


Data is hidden by modifying the sample data and embedding a secrete
message into an audio signal.
4.2.1. Uncompressed audio formats:
• WAV (wave audio format)
• BWF (broadcast wave format)
• MBWF (multichannel broadcast wave format)
4.2.2 Compressed audio formats:
I. Lossy:
• Mp3
• Advanced audio coding (AAC)
II.LOSSLESS
• Free lossless audio codec (FLAC) •
Direct stream transfer (DST)

Fig 4.2.1. Block Diagram of audio Steganography:

ADVANTAGES

1. Human limitations-20.000Hz

2. Large data can be hidden inside

3. Hard to recognize because of the continuous flow of information

Applications

1. Media database systems.


2. Intelligence services

4.3 VIDEO STEGANOGRAPHY

 Hiding the data in a digital video format file.


 Video steganography is a combination of both image and audio
steganography.
 Video steganography is divided into three types:
1. Intra-embedding
2. Pre-embedding
3. Post-embedding

 Intra-embedding methods are categorized according to the video compression


stages such as intra-prediction, motion vectors, pixels interpolation, transform
coefficients.
 Pre-embedding methods are manipulated on the raw video, which can be
classified into spatial and transform domains.
 Post-embedding methods are mainly focused on the bit streams, which means
the procedure of embedding and extraction of video Steganography.
 It includes of H.265 video Steganography, robust video Steganography,
reversible video Steganography.

4.3.1. Block diagram of video Steganography

Advantages:
 Low modification rate with high PSNR (power signal to noise ratio)
 Low distortion to the visual quality and highly robust.
 Achieved 10%payload of video size.
 High payload capacity.
Disadvantages:
 Only two videos are used.
 Video Steganography is quite complex.
 Size of the video is increased after embedding.
 Visual distortion.
 visual quality effected.
Applications:
 Industrial application.
 confidential communication and secrete data storing.

4.4. EMAIL STEGANOGRAPHY:

 Email Steganography is updated technique of text Steganography.


 This technique hides the secret information with in the email body.
 An email can be sent to many recipients.
 Email-based Steganography is one of the most popular techniques for the text
Steganography.
 This technique hides the secret message within the email body and email
addresses.
 Email addresses are used to hide the secret data, regardless they are valid
addresses or no.
 Thus the email looks like blank email.
 It is hard to implement and highly secured method.

Advantages:
 This method featured security, capacity, and robustness, the three needed
aspects of Steganography that makes it useful in hidden exchange of
information through text documents and establishing secret communication.
 Important files carrying confidential information can be in the server in and
encrypted form No intruder can get any useful information from the original
file during transmit.
 With the use of Steganography Corporation government and law enforcement
agencies can communicate secretly.

Disadvantages:
 Huge number of data, huge file size, so someone can suspect about it.If this
technique is gone in the wrong hands like hackers, terrorist, criminals then this
can be very much dangerous for all.

4.4 NETWORK STEGANOGRAPHY:

Network Steganography is a hidden communication technique, which utilizes the


legitimate traffic as the vehicle to transfer the secret information covertly over the
untrusted network.
BitTorrent (BT) is one of the most prevalent P2P services for transmitting video
files over wireless networks.
i. Secret_info: The content of secret information
ii. Multi-Link Steganography: Multi-link Steganography mode
iii. Single-Link Steganography: Single-link Steganography mode
iv. Mode: Steganography mode

Technique of embedding information into a network protocol like TCP, UDP,


ICMP
a. TCP, UDP (transportation protocols)
 Transmission control protocol
 User datagram protocol used to pass actual data
b. ICMP CONTROL PROTOCOL)
 Internet control message protocol
 It does not carry the data files but it carries the information about the status
of the network

Fig: 4.5.1 block diagram of network Steganography

Advantages:
 The messages do not attract attention to themselves.
 Plainly visible encrypted messages no matter how unbreakable.
Disadvantages:
 Huge number of data, huge file size.
 Someone can suspect because of huge file size.
 So, the technique is gone wrong in the wrong hands like hackers.

Applications:
 used to adjustment of the form of the messages to the type of network or
means of transport.

4.6 IMAGE STEGANOGRAPHY:


Hiding the data by taking the cover object as the image is known as image
Steganography. In digital Steganography, images are widely used cover source
because there are a huge number of bits present in the digital representation of an
image. There are a lot of ways to hide information inside an image. Common
approaches include:

 Least Significant Bit Insertion (Least significant bit algorithm)


 Masking and Filtering
 Redundant Pattern Encoding
 Encrypt and Scatter
 Coding and Cosine Transformation

Advantages

1. Less suspicious to human eyes.


2. Simple to implement and many techniques uses this method.
3. High perceptual transparency.

Applications

Transfer of message through online using image Steganography


In mobiles, pc to transfer files
In army for transmitting messages secretly to the people. etc

5.METHODOLOGY
The following steps were taken in the development of the image steganography
tool using the LSB algorithm in MATLAB:

 Data collection: We collected a set of digital images of various sizes and


formats, including grayscale and colour images.
 Image pre-processing: The images were pre-processed to remove any
metadata or other identifying information that could potentially reveal the
presence of hidden data. This was done using MATLAB's built-in image
processing functions.
 Message encoding: The message to be hidden within the image was encoded
using a binary code. The length of the message was limited to the number of
pixels in the image, in order to prevent any distortion in the image caused by
insufficient embedding capacity.
 Embedding process: The LSB algorithm was used to embed the message within
the pixels of the image. For colour images, the algorithm was applied to each
colour channel separately.
 Image post-processing: After embedding the message, the image was saved in
its original format and any metadata that was removed in the pre-processing
stage was restored. The image was then ready for transmission or storage.
 Message extraction: To extract the hidden message from the image, the LSB
algorithm was applied to the pixels of the image, and the message bits were
extracted and decoded into the original message.
 Testing and evaluation: The tool was tested on a set of test images, and the
effectiveness of the embedding and extraction processes were evaluated based
on the accuracy of the extracted messages and the visual quality of the images
after embedding.

The tool was developed using MATLAB programming language and built-in
image processing functions. The LSB algorithm was implemented using MATLAB's
bitwise operations and matrix manipulations.

6.Image Steganography using LSB algorithm


6.1LSB Method: Technique in which we hide messages inside an normal image by
replacing ‘Least Significant Bit (LSB)’ of normal image with the bits of message
to be hidden.

Fig 6.1.1. Least significance bit Steganography

Any digital image can be represented with the set of pixels. Pixel value
represented by the number of bits. The bits are taken such that the image will
convey the 90% of the information content of the image. For a Gray scale image, we
use 24 bits to represent the pixel. For the RGB coloured image we use 8 bits or 1byte
to represent a pixel. In the RGB coloured model there are three primary colours
which results numbers of colours by the combination of them.
The above figure will give the clarity, why we have chosen the LSB algorithm.

Example:
1. In a byte the left most bit is called as Most significant bit (MSB) and the
rightmost bit is called as Least significant bit (LSB). Figure 1(a).
2. There no change in the byte, the value of the pixel is equivalent the
255(decimal value). Figure 1(b).
3. The change in the MSB of the byte, the value of the pixel is equivalent
the 127 (decimal value). Figure1(c).
4. There no change in the byte, the value of the pixel is equivalent the 255
(decimal value). Figure 1(d).
5. The change in the LSB of the byte, the value of the pixel is equivalent the
254(decimal value). Figure1(e).

From the points 2 and 3 we can observe that there is a drastic change in the value of
pixel value if we change the MSB. Similarly, from the points 4 and 5 we can observe
that there is a slight change in the value of pixel value if we change the LSB which is
negligible. Therefore, for the image Steganography the LSB algorithm is widely used.
This algorithm is a popular one in now a days.

Explanation of LSB algorithm in the spatial domain using an example.

Fig 6.1.2 Hiding and extraction of a secret message using LSB algorithm

Steps to hide a message in a carrier image.


Step 1:
Let’s take an image (gray scale) as a carrier and take an arbitrary pixel which is
represented by 8bits.
11111111
Let’s assume a sequence of 8 bits such that by which we can change the LSB of the
carrier by doing the logical bit wise AND operation.
Assumed 8bit sequence: 11111110.
By doing bit wise AND operation, the result is 11111110.
Here we make the carrier signal pixel’s LSB to zero
Step 2:
Let’s take a message signal to be hide.
11010011
Let’s assume a sequence of 8 bits such that by which we can change the LSB of the
message signal by doing the logical bit wise AND operation.
Assumed 8bit sequence: 10000000
By doing bit wise AND operation, the result is 10000000.
Divide the result with assumed 8bit sequence to transfer the MSB position to LSB
position.
The result is 00000001
Step 3: Add the both results. we get the stego code which is similar to the carrier but
not exactly same as the carrier signal.
The result is: 11111111
Extracting the message from the carrier signal.
To extract the original data which was transmitted we have concentrated only
on the LSB of the pixel of carrier image. So, assume a sequence of 8 bits such that by
which we can take out the LSB of the pixel in which required information present.
The 8 bits should be such that by doing bitwise AND operation with carrier image
transmitted we must get the LSB of the carrier.
The transmitted carrier signal. Let’s take the corresponding pixel of the above
example.
11111111
assumed number is: 00000001 the
result is :00000001
By multiplying with the value 128 to transfer the LSB position to MSB position
result is 10000000. the message bit is at MSB like in the actual message.

6.2 Using MATLAB code:

MATLAB is a programming platform designed specifically for engineers and


scientists to analyze and design systems and products that transform our world.
MATLAB stands for Matrix Laboratory.
MATLAB is used in various applications like academics, machine learning,
signal processing and communications, image & video processing, control systems,
test and measurement, mathematical and technical computation.
And here we are using MATLABR2015a version.

Program

clc ;

clear all ;

close all ;
a = imread('sai1.jpg');
imshow(a);
title('Cover Image');
x = imread('secretimg3.jpg');
subplot(2,2,2);
imshow(x);
title('Message Image');
[r, c, ~] = size(a);
x = imresize(x, [r, c]);
final_watermark = zeros(r, c, 3, 'uint8');
for color_plane = 1:3
for i = 1:r
for j = 1:c
nc = bitand(a(i, j, color_plane), 254);
ns = bitand(x(i, j, color_plane), 128);
final_watermark(i, j, color_plane) = nc + ds;
end
end
end
subplot(2,2,3);
imshow(final_watermark);
title('Watermarked Image');
output = zeros(r, c, 3, 'uint8');
for color_plane = 1:3
for i = 1:r
for j = 1:c
nc = bitand(final_watermark(i, j, color_plane), 1);
ms = nc * 254;
output(i, j, color_plane) = ms;
end
end
end

subplot(2,2,4);
imshow(output);
title('Recovered Image');

6.3 Program Explanation:


Clc ;
% close command window
Clear all ;
% clear the workspace
Close all ;
% close other windows (except main matlab window)]

a-Carrier signal or Cover Image


x- Message signal or Secret image
imread
image read % used to read an image file
a=imread(‘filename.file_extension’);
a=imread(‘flower.jpg’);or
a=imread(‘flower.png’): or
a=imread(‘flower.jpeg’);
Cover Image and Secret Image

Fig 6.3.1 carrier image


Fig 6.3.2 secret image
imshow
image show [shows the image file] eg:
imshow(p);
% p-may be an alphabet to which the image is assigned or imbuilted

eg: imshow(a); or imshow(b); ....etc

x=imresize(x,[r c]);
% re-sizing our message signal same as our carrier signal

% EMBEDDING MESSAGE IMAGE INTO COVER IMAGE

final_watermark = zeros(r, c, 3, 'uint8');

% it initializes a three-dimensional matrix called final_watermark.


%final_watermark: This is the name of the variable that will store the
watermarked image.
%zeros(r, c, 3, 'uint8'): This function creates a matrix filled with
zeros.

for color_plane = 1:3

% This loop iterates over the color planes of the images.

for i = 1:r
for j = 1:c

% These loops iterate through the rows (i) and columns (j) of the
images.
nc = bitand(a(i, j, color_plane), 254);

% Performing BITWISE AND operation on pixel with 254

ns = bitand(x(i, j, color_plane), 128);

% Performing AND operation on pixel of msg image with 128


% Extracts the MSB (Most Significant Bit) from the message
image pixel

ds = ns / 128;

% Dividing above result by 128 to get MSB as 1

final_watermark(i, j, color_plane) = nc + ds;

% Adding cover image and divided secret image


% Embeds the message bit into the cover image's LSB, TO
creating the watermarked image.
end
end
end

subplot(2,2,3);
% plot the image in popup window

imshow(final_watermark);
%This command displays the image stored in the variable final
watermark
% The imshow() function in MATLAB is used to visualize images
title('Watermarked Image');
%This command sets the title for the displayed image.
Segmented image
Fig6.3.3 Segmented image

% WATERMARK RECOVERY

output = zeros(r, c, 3, 'uint8');


%Initializes an output matrix named output with the same
dimensions as the original images (a and x).
%This matrix will store the recovered image after extracting the
watermark.
%The zeros() function creates a matrix filled with zeros, having
dimensions r rows, c columns,
%and specifies the data type as unsigned 8-bit integers ('uint8').

for color_plane = 1:3


% Initiates a loop over the color planes (R, G, B) of the images.

for i = 1:r
for j = 1:c
% Nested loops iterating through each pixel position in the images.

nc = bitand(final_watermark(i, j, color_plane), 1);


%Retrieves the LSB (Least Significant Bit) of each pixel from
the watermarked image final_watermark.
% The bitand() function performs a bitwise AND operation
between the pixel value in final_watermark
% and 1 to extract the LSB (which can be either 0 or 1).
% Performing AND operation on watermark

ms = nc * 254;
% Multiplying the result by 254
%Reconstructs the MSB (Most Significant Bit) for watermark
recovery.

output(i, j, color_plane) = ms;


%Assigns the recovered MSB value to the corresponding
pixel position in
%the output matrix for watermark recovery
end
end
end

subplot(2,2,4);
imshow(output);
title('Recovered Image');

Recovered Secret Image:

Fig6.3.4. Recovered image


The overview of the MATLAB output:

Fig6.3.5 MATLAB output


7.RESULTS:
We tested our image steganography tool using a set of test images of various sizes
and formats. The tool was able to successfully embed and extract messages within
the images using the LSB algorithm. The extracted messages were found to be
accurate, and the visual quality of the images after embedding was also good.
To evaluate the effectiveness of the embedding process, we conducted
experiments to measure the amount of distortion caused by the message
embedding. The distortion was measured using the peak signal-to-noise ratio
(PSNR) and the mean square error (MSE) metrics. Our results showed that the
average PSNR and MSE values were within an acceptable range, indicating that the
image quality was preserved after embedding the message.
We also evaluated the effect of message length on the embedding process. Our
results showed that as the length of the message increased, the distortion caused
by the embedding also increased. However, the effect was relatively small, and the
visual quality of the images was still good even for long messages.
Overall, our results demonstrate the effectiveness of the image steganography
tool using the LSB algorithm in MATLAB, and its potential for secure and covert
communication.
8.Applications of Steganography

There are various applications in Steganography; it varies among the user


requirements such as copyright control, covert communication, smart ID’s,
printers etc.

8.1 Copyright Control:

Inside an image, secret copyright information is embedded. This is achieved by


Watermarking which is the complex structure. So that the intruder cannot identify
the copyright information. There are various methods available to find the
watermarking. It is achieved by statistical, correlation, similarity check.
Watermarking is used to protect the copyright information.

8.2 Covert Communication:


In general covert channel passes information by non-standard
methods. Communication is obscured that is unnoticed. The aim of the covert
communication is to hide the fact that the communication is being occurred. Covert
communication ensures privacy. Steganography is one of the best techniques of
covert communication.

8.3 Smart Id’s:


In smart ID’s the information about the person is embedded into their image for
confidential information. For an organization, the authentication of the resources is
accessed by the people. So identifying the theft related to prevention of crimes.
8.4 Printers:
Steganography make use of some modern printers like HP printer etc. In those
printers, very small yellow dots are inserted into all pages. Information is hidden
inside the yellow dots like serial number, date and time stamp. Property is available
in laser printer for watermarking the confidential information.
• Confidential Communication and Secret Data Storing
• Protection of Data Alteration
• Access Control System for Digital Content Distribution

9.Conclusion:

In this project, we have developed an image steganography tool using the LSB
algorithm in MATLAB. Our tool is capable of embedding messages within digital
images while preserving the visual quality of the images. The tool also allows for the
extraction of hidden messages with high accuracy.
Our experiments showed that the image quality was preserved after embedding the
message, and the amount of distortion caused by the embedding was relatively
small, even for long messages. This indicates that the LSB algorithm is an effective
method for steganography in digital images, and can be used for secure and covert
communication.
However, it should be noted that steganography can only provide a certain level of
security, and should not be relied upon as the sole method of communication.
Additionally, there are other steganalysis techniques that can be used to detect the
presence of hidden messages in images, and it is important to be aware of these
methods when using steganography for sensitive information.
Overall, our image steganography tool using the LSB algorithm in MATLAB is a useful
and effective tool for secure communication, and can be further developed and
improved for future use.
10.REFERENCES

 S. Cheddad, J. Condell, K. Curran, and P. McKevitt, "Digital image


steganography: Survey and analysis of current methods," Signal Processing,
vol. 90, no. 3, pp. 727-752, 2010.

 N. F. Johnson and S. Jajodia, "Exploring steganography: Seeing the


unseen," Computer, vol. 31, no. 2, pp. 26-34, 1998.

 R. Chandramouli and N. Memon, "A survey of steganographic


techniques," in Proceedings of the 8th ACM Workshop on Multimedia and
Security, 2006, pp. 1-10.

 M. Kharrazi, H. Sencar, and N. Memon, "Image steganography: Concepts


and practical solutions," IEEE Signal Processing Magazine, vol. 19, no. 5, pp.
16-28, 2002.

 W. Bender, D. Gruhl, and N. Morimoto, "Techniques for data hiding,"


IBM Systems Journal, vol. 35, no. 3-4, pp. 313-336, 1996.

 J. Fridrich, "Steganography in digital images," in Proceedings of the 1998


IEEE International Conference on Image Processing, 1998, vol. 2, pp. 512-516.

You might also like