You are on page 1of 37

Digital Steganography

Chapter -1 INTRODUCTION

Chaos word has been derived from the Greek, which refers to unpredictability and it is defined as a study of nonlinear dynamic system. Chaos theory is a mathematical physics which was developed by Edward Lopez. Chaos is suitable for steganography, as it is closely related to some dynamics of its own characteristics. The behavior of the chaos system, under certain conditions, presents phenomena which are characterized by sensitivities to initial conditions and system parameters. Through the sensitivities, the system responses act to be random Steganography is a process of hiding a secret message into an image or hiding a secret image into a cover image. There are two basic methods implemented in steganography: Least significant bit (LSB)Spatial Domain Technique and Transform-based (DCT) Frequency Domain Technique. LSB steganography is a one of the simplest methods. Data hidden in images using this method is highly sensitive to image alteration & vulnerable to attack. DCT steganography is potentially more resistant to loss from image manipulation and increases the difficulty to a potential attacker. In this paper, we mainly deal with only LSB steganography method. 1.1 Purpose Of Project This project is used to encode a secret message into the image in such a way that others cannot discern the presence of information within the image and its very difficult to identify the original image and the image in which the information has been stored which is stego image because both the images are alike , there are very minor or no differences present between the original images and the stego image this encoding is done with the help of a secret key which must be known by the user inorder to decode and view the message which has been embedded within the image.
1

Digital Steganography

1.2 Hiding a secret message into another image


Consider a gray scale image (Io) with dimension MN; M, N represents rows and column of intensity level. Take the message which is to be embedded. For example the message to be embedded is Inception is a movie on dreams. Each letter in the message is converted to ASCIIcodes. Consider henon map which produces chaotic sequence, which is generated by using theequation given below: x(n+1)=1-a*x(n)^2+y(n); & y(n+1)=b*x(n); We have used the following values for the constants a and b to get a random sequence a=1.5 & b=0.1 The sequences are converted to binary by taking their average as threshold value. Each bit of the converted message is XORed with this chaotic sequence. Each XORed bit is again XORed with the least significant bit of the pixel of the image selected as the cover image. For example Consider, the binary value of I (ASCII 73), 01001001 (a) and it is XORed with
2

Digital Steganography

the binary chaotic sequence, say 10010001000100.(b), which is obtained using threshold value. After XORing we get the output as 11011000..(c). Each of these bits is now XORed with LSB of individual pixel of the cover image. Say the 1st pixel of the image is 56 which have binary value 00111000 (d). The LSB is 0. It is XORed with 1, which is obtained in the above sequence. The same is repeated until all the bits are embedded in the image. Now, the stego image is obtained. Here, the secret message what is chosen is of length 30. The cover image is pokemon image with dimension 80*80. The desteganography is done to get back the secret message by following the reverse process followed for steganography. As we know that each pixel of steganography image is of 8 bits, the first 7 bits are masked to obtain the sequence (c).Generate the chaotic sequence (b) with same initial conditions used for steganography. The sequence of bits obtained in (c) is XORed with (b) to retrieve the secret message. All the above results are obtained from the simulation of steganography algorithm

Chapter -2 System Requirements:

Digital Steganography

2.1 Software Requirements


Software: JAVA, WINDOWS 98, Sql server.

2.2 Hardware Requirements:


Hardware: PERTIUM IV, 80HDD.

Chapter 3 Problem Definition

Digital Steganography

3.1 Existing System


Supporting efficient and reliable data transmission over wireless networks has been subject of continuous research over the last decade. The major concerns were in the area of security. The data confronts the security hazard during transmission over a wireless network. Indeed, it is relatively easy to eavesdrop on video/audio conversations, or intercept and modify data packets. Anyone with a PC and access to the public network has the ability to capture network traffic, potentially compromising the privacy and the reliability of the applications. Hence, it is mandatory for wireless applications to guarantee authentication, confidentiality and integrity of data.

3.2 Proposed System:


