Disclaimer: This dissertation has been written by a student and is not an example of our professional work, which you can see examples of here.

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

Image Based Steganographyusing LSB Insertion Technique

Info: 5476 words (22 pages) Dissertation
Published: 11th Dec 2019

Reference this

Tagged: Medical Technology


Steganography is a technique used to hide the message in vessel data by embedding it. The Vessel Data which is visible is known as external information and the data which is embedded is called as internal information.The extrenal information is not much useful to the data owner.

The techniques used in Steganography makes hard to detect hidden message within an image file. By this technique we are not only sending a message but also we are hiding the message. Steganography system is designed to encode and decode a secret file embedded in image file with a random Least Significant Bit(LSB) insertion technique. By using this technique the secret data are spread out among the image data in a random manner with the help of a secret key. The key generates pseudorandom numbers and identifies where and in which order hidden message is laid out. The advantage of using this method is that it includes cryptography. In cryptography, diffusion is applied to secret message.


The information communicated comes in number of forms and is used in various number of applications. In large number of these applications, it is desired that the communication has to be done in secrete. Such secret communication ranges from the obvious cases of bank transfers, corporate communications, and credit card purchases,and large percentage of everyday e-mail. Steganography is an ancient art of embedding a message in such a way that no one,except the sender and the recipient,suspects the existence of the message. Most of the newer applications use Steganography as a watermark, to protect a copy right on information. The forms of Steganography vary, but unsurprisingly, innocuous spam messages are turning up more often containing embedded text. A new transform domain technique for embedding the secret information in the integer wavelet which is transformed on a cover image is implemented here.

A technique which is used to scramble a secrete or a confidential message in order to make it unreadable for a third party is known as the Cryptography.Now-a-days its commonly used in the internet communications.cryptography can hide the content of the message but it cant hide the location of the secrete message.This is how the attackers can target even an encrypted message.Water marking is the another information of hiding the digital data or a picture or musical sound.The main purpose of this watermarking information is to protect the copyright or the ownership of the data.In this technique the robustness of the embedded evidence,that can be very small, is the most important.The external information which is visible is the valuable information in the watermarking technique.

steganography is a technique which is used to make the confidential information imperceptible to the human eyes by embedding the message in some dummy data such as the digital image or a speech sound.There is a research topic about the steganography known as the steganalysis.The main objective of this steganalysis is to find out the stego file among the given files.It is a technique which is used to detect the suspicious image or sound file which is embedded with the crime related information.So,we need to make a “sniffer-dog-program” to break the steganography.However,it is too difficult to make a program that really works.

All the traditional steganography techniques have very limited information-hiding capacity.They can hide only 10% (or less) of the data amounts of the vessel.This is because the principle of those techniques which were either to replace a special part of the frequency components of the vessel image, or to replace all the least significant bits which are present in a multivalued image with the secrete information.In the new steganography which we are using uses an image as the vesel data, and we need to embed the secrete information in to the bit planes of the vessel.The percentage of information hiding capacity of a true color image is around 50.All the “noise-like” regions in the bit planes of the vessel image can be replaced with the secret data without deteriorating the quality of the image,which is known as “BPCS-Steganography”, which stands for Bit-Plane Complexity Segmentation Steganography.


The word Steganography is of Greek origin and means “covered, or hidden writing”. Its ancient origins can be traced back to 440BC.


Steganography is a technique which is used now a days to make confidential information imperceptible to the human eyes by embedding it in to some innocent looking “vessel” data or a “dummy” data such as a digital image or a speech sound.In a multi bit data structure a typical vessel is defined as a color image having Red,Green and blue components in it.By using a special extracting program and a key the embedded information can be extracted,the technique of steganography is totally different from “file deception” or “file camouflage” techniques.

