FPGA IMPLEMENTATION OF LSB REPLACEMENTSTEGANOGRAPHY USING DWTM.Sathya1, S.Chitra2Assistant Professor, Prince Dr. K.Vasudevan College of Engineering and TechnologyABSTRACTAn enhancement of data protection systemfor secret communication using reserve roomin encrypted images based on texture analysiswith discrete wavelet is proposed here. Thewavelet will decompose the image into fourfrequency sub bands namely LL, LH, HL andHH. These coefficients are then utilized in theencoder for removing the redundancies. TheSelective embedding is utilized in this methodto determine host signal samples suitable fordata hiding. This approach uses the LeastSignificant Bits (LSB) insertion to hide datawithin encrypted image data. The binaryrepresentation of the hidden data is used tooverwrite the LSB of each byte within theencrypted image randomly. This methodproves to be more secure technique for secretdata communication with high quality factor.The simulation results indicate that theframework can be successfully utilized inImage data hiding applications. The designutilizes the Spartan III EDK FPGA of Xilinxand LSB steganography algorithm toperform the steganography steps.Index Terms: Steganalysis, adaptivesteganography, selection channel, JPEG,detection, security.1. INTRODUCTIONMaintaining the secrecy of digital informationwhen communicated over the Internet ispresently a challenge. Given the amount ofcheap computation power available and certainknown limitations of the encryption methods itis not too difficult to launch attacks on ciphertext.An ideal steganographic technique embedsmessage information into a carrier image withvirtually imperceptible modification of theimage. The objective of steganography is amethod of embedding a additional informationinto the digital contents, that is undetectable tolisteners. The idea behind the LSB algorithm isto insert the bits of the hidden message into theleast significant bits of the pixels.An example of such manipulations isinsertion of secret information which is oftenreferred to as information hiding. A successfulinsertion of a message into an image is moredifficult using color images than that ofgrayscale images. A successful informationhiding should result in the extraction of thehidden data from the image with high degree ofdata integrity. This project presents aninformation hiding technique that utilizes liftingschemes to effectively hide information in colorimages.2. BASIC CONCEPTSSteganographySteganography means to hide secret informationinto innocent data. Digital images are ideal forhiding secret information. An image containinga secret message is called a cover image. First,the difference of the cover image and the stegoimage should be visually unnoticeable. Theembedding itself should draw no extra attentionto the stego image so that no hackers would tryto extract the hidden message illegally. Second,the message hiding method should be reliable. Itis impossible for someone to extract the hiddenmessage if she/he does not have a specialextracting method and a proper secret key.Third, the maximum length of the secretmessage that can be hidden should be as long aspossible. “Steganography is the art of hidinginformation in ways that prevent the detection ofhidden messages”.FPGA DescriptionField Programmable Gate Arrays Popularlyknown as FPGAs is an alternative forimplementation of digital logic in systems.Image FormatDigital images are representations of twodimensional images using a binary format. Forthe purpose of this research, Portable NetworkGraphics (PNG) images are used that are of thetrue color image type. Each pixel in a true colorimage has a section for the red channel, thegreen channel, and the blue channel.Additionally, pixels in the PNG format mayspecify a fourth channel called the alpha channelwhich stores the transparency of the pixel. Eachchannel contains the same number of bits (bitdepth). A bit depth of 8 means that each channelof a pixel can contain a value in the range 0 to255. The usual bit depths are 8 and 16 with 8being the most common; however, other bitdepths are possible. For this research, a bit depthof 8 is used for all images. For true color PNGimages with a bit depth of 8, each pixel is storedusing four bytes. There are three bytes thatrepresent the color channels and one byte thatrepresents the alpha channel. The red channel isstored in the second byte in bit positions 16-23.The green channel is stored in the third byte inbit positions 8-15 and the blue channel is storedin the fourth byte in bit positions 0-7. Each ofthese channels has a possible value between 0and 255 with 0 being black and 255 being purered, pure green or pure blue depending on thechannel in which the value resides. All imagesin this research are single layer images meaningthat no composite image is used or create.Wavelet TransformWavelets are mathematical functions definedover a finite interval and having an averagevalue of zero that transform data into differentfrequency components, representing eachcomponent with a resolution matched to itsscale. The basic idea of the wavelet transform isto represent any arbitrary function as asuperposition of a set of such wavelets or basisfunctions. These basis functions or babywavelets are obtained from a single prototypewavelet called the mother wavelet, by dilationsor contractions (scaling) and translations (shifts).Discrete Wavelet TransformCalculating wavelet coefficients at everypossible scale is a fair amount of work, and itgenerates an awful lot of data. If the scales andpositions are chosen based on powers of two, theso-called dyadic scales and positions, thencalculating wavelet coefficients are efficient andjust as accurate. This is obtained from discretewavelet transform (DWT).Image Embedding ProcessLeast Significant Bit Insertion (LSB);Characters in the ASCII code can be representedusing 8 bits. The value of discrete coefficientscan be manipulated slightly without beingnoticed by visual inspection after the image isreconstructed using the manipulated liftingcoefficients. This research project is based onthe premise that the bits of ASCII 6 characterscan be included in lifting coefficients withoutresulting in a visible appearance. The ideabehind the LSB algorithm is to insert the bits ofthe hidden message into the least significant bitsof the pixels.Process of Adding a Message: The process ofadding a message to the pixels of an image is amulti-step process. In brief, an ASCII characterstream is split into two-bit pairs, a lifting schemeis applied to an image, the two-bit pairs isinserted into the image in either the trends ordetails in the lifting domain, and then the inverselifting process is applied to reconstruct theimage. The channels of the image pixels are splitinto separate arrays upon initialization. There isone array for each color channel. Then itcalculates the entropy and retrieves the text thathas been entered by user.Encoding the Message in the Image: Beforemanipulating the array of characters that is readin, a terminator is added to the end of the array.The terminator is three ‘*’ characters in a row.This terminator is used during the decodeprocess to signal the end of the message input bythe user in the encode process. The programthen splits the ASCII character stream into 4two-bit pairs per character. The two-bit pairs arecreated because the 2 LSBs of a pixel will bereplaced with these two-bit pairs. Since all thecharacters in the English alphabet are within thelower 127 ASCII characters, only 4 two-bit pairsare needed to represent each character. Thesetwo-bit pairs are stored in an array for latermanipulation. The lifting scheme is then appliedto the image down to the level specified by theuser. Since the image is split into three colorchannels, the discrete scheme must be appliedthree times, once for each color channel. Theprogram automatically adjusts the encodingaccording to the discrete decomposition level.Once the transformations are complete, the twobitpairs of the ASCII characters are then hiddenin the pixels of the processed image. The textoffset value of the color channel specified by theuser determines which bits are used to hide eachsubsequent two-bit pair of the ASCII character.Hiding the two-bit pair in the image isaccomplished by overwriting the two selectedbits of a pixel with the value of the two-bit pair.This is done by performing a bitwise ANDoperation with 0 and the two bits of the pixel,which effectively sets the two bits to 0. Then thetwo-bit pair to be hidden in this pixel is thencombined with the pixel by a bitwise ORoperator, effectively setting these pixel bits tothe message bits.Decoding a Message from the Image:Decoding a message that is inserted into animage requires fewer steps than to encode. Theprocess flow starts out the same way asencoding with the user selecting the parametersthat were used to encode the message. At thispoint the program splits the image into its colorchannels and applies the inverse discrete schemeto each channel to the level specified by theuser. When the discrete transformation iscompleted, the program retrieves the messageout of the pixels of the cover image.3. EXPERIMENTAL RESULTSSteganography technique is implemented suchthat a key is given at the transmitter side and thesecret data can be obtained at the receiver byusing the same key. The Discrete WaveletTransform (DWT) will decompose the imageinto four frequency sub bands namely LL, LH,HL and HH. These coefficients are then utilizedin the encoder for removing the redundancies.The LL portion of the decomposed image ischosen for hiding the data because this portion issimilar to that of the input image. This approachuses the Least Significant Bits (LSB) insertionto hide data within encrypted image. LSBencoding is preferred to get a high clarity image.The binary representation of the hidden data isused to overwrite the LSB of each byte withinthe encrypted image randomly. Least significantbit replacement is effectively used for datahiding process. This method proves to be a moresecure technique for secret data communicationwith high quality factor. At the receiver sideInverse Discrete Wavelet Transform (IDWT)and LSB decoding technique is used to get thesecret data and the image separately. Thesimulation results indicate that the frameworkcan be successfully utilized in Image data hidingapplications.3.1 Embedding ProcessFig.3.1 Embedding Process3.1.1.Input ImageIt represents the image in which the data hasto be hidden. An image is a two-dimensionalpicture, which has a similar appearance tosome subject usually a physical object or aperson. Image is a two-dimensional, such as aphotograph, screen display, and as well as athree-dimensional, such as a statue. They maybe captured by optical devices such ascameras, mirrors, lenses, telescopes,microscopes, etc. and natural objects andphenomena, such as the human eye or watersurfaces.Fig.3.2 Input ImageIn wider sense, images can also be renderedmanually, such as by drawing, painting,carving, rendered automatically by printing orcomputer graphics technology, or developed bya combination of methods, especially in apseudo- photograph.3.1.2 PreprocessingIn preprocessing, the image is resized to get acorrect size and also gray conversion takeplace here.Image resizingResize the image, this time specifying thedesired size of the output image. Pass imresizea vector that contains the number of rows andcolumns in the output image. If the specifiedsize does not produce the same aspect ratio asthe input image, the output image will bedistorted. If you specify one of the elements inthe vector as NaN, imresize calculates the valuefor that dimension to preserve the aspect ratioof the image. To perform the resizing requiredfor multi-resolution processingRead image into the workspace.x,map=imread(‘trees.tif’);Resize the image, specifying a scale factor.By default, imresize returns an optimizedcolor map with the resized indexed image.y,newmap=imresize(x,map,0.5);Display the original image and the resizedimage.FigureImshow(x,map);Title(‘original image’)FigureImshow(y,newmap);Title(‘resized image’)Fig.3.3 Image ResizingGray ConversionFig.3.4 Gray ConversionThe color image consists of primary colorssuch as red, green and blue. All these areconverted into gray scale with intensities from0 to 255. This can be done by taking theaverage of the three colors. Since its an RGBimage, so it means that you have to add rwith g with b and then divide it by 3 to getthe desired gray image.Discrete Wavelet TransformCalculating wavelet coefficients at everypossible scale is a fair amount of work, and itgenerates an awful lot of data. If the scales andpositions are chosen based on powers of two,the so-called dyadic scales and positions, thencalculating wavelet coefficients are efficientand just as accurate. This is obtained fromdiscrete wavelet transform (DWT).Figure 3.5 shows the example for DWTprocessFig.3.5 DWT ProcessLSB ENCODINGFig.3.6 Algorithm FlowExtraction ProcessFig.3.7 Extraction ProcessInput ImageInput image is an image in which the data isgoing to be hidden. Here we are taking a 256 x256 image. The input image is a color imagesuch that a RGB image. Figure 3.8(a) shows theinput image.Fig.3.8 (a)Input Image (b) Gray ScaleImageFig.3.9 (a)Decomposed Image (b) Stego Image4. CONCLUTIONSIn this a data hiding method by LSBsubstitution process is proposed. The imagequality of the stego-image can be greatlyimproved with low extra computationalcomplexity. Experimental result shows theeffectiveness of the proposed method. In theproposed algorithm, the number of steps arevery less. Thus, the computational complexityis reduced, so it is easy to be implementing inboth grayscale and color image. Benefited fromthe effective optimization, a good balancebetween the security and the image quality isachieved.REFERENCES1. R. Cogranne, J. Fridrich,and V. Sedighi,”Content adaptive pentary steganographyusing the multivariate generalized Gaussiancover model,” in Proceedings IS&T,Electronic Imaging, Media Watermarking,Security, and Forensics2016(A. Alattar andN. D. Memon, eds.), vol. 9409, (SanFrancisco, CA), February 8–12, 2015.2. T. Denemark, J. Fridrich, and V. Holub, ,”Universal distortion design forsteganography in an arbitrary domain,”EURASIP Journal on Information Security,Special Issue on Revised Selected Papers ofthe 1st ACM IH and MMS Workshop, vol.2014:1, 2014.3. J. Fridrich and V. Holub , “Designingsteganographic distortion using directionalfilters,” in Fourth IEEE InternationalWorkshop on Information Forensics andSecurity, (Tenerife, Spain), December 2–5,2012.4. J.Fridrich and V. Holub, “Low complexityfeatures for JPEG steganalysis usingundecimated DCT,” IEEE Transactions onInformation Forensics and Security, vol. 10,no. 2, pp. 219–228, 2015.5. J. Fridrich and V. Holub, “Phase-awareprojection model for steganalysis of JPEGimages,” in Proceedings IS&T,ElectronicImaging, Media Watermarking,Security, and Forensics 2016(A. Alattar andN. D. Memon, eds.), vol. 9409, (SanFrancisco, CA), February 8–12, 2015.6. L. Guo, J. Ni, and Y. Q. Shi, “Uniformembedding for efficient JPEGsteganography,” IEEE Transactions onInformation Forensics and Security,vol.9,no. 5, pp. 814–825, 2014.7. L. Guo, J. Ni, and Y. Q. Shi, “An efficientJPEG steganographic scheme using uniformembedding,” in FourthIEEEInternationalWorkshop on Information Forensics andSecurity,(Tenerife, Spain), pp. 169–174,December 2–5, 2012.8. J. Huang H. Li, W. Luo, and W. Tang,”Adaptive steganalysisagainst WOWembedding algorithm,” in 2nd ACM IH&MMSec. Workshop(A. Uhl, S. xxviiiKatzenbeisser, R. Kwitt, and A. Piva, eds.),(Salzburg, Austria), pp. 91–96, June 11–13,2014.9. J. Huang , B. Li, X. Li and X. Li M. Wang,”A new cost function for spatial imagesteganography,” in Proceedings IEEE,International Conference on ImageProcessing, ICIP, (Paris, France), October27–30, 2014.10. F. Liu, X. Luo, X. Song, C. Yang and Y.Zhang, “Steganalysis of adaptive JPEGsteganography using 2D Gabor filters,” in3rd ACM IH& MMSec. Workshop (P.Comesana, J. Fridrich, and A. Alattar, eds.),(Portland, Oregon), June 17–19, 2015.