The index terns used in this project are LSB Technique. Transmission. Image Viewer

Here using LSB technique, the information is hidden in the least significant bits of the image data.

By means of server sockets, the image containing information transmitted to network.

Image viewer used to view the normal and stegoimages. A quality measure gives the variation between original and stegoimage information.

Digital Steganography

In the receiver side the same software is to be installed. When the image file is opened the software tells the user whether that contains any hiding information or not.

If the image contains hidden information then client sockets will receive it.

With over 600 filling stations and exploitation fields petrom needs a powerful and capable system to transport and pick-up data from each location all over the country. They needed a highly flexible and reliable equipment capable to transmit secure data to a central headquarter where are managed through an advanced ERP (Enterprise Resource planning) system. Also the equipment must have been able to transmit data from all kind of locations, the majority having no fixed Internet connection available.

3.3 Modules
Sender Encrypt Send Reciever Decrypt

Module Description

Digital Steganography

Sender
The sender who wants to send the message to the receiver by hiding it behind an image will select the image by browsing and hide the normal secret message by changing Least Significant Bit to the message bits.

Encrypt
The sender encrypts the secret message by using encryption techniques and makes it ready to send the meassage to receiver.

Send
The sender sends the message which is hidden behind the image ,to the receiver along with the image which will be decrypted by receiver later.

Receiver
The user who wants to see the secret message will receive the message which is hidden behind the image.

Decrypt
The receiver will apply the decryption techniques to decrypt and see the secrete message which is hidden behind the image that has been send by the sender.

Chapter 4

Digital Steganography

Software design
4.1 DATAFLOW DIAGRAMS (DFDs)
A data flow diagram is graphical tool used to describe and analyze movement of data through a system. These are the central tool and the basis from which the other components are developed.

DFD FOR SENDER

sender

filename

message

Browse

encrypt

password

add

IPaddress

receiver
Encrypted message

send

DFD FOR RECEVIER

Select filename

receiver browse

password

decrypt

message

exit

receiver

view

Digital Steganography

4.2 UML DIAGRAMS

CLASS DIAGRAM
Class diagram models class structure and contents using design elements such as classes, packages and objects. It also displays relationships such as containment, inheritance, associations and others.

Digital Steganography

Class Diagram

USE CASE DIAGRAM:


A use case diagram is a set of scenarios that describing an interaction between a user and a system. A use case diagram displays the relationship among actors and use cases. The two main components of the use case diagrams are use cases and actors

10

Digital Steganography

Actor

Use Case

An actor is represents a user or another system that will interact with the system your modeling. A use case is an external view of the system that represents some action the user might perform in order to complete a task. They are helpful in exposing requirements and planning the project.

11

Digital Steganography

Use case Diagram for sender


select file

enter message

encrypt

Sender send Receiver

receiver

decrypt

password

ACTIVITY DIAGRAM:

Activity diagrams displays a special state diagram where most of states are action states and most of the transitions are triggered by completion of the actions in the source states. This diagram focuses on flows driven by internal processing.

12

Digital Steganography

Activity Diagram for sender


select file

enter message

encrypt

send

Activity Diagram for receiver

select file

sav e

decrypt

display message

13

Digital Steganography

4.3 E-r diagrams AND Block diagram

14

Digital Steganography

Chapter 5 Implementation Encoding and Decoding


5.1 JPEG Steganography and Algorithms JPEG/JFIF Format
Strictly speaking, JPEG refers only to a family of compression algorithms; it does not refer to a specific image file format. The JPEG committee was prevented from defining a file format by turf wars within the international standards organizations. JFIF has emerged as the de-facto standard on Internet, and is what is most commonly meant by "a JPEG file". Most JFIF readers are also capable of handling some not-quite-JFIF-legal variant formats. JPEG/JFIF works by extracting coefficients describing 8x8 pixel blocks and then compressing these coefficients. The blocks can be revealed by saving a JPEG of a gradient pattern with the lowest possible compression quality. The blocks, which start in the upper left-hand corner, are shown in Fig. J.1. Partial blocks will be included on the right and lower edges if the dimensions are not divisible by 8 pixels.

