Disclaimer: This is an example of a student written essay.
Click here for sample essays written by our professional writers.

Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of UKEssays.com.

Image Based Steganography Using Lsb Insertion Technique Computer Science Essay

Paper Type: Free Essay Subject: Computer Science
Wordcount: 5440 words Published: 1st Jan 2015

Reference this

The Data transmitted comes in many forms and it is used for more than one application. Communications should be done secretly. Secret communication varies from level of security needed such as banks , in credit card payments and secured communication related to corporate systems .Steganography is an art of embedding a secret message into a normal message. Steganography is used in watermarking for protecting data copyrights .Unsurprisingly, methods of Steganography change because innocuous spam contents are growing frequently by embedded texts

Get Help With Your Essay

If you need assistance with writing your essay, our professional essay writing service is here to help!

Essay Writing Service

Cryptography is technique used to make secret message scribbled for third party and are normally used in WEB. The encrypted message is targeted by attackers in cryptography because it hides the message content. An another data hiding technique known as watermarking used for embedding and hiding, some symbol data or digital manifest in the digital valuable data like photo picture, digital movie, musical sound etc. Watermarking purpose is mainly used to protect ownership or copyrights of the data. In this technique, hardness of embedded evidence and hidden evidence are very small and is important. In this technique the important information is present in external information which can be seen.

In the Steganography technique, confidential information made invisible for a human eye by embedding it as a dummy data such as a speech sound and a digital image. Steganography contains another research topic called as steganalysis which is used to find a stego file from the available files. Steganalysis is used in detecting suspicious image file. The suspicious image files are embedded with the crime associated information

The information hiding capacity is limited in traditional Steganography. These techniques can hide 10% or less than 10% data of a carrier data. The principle of these techniques is to replace frequency components of carrier or to swap LSB bits of multivalued image with secret information. In Steganography, image is used as a carrier data and it embeds secret information in bit planes .In Steganography, replacing noise like reg ion without disturbing the image quality is termed as B.P.C.S Steganography..BPCS Steganography is known as Bit plane complexity segmentation Steganography.


Steganography is derived from a Greek word which means as a “covered writing or hidden writing”. In Steganography stegos means cover and grafia means writing.


Steganography used to hide confidential information from human eyes by embedding it in a carrier data such as a digital image or a speech sound. A carrier data is consists of color images having RGB color components in a multi-bit data structure. The embedded information is evoked by means of special extracting program and key .The techniques of Steganography different from “file camouflage” or file deception technique.

File deception is used for hiding secret data in system file and it almost looks as a Steganography. But, it is a one of easy method to disguise an secret-data file as a regular file and is possible in files which have don’t care option. For example, Word file or JPEG image OR MPEG will allow for adding an “extra” data (extension) at the end of a usual file. After adding an extra data, the JPEG image, word file or MPEG looks as original image and original sound, or document on system.People may think this is due to Steganography. The lengthy files are easily noticed by engineers. Therefore file deception and Steganography are different.

The Steganography software’s that are available in the market are based on file deception. In Steganography, if output file size is increased by embedding the information then the program is called as File deception. A secret data can be made unreadable by encrypting the data. The secret data should be encrypted to make it unreadable for third party. With the help of data encryption, secret data can be safe. Data encryption depends on a data scrambling and it uses a secret key. Data encryption can create a doubt to the people that owner of the data is hiding something in an image. In data encryption we can find easily that he is hiding something in a image. Therefore encryption of data is not enough. Steganography is the solution for data encryption.

There are two types of data in Steganography .they are secret data and carrier data. Secret data is very valuable when compared to the carrier data. Carrier data is a type of dummy data which is not so important but it is needed. The data which is embedded is called as stego data. If we want to recover the secret data , we can extract that data from stego data. We need a special program or a key for data extraction..

The carrier is image data which has color components of red green and blue colors in 24 bit pixel structure. The figure below shows an example of carrier image and stego image. The secret data is embedded in stego image.