A technique to hide the secrete data in a computer file which almost looks like a steganography is known as a “file deception” or “file camouflage”.But actually, it is defined as a trick which is used to disguise a secret-data-added file as a normal file.This can be done as most of the computer file formats have some “don’t-care portion” in one file.For instance if we take some file formats as jpeg,mpeg3 or some word file these looks like the original image,sound or document respectively on the computer.Some of them could have misunderstood that such a trick is a type of Steganography.However,such files can have an extra lengthy file sizes, and they can be easily detected by most of the computer engineers.So, by this we can understand that the file deception is totally different from that of the steganographic techinque which we are discussing here.

Many of the “Steganography software” which is in the market today is based on the file decepetion.If we find a steganography program that increases the output file size just by the amount we have embedded, then the program is obviously a file deception.If there is some secrete data then we should encrypt in such a way that it is not readable for the third party.A solution to Keep secrete information very safe is known as Data Encryption.It is totally based on scrambling the data by using some type of the secrete key.

However,encrypting the data will draw more attention of the people who have not encrypted the data.So, it is very to the owner to know whether the data is encrypted or not.By, this we can know that the encrypting is not enough. There is another solution which is known steganography.

There are two types of data in steganography, one is the secret data that is very valuable and the other is a type of media data “vessel” or “carrier” or “dummy” data.Vessel data is essential, but it is not so valuable.It is defined as the data in which the valuable data is “embedded”. The data which is already embedded in the vessel data is called “stego data”.By using the stego data we can extract the secret or the valuable data. For embedding and extracting the data we need a special program and a key.

A typical vessel is an image data with Red, Green, and Blue color components present in it in a 24 bits pixel structure. The illustration below shows a general scheme of Steganography.

Steganography is a technique which is used to hide secret data by embedding it in some innocent looking media data like Mona lisa in the above picture.The data which is embedded is very safe because Steganography hides both the content and the location of the secret information.In the media data there are many different methods to embed the data.It is highly impossible to detect which method is used for embedding the data.Steganography can co-operate with cryptography in the sense that it can embed the encrypted secret data and make it much safer.

The most important point in the steganography technique is that the stego data does not have any evidence that some extra data is embedded there.In other way, the vessel data and the stego data must be very similar.The user of the steganography should discard the original vessel data after embedding,so that no one can compare the stego and the original data.

It is also important that the capacity for embedding the data is large.As it is larger it is better.Of all the currently available steganography methods the BPCS method is the best.


One of the most common techniques used in Steganographytoday is called least significant bit (LSB) insertion. This method is exactly what it sounds like; the least significant bits of the cover-image are altered so that they form the embeddedinformation. The following example shows how the letter A can be hidden in the first eight bytes of three pixels in a 24-bit image.

Pixels: (00100111 11101001 11001000)

(00100111 11001000 11101001)

(11001000 00100111 11101001)

A: 01000001

Result: (00100110 11101001 11001000)

(00100110 11001000 11101000)

(11001000 00100111 11101001)

The three underlined bits are the only three bits that were actually altered. LSB insertion requires on average that only half the bits in an image be changed. Since the 8-bit letter A only requires eight bytes to hide it in, the ninth byte of the three pixels can be used to begin hiding the next character of the hidden message.

A slight variation of this technique allows for embedding the message in two or more of the least significant bits per byte. This increases the hidden information capacity of the cover-object, but the cover-object is degraded more, and therefore it is more detectable. Other variations on this technique include ensuring that statistical changes in the image do not occur. Some intelligent software also checks for areas that are made up of one solid color. Changes in these pixels are then avoided because slight changes would cause noticeable variations in the area .While LSB insertion is easy to implement, it is also easily attacked. Slight modifications in the color palette and simple image manipulations will destroy the entire hidden message.

Some examples of these simple image manipulations include image resizing and cropping.

Applications of Steganography :

Steganography is applicable to, but not limited to, the following areas.

  1. Confidential communication and secret data storing.
  2. Protection of data alteration
  3. Access control system for digital content distribution.
  4. Media Database systems.

The area differs in what feature of the Steganography is utilized in each system.