Fig. J.1. Left: gradient with high quality compression Right: gradient with low quality compression
15

Digital Steganography

5.2.1 Encoding
A flowchart describing typical JPEG encoding is shown below in Fig. J.2. 1) The input is a BufferedImage object, which contains a ColorModel and a matrix representing the image with pointers aimed at indices of the ColorModel. The RGB values of the uncompressed input image are converted into three components: one luminance component and two chrominance components (YUV). The luminance component is considered more important. 2) The image is separated into 8x8 pixel blocks starting from the upper left-hand corner . 3) The component signals for each 8x8 block are transformed into the frequency domain by using the two-dimensional discrete cosine transform (DCT). This transformation is similar to the two-dimensional fast Fourier transformation, except that the coefficients are real instead of complex. The perceptually most important information is contained in the first coefficients, and the later coefficients are generally small (redundance reduction). 4) While the coefficients closest to 0 are eliminated, the remaining coefficients are quantized using various degrees of accuracy (irrelevance reduction). This can be modified by changing the quantization tables. The DC luminance coefficients are the most important and are quantized with the most accuracy. 5) Finally, the quantized coefficients are compressed using a Huffman encoder.

16

Digital Steganography

Fig. J.2. JPEG/JFIF encoding scheme Since the DC luminance coefficients are quantized with the most accuracy, we will hide the information inside them. We will simply shift the values up or down by certain amounts into areas that are defined as being 0s and 1s. While this could be implemented by modifying the code of a JPEG encoder manually, we will simply modify the image beforehand so that the DC luminance coefficients will correspond to those that we seek. This method is possible and not especially processor intensive because the DC luminance coefficient corresponds to the average luminance values for each 8x8 block. It works as follows: 1) Convert the RGB signals for the image into YUV using the following formula. Store the result in a temporary float[][] to reduce quantization effects that occur before the compression itself.

17

Digital Steganography

2) Add a small amount of white zero-mean Gaussian noise with standard deviation

empirically during the implementation stage. 3) Carry out a small amount of preprocessing to reduce the likelihood of the rare cases described in step 6. Shift the values of the input f(x,y) to a compacted version f'(x,y).

f'(x,y) = p + f(x,y) (128 p) / 128 4) Determine which blocks should be modified according to the bit-placement algorithm. 5) Cycle through all of those blocks. Call the current one block B, and call b the bit that is supposed to be transmitted with block B. 6) Calculate the average value ya of the luminance signal Y for block B. 7) Find the target average value yt for the luminance signal for block B using the stego-table shown in Fig. J.3. The target value is the value in the middle of the region closest to ya that is labeled with the bit b. The target value will get changed slightly during compression because JPEG/JFIF is a lossy format. 8) Shift the luminance values for block B by adding yt - ya to them. (As long as p < k, there are rare cases in which this will not work due to the fact that certain pixels have luminance values that are bunched up near the edges of the luminance spectrum. That is, they would get shifted out of the valid range [0 255]. In those cases, a new target value yt will be chosen, which is further from the boundaries. Then step 8 will be repeated.) 9) Convert the YUV signals back into RGB signals using the inverse of the transformation above in step 3. (The inverse transformation exists because the matrix is invertible.)

18

Digital Steganography

Fig. J.3. Simple stego-table with k = 20, where k is the width of each region.

Finally, we can simply save the image using the default JPEG encoder for Java called javax.imageio.plugins.jpeg. A block diagram for the combined processes is shown in Fig. J.4.

Fig. J.4. JPEG/JFIF encoding scheme for Steganography To make it more difficult to detect the presence of embedded data, the bit-values along the top of the stego-table will actually be randomized as shown in Fig. J.5. The randomization of the location of the 1s and 0s will simply cause a histogram of the resulting DC coefficients to look more random. If the values were simply pseudorandom, then it would be possible to get multiple consecutive 0s or 1s, so 0s will simply be expanded into 01s and 1s expanded into 10s. So that the same bits will be used for decoding, these k random bits that are dependent on the key will be received from the StegoSecurity object, where k will be empirically