Steganography is a method of hiding the secret data by fixing it in media data .For example in the figure a secret data is embedded but we can’t find in which place the secret data is embedded. The data which is embedded will be very safe in the Steganography because it will hide content of the message and location of hidden image. There are many methods to embed the data .but; it is very hard to find about the method used in embedding the message.. Steganography collaborates with cryptography to embed the encrypted data safely. In Steganography, Stego data will not have any evidence about the embedded data.

The Steganography user should discard the original carrier data after embedding such that it will not allow comparison of stego and original data. Embedded capacity should be larger. BPCS method is the method available method for image Steganography. If anyone detect the Steganography image, it is very difficult for him to retrieve the hidden image. There are three basic ways to hide a message in image. They are Injection, substitution and generation. Using Injection method we can find in which place data to be inserted and using substitution we can find least significant bits for hiding the message. Using generation method we can create a new file based on the hidden information.

Method of implementation:

Least significant bit insertion is one of the important methods of implementation. In this method , the LSB bits of byte is altered so that it form bit string and represents a embedded file. By changing the LSB bits, it will cause some small differences in color which are not noticeable to human eye. After that an image is compressed and a text message is hidden in image .In LSB method, LSB bits of the covered image are changed to form embedded information. Embedding a message into cover image will result a stego image. For normal vision, the appearance of stego image will be same as cover image because of small changes of pixel values. Therefore there is no significant difference. The embedded message is sequentially embedded in covered image so that it is simple for other third party to recuperate the message by retrieving the pixels consequently which starting from the first pixel of the image. Steganography uses a key which as a better security. It is difficult to recover the embedded image without valid key.


Least significant bit insertion is the common technique used in Steganography. In LSB method, an image is used. An image is more than strings and string of bytes. Each byte in an image represents different colors. The last few bits in a color byte do not hold much significance as the first few bits. Therefore only two bits differ in last few bits that represent a color which is undistinguishable to human eyes. In LSB method, least significant bits of a cover image are altered such that we can embed information. The example shows how letter A is hidden in first 8 bytes of 3 pixels in a 24 bit image. Since the 8 bit letter A requires only 8 bytes to hide it, ninth byte of the 3 pixels used to hide the next character of the hidden message.

Example shows that in a 24 bit image, letter A can be hidden in first 8 bytes of 3 pixels

Pixels: (00100111 11101001 11001000)

(00100111 11001000 11101001)

(11001000 00100111 11101001)

A: 01000010

Result: (00100110 11101001 11001000)

(00100110 11001000 11101000)

(11001001 00100110 11101001)

The five underlined bits are the 5 bits which were altered. With LSB insertion technique, on an average half of the bits of an image are changed. ‘A’ is a 8 bit letter and requires 8 bytes for hiding. The ninth byte of 3 pixels is used for hiding next character of secret message.

The slight variations of this technique allows a message to embed into two or more least significant bits per bytes, and increases the information hidden capacity of the cover object .but cover object is degraded and easily detectable.LSB insertion is easy to implement and is also easily attacked if the modifications are done wrongly. Improper modifications in color palette and normal image calculations will demolish hidden message. Image resizing and image cropping are some examples of image manipulations.

Applications of Steganography:

Steganography is applicable the following areas.

1).Private communication and secret data storing.

2).Security of data.

3).Accessing the control system for distributing the digital content

4).Media data base systems.

The application area of Steganography differs based on the features utilized in a system.

1).Private communication and secret data storing:

The secrecy of embedded data is important in this area. Steganography provides capacity for hiding the existence of secret data and Steganography makes very hard to detect the embedded data in a image and Steganography strengthens the encrypted data.

In Steganography, select a carrier data according to the size of embedded data. Carrier data should not be effective. Now embed the secret data using an embedding program with the help of a key. To recover the embedded data, an extracting program is used with a key. Before starting the communication in this case, Key negotiation is used

2).Security for a data:

