You are on page 1of 5

Image Steganography in DWT Domain using Double-stegging with RSA Encryption

Christu Jyothi Institute of Technology and Science


Team Members : D. Udayasree, G. Anusha, B. Kalpana, D. Akhilesh Internal Guide : Mrs. B. Arunalatha (Asst.prof)

The need for preserving secrecy of sensitive data has been ever-increasing with the new developments in digital communication. In this paper, we present an advanced method for embedding encrypted secret data in grayscale images to provide high level security of data for communication over unsecured channels. The proposed system combines the features of Cryptography and Steganography. Cryptography involves converting the secret message into a non-recognizable cipher. Steganography is then applied using Double-stegging to embed this encrypted data into a cover media and hides its existence.
Abstract
-

does not require the original cover image for successful extraction of the secret data.
I1.CRYPTOGRAPHY

Cryptography [1] is the art of protecting information by transforming it into an undetectable form. This undetectable form is called a "eipher text". Tt involves the usage of a "key" by which the encryption and decryption is done. The primary goal of Cryptography is to restrict the unauthorized access to the content of the transmitted data. In communication, cryptography plays an important role in data transfer through untrusted media. The basic requirements of a Cryptographic system are: a. Authentieation: The process of providing identity to the recipient.

Keywords Cryptography, Discrete Wavelet Transform, Doublestegging, RSA Algorithm.

1. INTRODUCTION

WATERMARKING andofSteganography arehiding.closely wo


related techniques information t The fundamental difference between the two is that former is a method used for copyright protection while the latter is a method of embedding secret data into a camouflage media so that unintended recipients will not have access to the data. Steganography not only hides the data, but also conceals the fact that a secret data is being transmitted. However, cryptography is different from steganography since a cipher text has meaningless form and the existence of a secret data is detectable by malicious attackers. Still, cryptography techniques can be executed on secret data before embedding into still image; to strengthen security level and also to suppress the energy compaction of secret data. This paper uses the concept of RSA algorithm for data encryption, where the data will be converted into a cipher, which will be then hidden into an image file. In order to enable large capacity of data and maintaining good visual quality of the cover image, the embedding is applied by modifYing the details coefficients in transform domain of Two-Dimensional Discrete Wavelet Transform (DWT). Furthermore, to enhance the security level of the data, the concept of Double-Stegging is used to embed the data into the image file. The greatest advantage of this system is that it

b. Privaey/Conjidentiality: Ensuring that the data is not


reaching any unintended recipient.

e. Tntegrity: Ensuring that the recipient is able to extract


the content of the decrypt the message in its original form. Non-repudiation: The process of ensuring that it is the actual sender who sends the message. The different types of cryptography used are: 1.

Seeret Key (Symmetrie) Cryptography: Tt uses a single


key far both encryption and decryption.

2.

Publie Key (Asymmetrie) Cryptography: Tt uses two keys; one for eneryption and one for deeryption. Hash Funetion (One-way) Cryptography: Tt uses mathematieal transformation so that the data is not retrievable.

3.

In this paper, we will use a Public Key Cryptography method using RSA Algorithm. III. RSA ALGORITHM RSA Algorithm [2], named after its developers (Ranald Rivest,Adi Shamir,and Leonard Adleman) uses variable size encryption blocks and variable size keys. Being a method of public key cryptography, it involves two keys, viz. a private key and a public key. The key-pairs are derived from a large integer which is the product of two prime numbers chosen as per some special rule.

Nadiya P V is a student of Master of Technology in Applied Electronics at ICET under MG University, Kerala, India (e-mail: pvnadiya!algmaiI.com). B Mohammed Imran is the Professor & Head of Computer Science & Engineering Dept. of ICET under MG University, Kerala, India (e-mail: abbabeta!algmail.com).

To create an RSA public/private key pair,the basic steps are: 1. Choose two prime numbers,'p' and 'q'. From these numbers you can calculate the modulus,n=pq. 2. Select a third number'e' that is relatively prime to the

Cover Image ---. Stego Image Secret Data

.......1.. . ...
Secret Key Estimate of Secret Data Communication Channel

product (p-l )(q-l ). The number 'e' is the public exponent. 3. Calculate an integer 'd' from the quotient (ed-l ) / [(p-l )(q-l )]. The number 'd' is the private exponent. The public key is the number pair (n , e). Although these values are publicly known,it is computationally infeasible to determine'd' from'n' and'e' if'p' and'q' are large enough. To encrypt a message,'M' with the public key,create the cipher text,'C' using the equation: C=Memod n The receiver then decrypts the cipher text with the private equation: M=Cdmod n Therefore the public encryption key is (e,n) and (d,n),the secret private decryption key. IV.
STEGANOGRAPHY

