A DWT Based Steganography Approach EE604 Term Paper Instructor: Prof. Sumana Gupta Group No. 1 Group Members Anirudh Kumar Agrawal, 11907098 Pratik Likhar, 11531 Radhika Ravi, 11553
ADWTBasedSteganographyApproach
EE604TermPaper
Instructor:Prof.SumanaGupta
GroupNo.1
GroupMembers
AnirudhKumarAgrawal,11907098
PratikLikhar,11531
RadhikaRavi,11553
Introduction
ImageSteganographyreferstohidingofdatainsideanimageinwhichthechangesshouldbeimperceptibletohumaneye.Acommonuseofsteganographyisinwatermarkingwhichisusedtopreventillegaldistributionofcontentbyhidingasignatureintheimageofthecopyright.Watermarkingtechniquesgenerallyhavefollowingfeatures:
1. Imperceptibility:Humaneyecannotdistinguishbetweenthewatermarkedandoriginalimage2. Security:Thewatermarkedimagecannotbecopied,deletedormodifiedbyananimusobserver3. Robustness:Thewatermarkstillcanbeextractedoutwithincertainacceptablequalityeventheimage
hasenduredsomesignalprocessingornoisesbeforeextraction4. Statistically Undetectable : It is extremely hard or impossible to detect watermark using statistical
methods5. BlindDetection:Theextractinghavenotaccesstotheoriginalimage
Themethodscanbebrokendownintotwomainbroadcategories:
1. Spatial Methods: the processing is applied on the image pixel values directly. This easy andcomputationallyfast,butisaffectedbysignalprocessingandnoises
2. FrequencyDomainMethods:thefirststepistotransformtheimagedataintofrequencydomain coefficients by some mathematicaltools (e.g. FFT, DCT, or DWT). Then, accordingto thedifferentdatacharacteristicsgeneratedbythesetransforms,embedthewatermarkintothecoefficientsin frequencydomain. After the watermarked coefficientsare transformed back to spatial domain,theentireembeddingprocedure is completed.Theadvantageof this typeofwatermarking isthehighability to face some signal processingor noises. However,methods of this type are computationallycomplexandhenceslower.
Algorithm
ThefrequencydomaintransformusedhereistheHaar-DWTwhichisappliedasfollowing
Step 1: At first, scan the pixels from left toright in horizontal direction. Then, perform the addition andsubtractionoperationsonneighboringpixels.Storethesumonthe leftandthedifferenceontheright.Thepixelsumsrepresentthe lowfrequencypart (denotedassymbolL)whilethepixeldifferencesrepresentthehighfrequencypartoftheoriginalimage(denotedassymbolH).Step2:Secondly,scanthepixelsfromtoptobottominverticaldirection.Performadditionandsubtractionoperationsonneighboringpixelsandthenstorethesumonthetopandthedifferenceonthebottom as illustrated in Figure 3. Repeat this operation until all thecolumns are processed. Finally wewillobtain4sub-bandsdenotedasLL,HL,LH,andHHrespectively.Therearemultiplemodesbasedontherelationbetweenimagesizesandthetexttobeembedded1.FixModeThereisafixembeddingcapacityrequirementn=MxNx(2/4)x4bits,followingstepsareusedtoachievethesameEmbeddingProcedureStep1:ApplyDiscreteWaveletTransform(DWT)onthegrayscale imageandobtainthefoursub-bands(LL,HL,LH,andHH)Step2:Combineeverytwobitstoformadecimalvaluerangingfrom0to3.EverytwodecimalvaluepairissubtractedtoformasequenceofvaluesStep3:TheembeddingprocessfollowstherasterscanordertheabsolutedifferencesvaluesInthiscase,weembed the absolutedifference values at two rightmost LSBs in LH andHL (LH sub-band first, thenHL sub-band)andthestatusvaluesatthoseinHHandfurthermore(thethirdone,andthefourthoneifneeded)LSBsinLHandHLsub-bands.BasedonFigure1,thecodingontherightTable isdesignedtorecordthepossiblesubtraction pairs. The codes underlined are embedded in the third or fourth LSBs in LH andHL sub-bandswhile the others are embedded in HH (and the first LSB for LH and the second for HL if needed). TheembeddingpositionsinHHarejustthosecorrespondingpositionsinLHandHL
Figure1Step4:AfterembeddingallthemessagebitsweobtainmodifiedDWTcoefficients,weperformIDWTonthestegoimageduetoLSBsubstitutionsomepixelsarenotintegersandwillresultinthefloatingpointvalues,akeymatrixwasusedtostorethe4possiblenon-integerssituations(0.0,0.25,0.50,0.75).Step5:TheroundedversionisthefinalimageFandthekeymatrixisstoredintheexample,the”Description”taginTIFFformatandthe“Comment”taginJPGformatExtractionProcedureStep1:ExtractthekeyMatrixfromthefiletagandtransformalltheelementsofKinto0.0,0.25,-0.5,-0.25toK’Step2:ObtainH’matrixbyperformingDWTtransformonE=F+K’Step3:Extracttheabsolutevalues(0,1,2and3)fromthe2rightmostLSBsinHHsub-band.Accordingtothevalueextracted,LSBsofcorrespondingpositionsinLHandHLareusedtodeterminethesubtractionpair.Baseon themapping rules defined in Figure 1, we can reconstruct 2 values (former and latter) of the decimalsequence.Cuethesedecimalvaluesincorrectorderandthenexpandthemtoabinarybitstream.2.VaryingMode
Invaryingmodenumberofembeddedbitsbelongstospecificrange
EmbeddingProcedure
Step1:ApplyDWTonthegrayscaleimageandobtainthefoursub-bandsLL,HL,LHandHH
Step2:Combineeverytwobitstoformadecimalvaluerangingfrom0to3.Everytwodecimalvaluepairissubtracted to forma sequenceof values. Thereareonly4possible absolute values (0, 1, 2, and3) for theelements in this differential sequence. Record these absolute values in HH by substituting the 2 LSBs ofcoefficientsinHHHwith00,01,10,and11respectively.However,sameabsolutevaluemightbeconsequenceofdifferentsubtractionpairs.Hence,weneedmorebitstodistinguishthesubtractionstatus.InFigure1,therightTablecodingisdesignedtorecordthepossiblesubtractionpairs.ThecodesunderlinedareembeddedinLH and the others are embedded in HL. Embedding positions in HLH and HHL are just the correspondingpositionsinHH.
Step3:TheremainingbitsofSareembeddedatthoseunusedLSBsinLHandthenHLbitbybit.Forexample,ifthevalueembeddedinHHis1,wecannotembedanymoremessagebitatthecorrespondingpositionofLHbut1morebitatthecorrespondingpositioninLH.
Step4:Afterembeddingallmessagebits,weobtaintheslightlymodifiedcoefficientsmatrixH'.ByperformingtheinverseDWT(IDWT)onH',thestego-imageEisobtained.Nowweemploya“Keymatrix”-Ktorecordthe4possiblenon-integersituations(0.0,0.25,0.5and0.75).TheroundedpixelvaluesofEareusedtoshowthestego-image. In order to perfectly reconstruct the secret message bits, K is necessary in the extractingprocedure
Step5:TheroundedversionofE,denotedasF,isthenstoredinaspecificimagefileformatwhileKisfilledintheunusedtags(forexample,the”Description”taginTIFFformatorthe“Comment”taginJPGformat.
ExtractionProcedure
Step1:ExtractthekeyMatrixfromthefiletagandtransformalltheelementsofKinto0.0,0.25,-0.5,-0.25toK’
Step2:ObtainH’matrixbyperformingDWTtransformonE
Step3:Extracttheabsolutevalues(0,1,2and3)fromthe2rightmostLSBsinH'HHsub-band.Accordingtothevalueextracted,LSBsofcorrespondingpositionsinH'LHandH'HLareusedtodeterminethesubtractionpair.Basedonthemappingrulesdefined inTable1,wecanreconstruct2values (formerand latter)of thedecimalsequence.Cuethesedecimalvaluesincorrectorderandthenexpandthemtoabinarybitstream.
Step4:ByextractingsomemoresecondLSBsinH'LHandH'HLaccordingtotheruleillustratedinFigure14,weobtain the remainingportionofS.Cascade itwith thesequenceobtained in step3, thewholemessagebitstreamSiscompletelyextracted.
Results
FixedMode
Followingpicturesareobtainedwhenrunningthealgorithmforfixedmode
ThefollowingtableshowsthePSNRobtainedfordifferentimages
Images PSNR(dB)Lena 40.4420
Peppers 40.8364Barbara 40.4688Mandril 40.5798Boat 40.5428
VaryingMode
Followingpicturesareobtainedwhenrunningthealgorithmforvaryingmode
LENA
CASE1:n≤(3/4)MxN CASE2:(3/4)MxN≤n≤MxN CASE3:MxN≤n≤(9/8)MxN
MANDRIL
ThefollowingtableshowsthePSNRobtainedfordifferentimages
Images PSNR(dB) Case-1 Case-2 Case-3
Lena 49.2008 46.2553 44.2926Peppers 49.2477 46.1719 44.3210Mandril 49.0497 46.2782 44.4409Barbara 49.0302 46.1832 44.3737
LivingRoom 49.0077 46.2201 44.4061
Tothechecktherobustnessofthealgorithmwithfixedmodecaseunderexternalattacks,wetriedthefollowingcases
1. Noise
Noisecanbeaddedtotheimagewhiletransmission,weusedAdditiveGaussianNoiseforsimulatingthefactorbasedonwhichfollowingresultswereobtained
Image ErrorLena 60.56%Mandril 60.55%Barbara 60.58%
Table1:ErrorwithGaussianNoise(sigma=2)
Image ErrorLena 69.55%Mandril 69.54%Barbara 69.54%
Table2:ErrorwithGaussianNoise(sigma=5)
Thuswecanseethattheproceduredoesnotfarewellunderadditionofnoise
2. RotationTheimagemightberotatedbysomeangletheta,forsimplicityweassumethattheimagewhenreceivedwasrotatedbyanangleof90degrees.Thus,afterrotatingtheimageby-90degreesweruntheextractionalgorithmonceagain,theresultsarerecordedintable3.
Image ErrorLena 0.29%Mandril 0.29%Barbara 0.29%
Table3:Errorwithrotationofimageby90degrees
Image ErrorLena 73.78%Mandril 73.56%Barbara 73.45%
Table4:Errorwithrotationangleoftheimage63degrees
Aboveresultsleadustobelieveiftheangleofrotationisanintegermultipleof90degreeswecanextractthemessagereasonably,butinothercaseswefailtodoso.
Discussion
Haar Transform was chosen because of the computational simplicity and the fact that we can accuratelyreproducethemessageusingthekeymatrixwhichwouldhavebeendifficultusingothertransform.Alsonotethat the LH represents horizontal edges, HL represents vertical edges and HH sub-band represents thediagonal edges. Hence the good performance of the algorithm can be attributed to the fact that is onlychangesthevaluesoftheedges.
In terms of the capacity of the givenmethod for an image of size 256 x 256we are able to embedded amessageofsize256*256*(2/4)*4=131072bitsusing256*256*(2/4)+256*256*(2/4)*4=163840bits in the image, while the total no. of bits in the original image is 256*256*8 = 524288. The spacerequirementoftheprocessisnearly=0.3125.
Anoteonthesecurityissue,anobservercannotsuccessfullydecryptthemessagewithoutknowingthe‘KeyMatrix’andevenifthepersonknowthekeymatrixhealsoneedstoknowthemappingruleswhichdifferfromcasetocase.Hencemakingthemethodsecure.
Conclusion
Theproposedsteganographytechniquewasimplementedanditscorrectnesswasverified.Furthertestsonthestabilityofthealgorithmunderexternalattacksgivetheconclusionthatthealgorithm