Steganography is used in military applications for maintaining the secret data .In military secret information should be very secure to avoid sudden attacks on them from enemies. Steganography can hide the existence of contents of data but it cannot hide the presence of data. Data should not be larger than carrier image .Steganography strengthens the secrecy of the data. Fragility of the embedded data is advantage for this application area. Embedded data can be rather fragile than robust. But embedded data is fragile in most of the Steganography programs. No one can change or tampered the data .If anyone changes or tampers the data, and then it can be easily detected by the extraction program.

3). Accessing the control system for distributing the digital content :

In this application, embedded data is explained to publicize the content. Here embedded data is hidden data. Digital contents are being commonly distributed by internet. Some music companies release the music for free in some web sites and in some sites it charges for the music downloads. Digital contents are equally distributed to user who accesses the web pages. Even it is possible to send digital content to e-mail messages it takes more time. We can to upload any content on the web page; we can issue a special access key to extract the content. In Steganography a prototype of an access control system is developed for distributing the digital content through internet. This can be explained by following steps.

1).The content owner will classify his digital content in a folder and embeds the folder according to Steganography method by accessing the folder access key and uploads embedded content on web page.

2).On the web page, owner will explains the contents clearly and publicises it worldwide and gives his contact information on web page.

3).The owner will receive access request from the customer who visited that web page. Then owner creates an access key and provides it to the customer for free or charge.

4).Media database systems:

In this type of application secrecy of data is not important, converting two types of data into one data is important. Photos, Pictures, movies and music will come under media data. For example the media data for a photograph will contain about the title of the photo and date and time of a photo and it also contain about the camera used to take that photograph.

Data hiding in .bmp images:

There are several formats exists for an digital image. .BMP, JPG, GIF are some formats .Each format is associated with advantage and disadvantages. Because of its simplicity, windows BMP file offers more advantages. It has an advantage of widely spreader and the information contained is minimum .Bmp file is a binary file.bmp file is divided into four sections such as file header, color table, image header and pixel data. To know about size of the image file header are used and also to learn where actual image data is located within the file. The Image header gives information about the image and its data format such as width and height of the image. Image header also gives information such as how many bits are used per pixel and checks whether the image data is compressed data or uncompressed data. Depending on the image data, color table will be present. When color table is not present, a set of bit masks are used to extract the color information from the image data. When dealing with 24-bit image, color table is not present. When dealing with 8-bit image, color table consists of 256 entries. Each entry consists of four bytes of data. In these four bytes of data, first three bytes are blue, green and red colors values .The fourth byte must be equal to zero because it is not used. In 8-bit format, each pixel is represented by single byte of the data which is index in to color table. In 24-bit format, each pixel I represented by RGB component values .The pixel data holds entire hidden data and there are changes by one pixel value either positive or negative.


The data structure in MATLAB is array, it is set of real or complex elements. MATLAB suits better in representing the images. images are stored as two dimensional array or matrices where each element of matrix determines one pixel in displayed image.


Image is a two dimensional function f(x, y). Whereas x and y are spatial co-ordinates. The amplitude of f at f(x, y) is called as intensity image. Image is defined as digital image if values of f, x, y are of discrete quantities. Digital image processing is defined as a process of a digital image using a digital computer. The digital image contains finite number of elements. Each element as its location and a value and elements are called as pixels.

Image plays an important role in human life. The analysis of an image depends on vision and image processing. At one end of vision there are no clear cur boundaries in continuum. Let us consider three types of process in continuum. They are low level, mid level and high level process. Low level process involves operations like reduction of noise, sharpening of image, and adjustment of contrast. Mid level operations involve segmentation, object description. These operations will be helpful in reducing a object and for classifying object. In mid-level process , inputs are images and output are extracted from input images. High level processing involves operations like ensembling of objects and some functions that are involved with human vision .

Definition for an image:

Image is a two dimensional function f(x,y) , x y are spatial co-ordinates. Amplitude of f at x, y is called as intensity of image.

Gray scale image:

It is function of two spatial co-ordinates of image plane. On image plane I(x,y) is intensity of image at x,y.

Color image.

Image is represented by three functions R, G, B. RGB is a three colors red green and blue. The image as continuous amplitude and is continuous with x, y. The amplitude of image should be digital for converting an image to digital image. Conversion of co-ordinate values of an image into digital values is called as sampling. Converting the values of amplitude into digital values is called as Quantisation.