Stego System Decoder Fig. 1 Modern Stego-System

..............1

The various Steganography techniques used are:

A. Substitution Technique in Spatial Domain:


In this method, the least significant bit of the cover image (1) is modified with the data bits of the secret message. This leads to negligible changes to the cover image. But this key using the method is affected by the simplest attacks like compression or transform to the cover image. There are various such techniques used namely LSB,PVD and GLM.

(2)

i. Data Hiding by Least Significant Bit (LSB):


Steganography literally means covered writing" (from the Greek words stegano or "covered" and graphos or "to write"). The goal of steganography is to embed s secret data into a cover image in such a way that it will not be able to detect that a secret data exists in the image. The Steganographic [3], [6] system essentially needs a cover media which has redundant bits i.e., bits which can be modified without destroying the integrity of the media. The technique is to replace these redundant bits of the media with that of the secret data to be embedded. However as this method modifies the statistical properties of the media, it leaves behind detectable traces. A Steganographic system is characterized by three different parameters which are deeply interrelated, viz. capacity, security,and robustness. Capacity refers to the amount of data which can be reliably stored in the media, security is the inability of an intruder to extract the hidden data from the media and robustness is the amount of modifications that the stego-media can take without destroying the secret data.
V. STEGANOGRAPHY SYSTEM

One of the most common methods replaces the least significant bits (LSB) [8] of the cover image with the data bits. Tt yields a very high capacity, but is vulnerable to slightest manipulations like cropping.

ii. Data Hiding by Pixel Value DifJerencing (PVD):


This method partitions the cover image into nonoverlapping blocks containing two connecting pixels. Data is embedded by modifYing these differences. The extraction requires the original range table.
zu.

Data Hiding by Gray Level Modification (GLM):

GLM is a technique which does not embed or hide the data, rather to map data by modifYing the gray level values of the image pixels.

B. Transform Domain Technique:


The transform domain techniques make use of the transform coefficients to hide the data. The secret data is embedded by modifYing the transform coefficients of the image, which makes this technique more robust to attacks like compression, filtering etc. The different techniques used are DCT and DWT.

i. Discrete Cosine Transform (DCT):


This method uses JPEG compression algorithm to convert 8X8-pixel blocks in special domain to 64 DCT [7] coefficients. The least significant bits of these coefficients are modified to embed the secret data. Since the method works on frequency domain and not in special domain, it produces no noticeable changes in the visual appearance of the image. The disadvantage of this system is that it works only on JPEG files.

Modern day steganography system, as shown in Fig. 1 is detectable only with the help of secret information namely

"secret key".
Three basic types of stego-systems are available: a. Pure stego systems - no key is used. b. Secret-key stego systems - secret key is used. c. Public-key stego systems - public key is used.

ii. Discrete Wavelet Trans{orm (DWT):


The technique is to store the secret data in the least important coefficients of each 4X4 Haar transformed blocks. lt is a new idea which makes use of wavelets. The proposed system is based on this technique and will be explained in detail.
C.

parameter system is constructed such that one has a double sum and coefficient with two indices. The set of coefficients are called the DWT (Discrete Wavelet Transform) of the signal. Thus the signal is manipulated by analyzing these coefficients.

DWT ofan image: Spread Spectrum Technique:


The message is spread over a wide frequency bandwidth than the minimum required bandwidth to send the information. To obtain the DWT of the cover image,a filter pair called the Analysis Filter pair is used. First, the low pass filter is applied to each row of data in order to get the low frequency components of the row. Since the LPF is a half band filter,the output data needs to be sub-sampled by two,so that the output data now contains only half the original number of sampies. Next,the high pass filter is applied for the same row of data, and similarly the high pass components are separated, and placed by the side of the low pass components. This procedure is done for all rows. Again filtering is done for each column of the intermediate data. The resulting twodimensional array of coefficients contains four bands of data, each labeled as LL (Low-Low), HL (High-Low), LH (Low- High) and RH (High-High). The LL band can be decomposed once again in the same manner,thereby producing even more sub-bands. The process can be done upto any level that will result in a pyramidal decomposition as shown below.
II II Hl lH HH Hl II lH HH ll Hl Hl

D. Statistical Technique:
The cover is divided into blocks and the message bits are hidden in each block. The information is encoded by changing various numerical properties of cover image. The cover blocks remain unchanged if message block is zero.

E. Distortion Technique:
Information is stored by signal distortion. The encoder adds sequence of changes to the cover and the decoder checks for the various differences between the original cover and the distorted cover to recover the secret message. VI.
STEGANALYSIS

Steganalysis is the science of detecting hidden information. The objective of steganalysis is to retrieve the hidden information from the stego image. Most of the steganalysis algorithms compare the stego-image with the original cover image to retrieve the hidden data. The various methods of steganalysis are:

l
HH

II HH

lH lH HH HH lH lH

A. Visual Attacks:
In these types of attacks with a assistance of a computer or through inspection with a naked eye it reveal the presence of hidden information, which helps to separate the image into bit planes for further more analysis.

(a) Single Level

(b) Two Level

(c) Three Level

Fig. 2 Pyramidal Decomposition of Tmage

B. Statistical Attacks:
These types of attacks are more powerful and successful, because they reveal the smallest alterations in an images statistical behavior.
C.

Structural Attacks:
(b) After the one-Ievel 2-D Haar-DWT Fig. 3 DWT of an Image Coefficients obtained after the one level decomposition of image include an approximation and three detail transform coefficients. 1) 2) 3) 4) (a) Original image