19

Digital Steganography

determined such to criteria that will be mentioned later. Therefore, no DC coefficients will be changed by more than 3k/2 before compression.

5.2.2 Decoding
The decoding scheme is much simpler than encoding. The averages of the luminance of the 8x8 blocks just need to be calculated and converted back to bits while paying attention to the current stego-table and encoding order.

Proof of JPEG Concept


MATLAB was used to implement a simplified version of the algorithm explained above. 4096 random bits were hidden in lena.jpg using the following settings. The compression quality is maximum, and a relatively large number of regions in the stego-table z floor(255/k) are used.

20

Digital Steganography

z: # of entries in the stego-table 81 Input Image

Compression Quality 100 DC Coefficients Before Steno

DC Coefficients After Steno

Output Image

21

Digital Steganography

The bit error rate (BER) is goodthat is, all of the bits were extracted properly. The signal-to-noise ratio (SNR) seems fairly good, even though it is also limited due to JPEG compression, while the size of the resulting JPEG file is rather large. Most importantly, the output image looks just like the input image when compared by the human eye. For more examples, see Appendix A: JPEG Examples and Parameters.

5.3 GIF STEGANOGRAPHY ANDALGORYTHMS


GIF Format
GIF (graphics interchange format) files have become very widely used on the Internet. GIF became popular because it used Lempel-Ziv-Welch (LZW)6 data compression, thus, fairly large images could therefore be downloaded in a reasonable amount of time, even with very slow modems. An image is structured as a grid of cells, called pixels (picture elements). Each pixel has a color, which is represented in GIF as RGB-triple. Each color component is 8-bit long, so there are 2^(3*8) = 2^24, or about 16.7 million possible colors. This would quickly increase file size, so GIF uses compression. The first kind of compression that GIF uses is called a colormap. Instead of allowing the image to contain all 16 million colors, GIF restricts the image to a maximum of, say, any 256 out of the 16 million (the number of colors in the colormap can be varied). Thus, while there is no loss of richness of possible colors, no more than 256 distinct colors can be used simultaneously. The second kind of compression that GIF includes is a sophisticated variation of run-length coding of mentioned LZW.

Simple Encoding and Decoding Algorithm


Based on these alternatives, we chose to embed the data into the pixels. Here we present an algorithm used by EZ Stego. The colormap is first sorted by luminance, so that neighboring palette entries are near to each other in the color space. We run the following algorithm for each pixel that is selected for embedding by the bit placement module.

22

Digital Steganography

5.4. Encoding
1) Find the index of the pixel's RGB color in the sorted palette. 2) Get one bit from the input file. Replace the least significant bit of the index. 3) Find the new RGB color that the index now points to in the sorted palette. 4) Find the index of the new RGB color in the original palette. 5) Change the pixel to the index of the new RGB color. Decoding the least significant bit of the index came from the input file. Write it to the output file optional interlaced.

Sample Images
The EZ Stego solution works with varying degree of success, depending on the input image. To illustrate how one image can be a better input than another, here are shown two images with their respective luminance-ordered palettes. Figures 1 and 2 show the image Fox and its palette; Figures 3 and 4 show image Madrill and its palette. Both Fox, with 240x320 pixels, and Madrill, with 512x512 pixels were truncated to 256 colors. We can clearly see that the luminanceordered palette of Fox contains visibly fewer and less severe discontinuities in color than that of Madrill. Therefore, if EZ Stego would be used in this case, there would be a much greater chance of failure with Madrill than with Fox.

23

Digital Steganography

Analysis:
During the process of mapping 3-dimensional RGB colors to one-dimensional luminance rendered colormap, this may lead to visible color discontinuity among the colors that have same luminance yet so far away in the color spectrum. Since luminance is mere sum of three RGB values, luminance ordering does not guarantee the visibly similarity.

Improvement over Simple Algorithm


For each pixel to contain the data, the set of the closest colors is calculated. This is done by calculating the Euclidian distance between the color of the pixel from each colormap entry and sorting the result. The distance between colors (R1, G1, B1) and (R2, G2, B2) is (R R G G B B2)2

For each data bit to be embedded, we know the pixel where it will be embedded. We first have to check whether embedding the data will actually change the LSB. In the best case, it will not be changed, so we will not have to do anything. Otherwise, we start to search for the closest color till we find a match between the bit to be encoded and the parity of the color. The parity of the color is defined as R+G+B mod 2. Once the color is found, the index for the pixel is changed to point to the new color. Since this match making step has to be repeated for each bit modification. GIFStegoImage will perform a batch job of creating NeighborMap[]. Based on the LSB of the colormap index, NeighborMap[] will contain closest matching color that has different LSB. Thus GIFStegoImage only need to reference NeighborMap[] for each replacement.

Description of the following flowchart:


1. GUI passes BufferedImage to GIFStegoImage. 2. In GIFStegoImage, pixelmap is formed by extracting each int rgb value in corresponding index in the 2 dimensional array called pixelmap[][].

24

Digital Steganography

3. From the pixelmap[][], colormap is generated by passing through and adding countered new colors to colormap[]. 4. Extracting and applying each red, green and blue color to Euclidean distance formula to find matching color that has different least significant bit of colormap indexes and store them to neighormap[]. 5. Using colormap[],neighormap[], and pixelmap[][] to write out a file in GIF 89a standard format.

25

Digital Steganography

Chapter 6 PLATFORM DETAILS


About java
Now-a-days all are familiar with Internet, the worldwide network of computers, which connects together thousands of computer all over the world. These network connections are increasing day by day in a rapid rate, so the network traffic is increasing at a pulse rate. Computers connected to the net are from many different manufacturers, running on different operating systems and they differ in architecture, computing power and capacity. By considering this point SUN Microsystems Corporation felt the need for a new programming language suitable for this heterogeneous Environment and java was the solution. This breaks barriers between different computers, chips and operating systems. Using java your application become compatible with all operating systems. FEATURES OF JAVA Simple Secure Portable Object oriented Robust Multithreaded

Simple:It is simple for professional programmer to learn & they can use it effectively. If we already know object oriented programming, then learning java is very easy. It inherits
26

Digital Steganography

syntax from c & object oriented features from c++, so if the user knows c\c++ then it will be a
easy way to do effective java programming.

Secure:As we know many people are effected by viral infection when they download an executable file or program. Rather than, virus programs we have Swing is a widget toolkit for Java. It is part of Sun Microsystems' Java Foundation Classes (JFC) an API for providing a graphical user interface (GUI) for Java programs.

Portable:As already we have discussed about compatibility of operating system, computers, chips. In Internet the programs have to be dynamically downloaded to all the various types of platforms. For this purpose java program will generate a byte code (which is not a

executable code). Byte code is a highly optimized set of instructions designed to be executed by java run system, which is called as JVM (Java Virtual Machine).

Object-Oriented:Java is purely object oriented. The object model in java is simple and easy to extend, while simple types, such as integers, are kept as high-performance non-objects.

Robust: The ability to create robust programs was given a high priority in the design of java. To gain reliability, java restricts you in a few key areas, to force you to find your mistakes

27

Digital Steganography

early in program development. At the same time, java frees you from having to worry about many of the most common causes of programming errors. Because java is a strictly typed language, it checks your code at Compile time. Java is robust for two reasons; they are Memory management & mishandled exceptional task in traditional programming environments. Swing is a widget toolkit for Java. It is part of Sun Microsystems' Java Foundation Classes (JFC) an API for providing a graphical user interface (GUI) for Java programs. Swing was developed to provide a more sophisticated set of GUI components than the earlier Abstract Window Toolkit. Swing provides a native look and feel that emulates the look and feel of several platforms, and also supports a pluggable look and feel that allows applications to have a look and feel unrelated to the underlying platform.

28

Digital Steganography

Chapter 7 Software Testing


What is Testing?
A process of executing a program with the explicit intention of finding errors, that is making the program fail. Software Testing: It is the process of testing the functionality and correctness of software by running it. Process of executing a program with the intent of finding an error. A good test case is one that has a high probability of finding an as yet undiscovered error. A successful test is one that uncovers an as yet undiscovered error. Software Testing is usually performed for one of two reasons: Defect detection Reliability estimation

7.1.1 Black Box Testing:


Applies to software systems or module, tests functionality in terms of inputs and outputs at interfaces. Test reveals if the software function is fully operational with reference to requirements specification.

7.1.2 White Box Testing:


Knowing the internal workings i.e., to test if all internal operations are performed according to program structures and data structures. To test if all internal components have been adequately exercised.

29

Digital Steganography

Software Testing Strategies


A strategy for software testing will begin in the following order: 1. Unit testing 2. Integration testing 3. Validation testing 4. System testing

7.2 TEST CASES FOR STEGANALYSIS


TEST CASE 1: Test case for ENCRYPTION When a user tries to select a not supported file an error message will be generated NOT A SUPPORTED FILE. TEST CASE 2: Test case for DECRYPTION When a user tries to select a non encrypted file an error message will be generated NOT A ENCRYPTED FILE. TEST CASE 3: Test case for KEY MISMATCH When a user enters a wrong key then for the security purpose the message generated is wrong key entered

30

Digital Steganography

Chapter 8 OUTPUT SCREENS


INITIAL PAGE

ENCRYPTION:
SELECT SOURCE FILE

31

Digital Steganography

ENCRYPTION:
SELECT SOURCE FILE AND ENTER THE MESSAGE

32

Digital Steganography

ENTER KEY: SELECT NEXT OPTION AND ENTER THE KEY.

33

Digital Steganography

SAVE: CLICK ON THE SAVE BUTTON TO ENCRYT THE IMAGE FILE.

34

Digital Steganography

DECRYPTION: SELECT THE ENCRYPTED IMAGE AND ENTER THE KEY

35

Digital Steganography

Chapter 9 Conclusion And Future Extensions

Steganography as whole has existed in many forms throughout much of history. Loseless compression of images with a great deal of color variation work best as a cover image to embed a message. Steganography can be used as a benefictial tool for privacy. If the image has significantly fewer colors than 256, the change of the pixels colors may be visibly detectable. There are a few things that can be done regarding this issue. Adding more colors to the colormap. Based on the colors already in the colormap, plus on the pixels chosen to contain data, we can decide what colors are needed more than others, and add those colors to the colormap. This complicates things because we have to create a histogram showing which colors are needed more than others.

Substituting colors from the colormap as needed. Based on the pixels chosen to contain data, we can determine that some colors are under-represented in the colormap, and that may impair the visual similarity of the resulting image. If some other group of similar colors is well-represented, and visual similarity will not be impaired by decreasing the size of that group, we may choose to do so. Then, we will add the more needed colors. This option also complicates our task, since we will have to calculate the statistics of how much one color is needed compared to another.

- Analyzing the neighboring pixels. We may want to look at the colors of the neighboring pixels, before changing the value of a given pixel. This may be useful in the areas of uniform color. - Possible addition of noise or randomness in adding colors to colormap - Adding a color assurance by checking the mean distance. If the distance exceeds the predetermined limit, different remedying method can be applied.

36

Digital Steganography

Chapter 9 REFERENCES

JAVA COMPLETE REFERENCE

------------ PETERICKNAUGHTON

PROGRAMMING WITH JAVA

------------ BALAGURUSWAMY

SOFTWARE ENGINEERING

------------ ROGER S.PRESSMAN

37

You might also like