Coordinate convention :

Sampling and quantisation result a real number matrix.The digital images are represented in two ways.By sampling f(x,y) , an image with M rows and n columns resulted and the size of that image is MxN .The coordinate values are of discrete quantities.In many books that are related to image processing it is mentioned that origin of image is at (xylem)=(0,0) .the next coordinates are at first row of image and it is given as (xylem)=(0,1).Here it is importent to keep note that (0,1) is used to signify second sample along first row. Toolbox uses the word race instead of using xylem to indicate rows and columns. Toolbox employs spatial coordinates less frequently.

Image as matrices:

A digital image is represented by a function

F(0,0) f(0,1)……f(0,N-1)

F(1,0) f(1,1)……f(1,N-1)

F(xylem)=f(M-1,0) f(M-1,1)…f(M-1,N-1)

In above equation f(M-1,N-1) can be defined as a digital image. In this array , each element is called as image element and picture element.

In MATLAB, digital image is represented as

F(1,1) f(1,2)……f(1,N)

F(2,1) f(2,2)…….f(2,N)



F=f(M,1) f(M,2) …..f(M,N)

If f(1,1)=f(0,0) then it represents they are identical. F(x , y ) denotes that elements are located in row p and column q. Let’s take an example f(8,7). Here elements are located at eight row and ninth column. In a MxN matrix, M denotes number of rows and N denotes number of columns. Here MxN matrix is called as column vector and 1xN matrix is called as row vector and 1×1 matrixes is defined as a scalar quantity.

In matlab, matrix is stored variables A, real array, and so on .The variables in matlab matrix should contain letters and numbers. F(x,y) is a roman and Italian notation that are used in matlab for mathematical expressions.

How to read image in MATLAB:

The function ‘imread’ is used to read an image in MATLAB. The syntax for reading an image is imread(filename).The different formats used in MATLAB are TIFF PNG JPEG XWD GIF BMP .TIFF is a tagged image file format and is represented as .tif and .tiff. PNG is a portable network graphic and it is represented as .png. JPEG is joint photograph experts group and are represented as .jpg and .jpeg. GIF is a graphic interchange format and are denoted as .gif. BMP is bitmap window and are recognised as .bmp. XWD is X window dump and are recognised as .xwd.

The filename contains image file


>> f = imread (‘8.jpg’);

In this command, it reads jpeg image into image array f and single quote delimits the filename of a string. In a MATLAB, semicolon is used for suppressing output and if we won’t use semicolon it displays result in that line. The symbol “>>” denotes that starting of a command. This symbol is shown in matlab command window. In command line, path is not included in filename. Imread reads the file in a current directory. If it is not read in the current directory window, we can find that file in MATLAB search path. We can read an image from directory that includes full path or relative path in filename.

Example :

>>f=imread (‘E:jaichestxray.jpg’);

Therefore it reads the image from jai folder on E drive


Therefore it reads an image from a sub directory jai of current working directory. Current directory displays MATLAB current working directory on matlab desktop toolbar. TIFFS, JPEG, GIF, BMP, PNG, and XWD are the popular image formats and these formats are supported by imread and imwrite functions.

In a image the dimensions of rows and columns are given by size of a function

>>size (f)

In MATLAB this function is useful in determining the size of an image.


The syntax returns number of rows and columns. M is number of rows and N is number of columns and f gives the size.

How to read a graphic image:

In a graphic file format, imread can be used to read an image. For storing an image pixel , most of the formats uses 8 bit and are stored as class uint8 in matlab and if the file supports 16bit data , MATLAB stores image as class uint16.

How to display image:

The function imshow is used for displaying an image in MATLAB. The syntax for displaying a image is imshow(f,g)