The format of the data files changes as the data to be hidden is embedded; identifYing this characteristic structure changes can help us to find the presence of image. VII.
USE OF DISCRETE WAVELET TRANSFORM IN STEGANOGRAPHY

[6]

A Wavelet is simply, a small wave which has its energy concentrated in time to give a tool for the analysis of transient, non-stationary or time-varying phenomena. The wavelet transform method transforms the original signal using predefined wavelets by expressing the original signal as sum and product of coefficients and functions. A two-

Ar/(x, y) = <f(x, y) , fJ(x, y) Dvr/(x, y) = <f(x, y) ,


lfIv

>

(3)
>

r(x, y)

(4) (5) (6)

DHr/(x, y) = <f(x, y) , r(x, y) DTJr/(x, y) = <f(x, y) , 1/\ (x, y)

>

>

Vlll.PROPOSED METHOD The proposed method processes grey scale images as cover object far embedding encrypted secret data to provide high level security of data. The proposed system is a combination of cryptography and steganography where the encryption and embedding are done in two stages:

The second embedding process consists of comparing the modified coefficient cH' (eH' is the modified eoeffzeients o{ DWT detail area) with the other detail coefficient as: cV={CiJll 'Si'SMc,l 'Si'SNc} to obtain the modified CV denoted as CV'. After embedding all secret data and performing inverse DWT (lDWT) on CV', the stego image is obtained. The Stego-image with the secret message embedded is then ready for transmission. At the receivers end, the retrieving of the original secret message is done in two steps: (11)

Stage-I: Eneryption using RSA Algorithm


In the first public key in This produces keys and the converted into second stage. stage, the secret data is encrypted using the RSA algorithm (as explained in section-III). a cipher text along with the public encryption private decryption keys. This cipher text is 8-bit binary codes for further application in the

A. Extraetion Proeess:
The extraction process requires two stages of decoding in order to recover the original secret data. The first stage decoding is done to recover the first details coefficient (cH) from the second details coefficient (cV). The second stage decoding involves recovering the original secret data from the first details coefficient (cH). The criteria for extraction of the secret data is:

Stage-2: Embedding using Double Stegging


In this stage,the data in the binary form is embedded into the cover image and hides its existence. Tt utilizes transform coefficients of 2-Dimensional Discrete Wavelet Transform (2-DWT) by using Haar's [4] wavelet for embedding process. The elected cover image is decomposed by DWT transform. This transform provides one approximation and three detail coefficients (horizontal, vertical and diagonal) on each decomposition level. Generally, approximation coefficients are not suitable for embedding because they carry the most information content

Si j

0 IfC*ijmod 1=0

(12)

1 IfC*ij mod 1 '* 0

of the whole cover image. Therefore, the detail coefficients are the most convenient area for secret message embedding. The concept of Double-stegging [5] is applied to increase the security of the embedded data. This method consists of basically two steps: Step-l : Steganography is once applied to the cover image to embed the encrypted secret data (cipher text) to one area of the detail coefficients to obtain the stegoimage. Step-2: Steganography is applied again to embed that detail coefficient to another area of detail coefficient of the image. The coefficients suitable for first embedding are elected from detail areas (VL,DL,HL) and are denoted as CH = {C1j I 1'Si'SMc,1'Si'SNc} and the encrypted secret message as S = { Si I 1 'S i 'S n, Si = { 0 , I }} that is resized to same dimension as cH. The process of embedding consists of comparing the secret message Slj with detail coefficients C1j. The main criteria for embedding the secret data into the first details coefficient are:

The process consists of the simple modulo operation of stego image coefficients. The advantage of this method is that the original cover image does not have to be present on the receiver side for the successful reconstruction of the original data. Therefore, the risk of disclosure of secret communication is lower.