1. Confidential communication and secret data storing:

The “secrecy” of the embedded data is essential in this area.

Historically, Steganography have been approached in this area.Steganography provides us with:

(A).Potential capacity to hide the existence of confidential data.

(B).Hardness of detecting the hidden (i.e., embedded ) data.

(C).Strengthening of the secrecy of the encrypted data.

In practice , when you use some Steganography, you must first select a vessel data according to the size of the embedding data.The vessel should be innocuous.Then,you embed the confidential data by using an embedding program (which is one component of the Steganography software ) together with some key .When extracting , you (or your party ) use an extracting program (another component) to recover the embedded data by the same key (“common key “ in terms of cryptography ).In this case you need a “key negotiation “ before you start communication.

2. Protection of data alteration:

We take advantage of the fragility of the embedded data in this application area.

The embedded data can rather be fragile than be very robust. Actually, embedded data are fragile in most steganography programs.

However, this fragility opens a new direction toward an information-alteration protective system such as a “Digital Certificate Document System.” The most novel point among others is that “no authentication bureau is needed.” If it is implemented, people can send their “digital certificate data” to any place in the world through Internet. No one can forge, alter, nor tamper such certificate data. If forged, altered, or tampered, it is easily detected by the extraction program.

3. Access control system for digital content distribution:

In this area embedded data is “hidden”, but is “explained” to publicize the content.

Today, digital contents are getting more and more commonly distributed by Internet than ever before. For example, music companies release new albums on their Webpage in a free or charged manner. However, in this case, all the contents are equally distributed to the people who accessed the page. So, an ordinary Web distribution scheme is not suited for a “case-by-case” and “selective” distribution. Of course it is always possible to attach digital content to e-mail messages and send to the customers. But it will takes a lot of cost in time and labor.

If you have some valuable content, which you think it is okay to provide others if they really need it, and if it is possible to upload such content on the Web in some covert manner. And if you can issue a special “access key” to extract the content selectively, you will be very happy about it. A steganographic scheme can help realize a this type of system.

We have developed a prototype of an “Access Control System” for digital content distribution through Internet. The following steps explain the scheme.

(1) A content owner classify his/her digital contents in a folder-by-folder manner, and embed the whole folders in some large vessel according to a steganographic method using folder access keys, and upload the embedded vessel (stego data) on his/her own Webpage.

(2) On that Webpage the owner explains the contents in depth and publicize worldwide. The contact information to the owner (post mail address, e-mail address, phone number, etc.) will be posted there.

(3) The owner may receive an access-request from a customer who watched that Webpage. In that case, the owner may (or may not) creates an access key and provide it to the customer (free or charged).

In this mechanism the most important point is, a “selective extraction” is possible or not.

4. Media Database systems:

In this application area of steganography secrecy is not important, but unifying two types of data into one is the most important.

Media data (photo picture, movie, music, etc.) have some association with other information. A photo picture, for instance, may have the following.

  1. The title of the picture and some physical object information.
  2. The date and the time when the picture was taken.
  3. The camera and the photographer’s information.



Digital image processing is an area that is characterized by the need for extensive experimental work to establish the viability of the proposed solutions to a given problem. An important characteristic which is underlying in the design of image processing systems is the significant level of testing & the experimentation that normally required before arriving at an acceptable solution. This characteristic implies that the ability to formulate approaches &quickly prototype candidate solutions generally plays a major role in reducing the cost & time required to arrive at a viable system implementation.

What is DIP?

An image is defined as a two-dimensional function f(x, y), where x & y are the spatial coordinates, & the amplitude of function “f” at any pair of coordinates (x, y) is called the intensity or gray level of the image at that particular point. When both the coordinates x and y & the amplitude values of function “f” all have finite discrete quantities, then we call that image as a digital image. The field DIP refers to processing a digital image by the means of a digital computer. A image which is composed of finite number of elements,each element has particular location and value is named as a digital image.These elements are called as pixels.