In the above syntax f is array of image and g is used for displaying number of intensity levels. G defaults to 256 levels if it is omitted by syntax imshow(f,{low high}).If the values are less than are equal to low then it displays as black and if values are greater than are equal to high then it displays as white. If the values are not less than and not greater than and are in between then it displays as intermediate intensity value by defaultly. Therefore the final syntax is Imshow(f,[ ]).The variables which are high will have maximum value and low variables will have minimum value. The function imshow will display positive and negative valued images.

Find Out How UKEssays.com Can Help You!

Our academic experts are ready and waiting to assist with any writing project you may have. From simple essay plans, through to full dissertations, you can guarantee we have a service perfectly matched to your needs.

View our services

Pixval function are used for displaying the intensity values individually. Pixval function displays cursor on the image. In a figure window, Move the computer mouse on the image so that intensity values and position of cursor is displayed. The color components such as red green and blue are displayed when working with color image. The Euclidean distance of initial and cursor positions can be displayed by pixval and this can be done by clicking left side button on mouse.Click the ‘x’ button for closing the window.


If there is a semicolon at ending, it will not have an effect so it is exception of using semicolon. MATLAB can replace an image with new image by displaying another image using imshow. Use the function >>figure, imshow(g) for keeping first image as output second image.The statement >>imshow(f),figure , imshow(g) is used for displaying both and first and second images .If different commands delimits commas and semicolons then more than one command is written on the line. To suppress the outputs of a screen from command line , the semicolons are used.


The function imwrite is used for writng an image in MATLAB. The syntax for writing an image is Imwrite (f,’filename’).In this syntax , filename contains a string .file extension format should be a recognised format.




This command is used for writing f to a TIFF file patient10_run1:.In current directory window imwrite will save the file if the file does not have information about the path. Depending on the selected file format ,imwrite is having other parameters. The most important formats are JPEG and TIFF .so it is important to focus on these two file formats.The syntax imwrite is applied to jpeg images


Here q is the integer and its value ranges between 0 and 100.In compression of jpeg image ,if the number is less than the degradation will be higher. This can be explained by the following example.

Here q=25

Then the syntax is


If an image is has q=15 then it has false shape which is hardly visible.this effect pronounces as q=5 and q=0.compress the image with q=25 for an expectable solution .compression can be achieved by obtaining details of image file by using imfinfo

The syntax is Imfinfo filename

Filename refers the complete filename of image that is stored on disk.this can be explained by following example

>>imfinfo bubbles25.jpg

It displays output in following way.

filename: ‘bubbles25.jpg’ and filemoddate :’08-jan-2009 12:30:25′ and filesize :13849


format version :’

width : 715

height : 687

bit depth :8

color depth :’grayscale’

format signature:’ ‘

comment: { }

The filesize is expressed in bytes. The number of bytes in original image multiply width and height by bit depth and divide the obtained result by 8 therefore we get result as 491205.We can obtain the ratio of compression by dividing the file size.(491205/13849)=35.46 therefore compression ratio is achieved and it is 35.46.Maintain the quality of image consistently. The reduction of stoage space transmits 35times of the uncompressed data per unit time. Iminfo displays the information field and are captured by a variable for some computations.


Here ‘ k’ is assigned to a structure variable.

The variable k as information and it is generated by command imfinfo. The information that is generated by imfinfo command is added to structure variable by a field that are separated from k by dot. The height and width of a image is stored in k.height and k.width

Consider the structure variable k for changing the ratio of compression bubbles25.jpg


>>image bytes=k.width*k.height*k.bit depth/8;

>>Compression_ bytes =k.filesize;

>>Compression_ ratio=35.16

Imfinfo can be used in two different ways. One method is type imfinfo bubbles25.jpg at prompt then it displays information on screen. Second method is type K=imfinfo(‘bubbles25.jpg’) then it generates the information that are stored in k variable. The two different ways of calling the function imfinfo is an example of command_function duality.

In general imwrite syntax is applied to tif images only