B. Deeryption:
This cipher text is decrypted by using the private key by RSA algorithm (as explained in section-TTT). One important requirement which has to be considered is the information capacity of the method. The distortion of cover object caused by embedding the secret data increases as the amount of data being embedded increases. Comparison of methods could be specified by payload in relation to PSNR value [dB]. IX. ANALYSIS AND RESULTS The program code is generated using MATLAB R2012a and the results are analyzed by studying the PSNR values for different payloads of input data for the secret message. For comparison study,the results are analyzed in three different modes with the same cover image: Mode-I:Data encryption using RSA Aigorithm and Embedding by Double-stegging.

lfSij==O

1 1

C'ij mod 1 '* 0 then C*ij = C'ij

(7)

lfSij==0 11 C'ij mod 1 = 0 then C*ij = sgn(C 'u).C'ijl-1/2) (8) lfSij==1 11 C'ij mod 1 '* 0 then C*ij = sgn(C).C'ijl-I/2) (9) lfSij==1 11 C'ij mod 1 = 0 then C*ij = C'ij Where, C*ij - modified eoeffieients ofDWT detail area.
(10)

Mode-2:Data encryption using RSA Aigorithm and Embedding data into TWO different sets of details
coefficients.

Mode-3: No data encryption applied and Embedding data into


THREE

different sets of details coefficients.

Results:
Sr. No. Secret Data Size (No. of chars) PSNR (dB) 50 100 500 1000 2000 1 2 3 4 5

78.13

78.13

78.00

72.33

69.73

tolerance. The capacity of the method remains the same and it is represented by 1/4 of cover image size far I-level decomposition of the cover image. The payload is 0.25 bit/pixel in case of using the maximum capacity and it also varies depending on numbers of detail coefficient are used during the embedding phase. The proposed algarithm employs I-Level decomposition of the image hence the total capacity (in bits) is represented by 1/4 of image size number of DWT detail coefficient,which are altered. From the results,Mode-l using Double Stegging with RSA encoding proves to be a much efficient method compared to the other two modes. Double Stegging has increased the data security compared to the other modes as only one coefficient carries the data and the embedding is done twice. Apart from the fact that an attack on the data in the first detailed coefficient is applied,Double stegging yields the best PSNR value, i.e., it can transmit secret data with a minimum distortion to the cover image. XI.
REFERENCES

Table.l Mode-I: RSA Algorithm with Double-stegging Sr. No. Secret Data Size (No. of chars) PSNR (dB) 1 2 3 4 5

50

100

500

1000

2000

73.51

70.41

63.16

60.43

57.80

Table.2 Mode-2: RSA Algorithm with two details coefficients Sr. No. Secret Data Size (No. of chars) PSNR (dB) 1 2 3 4 5

[1]. Whitfield Diffie and Martin E. Hellman, "New Directions in Cryptography", IEEE International Symposium on Information Theory on 1976, Ronneby, Sweden. [2]. Chandra M. Kota and Cherif Aissi1,"Implementation of the RSA algorithm and its cryptanalysis", ASEE GulfSouthwest Annual Conference on 2002,Houston,USA. [3]. Vladimfr BANOCI, Gabriel BUGAR,Dusan LEVICKY, "A Novel Method of Image Steganography in DWT Domain", Technical University of Kosice, Slovak Republic. [4]. Colm Mulcahy Ph. D, "Image Compression using Haar Wavelet Transform", Spelman Science and Math Journal,22-31. [5]. Sally Adee, "Spy vs. Spy", Http://Spectrum.Teee.Org/ ComputingjSoftware/Spy-vs-spy,IEEE Spectrum,2008. [6]. Ali Al-Ataby and Fawzi Al-Naima, "A Modified High

50

100

500

1000

2000

74.08

70.91

64.22

60.54

57.25

Table.3 Mode-3: No encryption with three details coefficients

I -+-Mode-I ---'-Mode-2 ---Mode-3 1 80 .------. 75

ii3' 70
2 65 ;z:

g :

60 55 50+-----.--.-- 50 100 500 1000 2000 Data Size(No. of chars)

Capacity Image Steganography Technique Based on Wavelet Transform", The International Arab Journal of Information Technology - IAHT ,Vol. 7, No. 4,Pg. 358364,2010. [7]. K B Shiva Kumar, "Bit Length Replacement Steganography Based On DCT Coefficients", International Journal of Engineering Science and Technology,Vol. 2(8),Pg: 3561-3570,2010. [8]. Mamta Juneja, Parvinder S. Sandhu, Ekta Walia, "Application of LSB Based Steganographic Technique for 8-bit Color Images", World Academy of Science, Engineering and Technology,2009.

Fig. 4 Plot of PSNR for different Modes


X.CONCLUSION

The proposed method posses with very good visual quality of the stego-image and also the algorithm allow variety in implementation to acquire desired robustness and fault

You might also like