As we know that vision is the most advanced of our sensor,so image play the single most important role in human perception.However, humans are limited to the visual band of the EM spectrum but the imaging machines cover almost the entire EM specturm,ranging from the gamma waves to radio waves.These can operate also on the images generated by the sources that humans are not accustomed to associating with the image.

There is no agreement among the authors regarding where the image processing stops and other related areas such as the image analysis and computer vision start.Sometimes a difference is made by defining image processing as a discipline in which both the input & output at a process are the images. This is limiting & somewhat artificial boundary.The area which is present in between the image processing and computer vision is image analysis(Understanding image).

There are no clear-cut boundaries in the continuum from the image processing at one end to complete vision at the other end . However, one useful paradigm is to consider the three types of computerized processes in this continuum: low-level, mid-level, & the high-level processes.The Low-level process involves the primitive operations such as image processing which is used to reduce noise, contrast enhancement & image sharpening. A low- level process is characterized by the fact that both the inputs & outputs are images. Tasks such as segmentation, description of an object to reduce them to a form suitable for computer processing & classification of individual objects is the Mid level process on images. A mid-level process is characterized by the fact that the inputs given to the image are generally images but the outputs are attributes extracted from those images. Finally the higher- level processing involves “Making sense” of an ensemble of recognized objects, as in image analysis & at the far end of the continuum performing the cognitive functions normally associated with human vision.

As already defined Digital image processing, is used successfully in broad range of areas of exceptional social & economic value.

What is an image?

An image is defined as a two-dimensional function f(x, y), where x & y are the spatial coordinates, & the amplitude of function “f” at any pair of coordinates (x, y) is called the intensity or gray level of the image at that particular point.

Gray scale image:

A grayscale image can be defined as a function I (xylem) of the two spatial coordinates of the image plane.

Assume I(x, y)as the intensity of the image at the point (x, y) on the image plane.

I (xylem) takes all non-negative values assume that the image is bounded by a rectangle [0, a] ´[0, b]I: [0, a] ´ [0, b] ® [0, info)

Color image:

It can be represented by the three functions, as R (xylem) for red, G (xylem) for green andB (xylem) for blue.

An image may be continuous with respect to x and y coordinates of the plane and also in the amplitude.Converting such an image into a digital form requires the coordinates and the amplitude to be digitized.Digitizing the values of the coordinate’s is called sampling. Digitizing the values of the amplitude is called quantization.

Coordinate convention:

The result which is generated by using sampling and quantization is a matrix of real numbers.There are two principal ways to represent the digital images.Assume that an image with function f(x,y) is sampled in such a way that the resulting image has M rows and N columns.then the size of the image is MXN.The values of coordinates (xylem) are the discrete quantites.For the notational clarity and convenience, we can use the integer values for these discrete coordinates. In many of the image processing books, the image origin is defined at (xylem)=(0,0).The values of the next coordinate along with the first row of the image are (xylem)=(0,1).It is very important to keep in our mind that the notation (0,1) is used to signify the second sample along with the first row. It does not mean that these are the actual values of the physical coordinates,when the image was sampled.The figure below shows the coordinates convention. Note that the x ranges from 0 to M-1 and y ranges from 0 to N-1 in integer increments.

The coordinate convention which is used in the toolbox to denote arrays is different from that of the preceding paragraph in two minor ways. Firstly, instead of using (xylem) in the toolbox it uses the notation (race) to indicate the rows and the columns. Note:However,the order of coordinates are the same as in the previous paragraph, in the sense the first element of the coordinate topples, (alb), refers to a row and the second one to a column. The other difference is that the origin of the coordinate system is at (r, c) = (1, 1); r ranges from 1 to M and c from 1 to N in the integer increments.The documentation of the IPT refers to the coordinates. Less frequently toolbox also employs another coordinate convention called spatial coordinates, which uses x to refer to column and y to refer to row. This is the quite opposite of our use of variables x and y.

Image as Matrices:

The discussion which we have done leads to the following representation for a digitized image 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)

The right side of this equation represents a digital image by the definition. Each element which is in this array is called an image element, picture element, pixel or a pel. The terms image or pixel are used throughout the our discussions from now to denote a digital image and its elements.

A digital image can be represented by a MATLAB matrix naturally 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)

Where f(1,1) = f(0,0) (note use of a monoscope font to denote the MATLAB quantities). We can see clearly that the two representations are identical, except for the shift in the origin. The notation f(p ,q) denotes that the element is located in row p and the column q. For example f(6,2) denotes that the element is in the sixth row and second column of the matrix f. Typically here we use the letters M and N to denote the number of rows and columns respectively in a matrix. A 1xN matrix is known as a row vector whereas an Mx1 matrix is known as a column vector. A 1×1 matrix is a scalar matrix.

Matrices in the MATLAB are stored in variables with different names such as A, a, RGB, real array etc… All variables in Matlab must begin with a letter and can contain only letters, numerals and underscores. As noted previously,all the MATLAB quantities are written using the mono-scope characters. We use the conventional Roman or italic notation such as f(x ,y), for the mathematical expressions

Reading Images:

Using the function imread the images are read into the MATLAB environment. The syntax for this is:


Format name Description recognized extension

TIFF Tagged Image File Format .tif, .tiff

JPEG Joint Photograph Experts Group .jpg, .jpeg

GIF Graphics Interchange Format .gif

BMP Windows Bitmap .bmp

PNG Portable Network Graphics .png

XWD X Window Dump .xwd

Here filename is a string containing the complete image file(including applicable extensions if any).For example the command line

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

reads the JPEG (in the above table) image chestxray into image array f. Note that the use of the single quotes (‘) is to delimit the string filename. The semicolon at the end of a command line is used for suppressing output in the MATLAB. If the semicolon is not includedthen the MATLAB displays the results of the operation(s) specified only in that line. The prompt symbol(>>) says that it is the beginning of the command line, as it appears in the MATLAB command window.

When in the preceding command line there is no path included in the filename, imread reads the file from current directory and if that fails then it tries to find the file in MATLAB search path. An easy way to read an image from a specified directory is to include a full or relative path to that directory in filename.

For example,

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

This reads an image from a folder called myimages on the E: drive, whereas

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

It reads an image from myimages subdirectory of the current of the current working directory. Current directory window on the MATLAB desktop toolbar displays the MATLAB’s current working directory and provides a simple and a manual way to change it. The table above lists some of the most popular image/graphics formats supported by imread and imwrite.

Function size gives the row and the column dimensions of an image:

>> size (f)

ans = 1024 * 1024

The above function is particularly useful in programming when used in the following form to automatically determine the size of an image:


The syntax above returns the number of rows(M) and columns(N) present in the image.

On whole the function displays the additional information about an array. For instance ,the statement

>> whos f


Name size Bytes Class

F 1024*1024 1048576 unit8 array

Grand total is 1048576 elements using 1048576 bytes

The unit8 entry shown refers to one of the several MATLAB data classes. A semicolon at the end of a line has no effect ,so normally one is not used.

Displaying Images:

To diplay images on the MATLAB desktop we can use a function called imshow, which has the basic syntax:


Where f is referred as an image array, and g as the number of intensity levels which are used to display it. If g is omitted here ,then by default it takes 256 levels .using the syntax

imshow(f,{low high})

By using the above syntax it displays an image as black all values less than or equal to low and as white all values greater than or equal to high. The values which are in between are displayed as intermediate intensity values using the default number of levels .The final syntax is

Imshow(f,[ ])

Sets the variable low to the minimum value of array f and high to its maximum value. This form of imshow is useful in displaying the images that have a low dynamic range or that have positive and negative values.

Function named “pixval” is used frequently in order to display the intensity values of the individual pixels interactively. This function displays a cursor which is overlaid on an image. As and when the cursor is moved over the particular image with the mouse the coordinates of the cursor position and the corresponding intensity values are shown on the display that appears below the figure window .When working with the color images, the coordinates as well as the red, green and blue components are also displayed. If the left button of the mouse is clicked and then held pressed, pixval displays the Euclidean distance between the initial and the current cursor locations.

The syntax form of interest here is Pixval which shows a cursor on the last image displayed. Clicking the button X on the cursor window turns it off.

The following statements read from a disk an image called rose_512.tif extract basic information about that image and display it using imshow :


>>whos f

Name Size Bytes Class

F 512*512 262144 unit8 array

Grand total is 262144 elements using 262144 bytes


A semicolon at the end of an imshow line has no effect, so normally it is not used. If another image named g, is displayed using imshow, MATLAB replaces the image which is in the screen with the new image. To keep the first image and output the second image, we use a function figure as follows:

>>figure ,imshow(g)

Using the statement

>>imshow(f),figure ,imshow(g) displays both the images.

Keep in mind that more than one command can be written on a line ,as long as different commands are properly delimited by commas or semicolons. As mentioned, a semicolon is normally used whenever it is desired to suppress screen outputs from a command line.

Suppose that we have just read an image h and find that using imshow produces an image. It is clearly understood that this image has a low dynamic range, which can be remedied for display purposes by using the statement.

>>imshow(h,[ ])


By using the function imwrite images are written to disk ,which has the following basic syntax:

Imwrite (f,’filename’)

With the above syntax, the string which is contained in the filename must include a recognized file format extension.Alternatively, a desired format can be specified explicitly with a third input argument. >>imwrite(f,’patient10_run1′,’tif’)



In the above example the command writes f to a TIFF file named patient10_run1:

If filename contains no information on the path of the file, then imwrite saves the file in the current working directory.

The imwrite function can have some other parameters depending up on the e file format selected. Most of the work in the following chapter deals either with JPEG or TIFF images ,so we focus attention here on these formats.

More general imwrite syntax which is applicable only to JPEG images is


where q is an integer which is in between 0 and 100(the lower the number higher the degradation due to JPEG compression).

For example, for q=25 the applicable syntax is

>> imwrite(f,’bubbles25.jpg’,’quality’,25)

The image for q=15 has false contouring which is barely visible, but this effect becomes quite applicable for q=5 and q=0.Thus, an expectable solution with some margin for error is to compress all the images with q=25.In order to get an idea of compression achieved and to obtain other image file details, we can use the function imfinfo which has syntax.

Imfinfo filename

Here filename implies the complete file name of the image stored in the disk.

For example,

>> imfinfo bubbles25.jpg

outputs the following information(note that some fields contain no information in this case):

Filename: ‘bubbles25.jpg’

FileModDate: ’04-jan-2003 12:31:26′

FileSize: 13849

Format: ‘jpg’

Format Version: ‘ ‘

Width: 714

Height: 682

Bit Depth: 8

Color Depth: ‘grayscale’

Format Signature: ‘ ‘

Comment: { }

Where size of the file is in bytes. The number of bytes in the original image is simply corrupted by multiplying width by height by bit depth and then dividing the result by 8. The result is 486948.Dividing file size gives the compression ratio:(486948/13849)=35.16.This compression ratio was achieved. While maintaining the image quality consistent with the requirements of the appearance. In addition to obvious advantages in storage space, this reduction allows the transmission of approximately 35 times the amount of uncompressed data per unit time.

The information fields which are displayed by imfinfo can be captured to a so called structure variable that can be for the subsequent computations. Using the receding example and assigning the n

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

Related Content

All Tags

Content relating to: "Medical Technology"

Medical Technology is used to enhance the medical care and treatment that patients are given in healthcare settings. Medical Technology can be used to identify, diagnose and treat medical conditions and illnesses.

Related Articles

DMCA / Removal Request

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