Imwrite (g,’filename.tif’,’compression’,’parameter’ …’resolution’,[colres rowers]

The parameter will have one of the principal values such as ‘none’ it indicates no compression and pack bits indicates compression of pack bits and ‘ccitt’ indicates compression of ccitt. By default ccitt is for binary images.1*2 is an array and it contains two integers that gives resolutions of row and column in dot per unit. If the dimensions of image are in inches then colres will have number of dots per inch in vertical direction and it is same for rows in horizontal direction .

>>imwrite(f,’sf.tif’,’compression’,’none’,’resolution’…….[300 300])

Multiply 200 dpi by ratio 2.25/1.5 then we get 30dpi to determine values of a vector.if we compute manually , we can write



This syntax is like an argument for nearest integer. The number of pixels is not changed by using these commands but there is a change in scale of the image. These processes are useful in controlling image size without loosing its resolution. On matlab desktop , it is necessary to export images to disk. It is true with plots. In a figure window, there are two ways for exporting the contents. First method is , in a figure window select file option in menu and then choose export option. Using this option user can choose the location, format and a filename. Using print command we can obtain the control on export parameters.The command isprint-fno-dfileformat-rresno-filename. In figure window ‘no’ refers to the number of a figure and file format refers to file format that are available. The resolution in dpi is referred as ‘resno’. The filename is used for assigning a file.

If we type print at the prompt, MATLAB prints contents of the displayed last figure window.

How to write a graphic image:

In a graphic file format, imread can be used to read an image. For storing an image pixel , most of the formats uses 8 bit and are stored as class uint8 in matlab and if the file supports 16bit data , MATLAB stores image as class uint16.

In a graphic image format, the function imwrite is used to write an image to graphic file .The basic syntax imwrite takes image variable and image filename.

How to resize an image:

The function imresize is used to change the size of image. Using the imresize function we can fix the output size

Image cropping:

The function imcrop is used for cropping an image. Using imcrop, we can crop the rectangular portion of an image. The imcrop function is used for displaying an image in a figure window and we can crop the image in a figure window.


The pixel values are not limited to integer values in matlab. The MATLAB supports various data classes for representing the pixel values. There are three types of data classes .they are numeric data class and char class and logical class. Char class is the ninth entry in data classes and logical data class is the last entry.

The numerical calculations in MATLAB are done in double quantities so data classes encounters frequently in image processing applications. The class unit 8 is found when reading the data from a storage device and 8 bit images are commonly found .The two data classes logical data class is of less degree and unit 16 forms the primary data class. Ipt functions support all data classes. To represent a number, data class double requires 8 bytes. Uint8 and int 8 requires one byte and uint16 and int16 requires 2 bytes. The various data can be described as follows. The data class double can be described as double_precession, floating_point numbers. Uint8 ranges from [0, 255] and it is an unsigned 8bit integer and it is of one byte per element.Uint16 is a unsigned integer and ranges from [0, 65535] and it is of 2 bytes per element. Uint 32 is an unsigned integer and ranges from [0, 4294967295] and it is of 4 bytes per element. Int 8 is an 8bit signed integer and it is of 1 byte per element and ranges from [-128,127]. Int 16 is a 16 bit signed inter whose is range is of [32768, 32767] and it is 2 bytes per element. Int 32 is a 32 bit signed integer of range [-2147483648 , 21474833647] and it is of 4 bytes per element. Single is a single_precession floating_point number with the values and ranges 4 bytes per element. Char is called as character and it ranges of 2bytes per element. Logical is a data class, whose values are 0 to 1 and it is of 1byte per element. Char data class holds characters in Unicode representation. The char string is simple 1*n array. The values of logical array are 0 and 1 .Using logical function each element is stored in the memory.


There are four types of images that are supported by MATLAB. They are

Intensity image, binary image , indexed image , R G B image. Most of the image processing operations are performed by binary image or intensity image.

Intensity image:

Intensity image is a data matrix and its values are represented within some range by intensities. The Intensity image is stored as a single matrix in MATLAB In intensity image, image consists of intensity or gray scale values. Intensity images are represented by arrays in matlab. In intensity image, images are repr


Cite This Work

To export a reference to this article please select a referencing stye below:

Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.

Related Services

View all

DMCA / Removal Request

If you are the original writer of this essay and no longer wish to have your work published on UKEssays.com then please: