17.4. HIDINGIMAGESINIMAGES
269
imagearrays.
It is s easy y to o extract t the watermark from the image. . Use e the mainas
program from chapter 8to subtractthe originalfromthe image with the
hiddenwatermark.
17.4 HidingImagesinImages
Steganographyenableshidinganimageinanotherimage.Amessageimage
hidesinacoverimage.Hidingaltersthecoverimage,butthealterationsare
tooslighttosee. The e processpermitsrecoveringthemessageimagelater,
andtherecoveredmessageimagematchestheoriginalexactly.
Thisispossiblebecauseimagescontaintoomuchinformation.Common
eight-bitgrayscaleimageshave256shadesofgray. Peoplecandistinguish
onlyabout40shadesofgray. Theextragrayshadesareuseless. Thesame
istrueforcolorimages. Images s thatuse24bits perpixelhave16million
possiblecolors|toomanytobeuseful.
Eight-bitgrayscaleimageshavemorebitsthatareneeded.Steganogra-
phyusestheunneededbitstohidethemessageimage.Steganographystores
thebitsfromthemessageimageintheleastsignicantbitsofthecoverim-
age.Noonecanseethedierenceinthealteredcoverimage,becausenoone
cantellthedierencebetweena212anda213.
Figure17.5showsanexampleofhowthreepixelsfromamessageimage
hideinacoverimage.Therstpartofthegureshowsthethreepixelsfrom
themessageimage. Thesecondpartofthegureshowsthreerowsofeight
pixelsfromthecoverimage.Thelastpartofthegureshowsthesamethree
rowsofeightpixelsafterthethreemessageimagepixelswerehidden. The
leastsignicantbitsofthecoverimageareholdingthemessageimagepixels.
The pixel99 from the cover image has bits 0110 0011. . To o hidethe 0
(the rstbit) requires clearingtheleastsignicant bitofthe rst pixelof
the cover image. . The e 90pixelremains 90because its least signicant bit
isalreadya0. Thenexttwobitsofthe e messageimagepixelare 1,soset
the leastsignicant bitofthenexttwopixelsin the coverimage. . The82
becomesan83,andthe89remainsan89. Thisprocess s continuesasevery
pixelinthecoverimagehasitsleastsignicantbitclearedorsetdepending
onthebitvaluesofapixelinthemessageimage.
There is an eight-to-one limitation in this s process. . Each h pixel in the
messageimagehaseightbits.Therefore,itneedsonebitfromeightdierent
How to convert pdf slides to powerpoint presentation - C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF in C#.net, ASP.NET MVC, WinForms, WPF
Online C# Tutorial for Creating PDF from Microsoft PowerPoint Presentation
convert pdf pages into powerpoint slides; how to convert pdf to powerpoint slides
How to convert pdf slides to powerpoint presentation - VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to PDF in vb.net, ASP.NET MVC, WinForms, WPF
VB.NET Tutorial for Export PDF file from Microsoft Office PowerPoint
pdf to powerpoint slide; copying image from pdf to powerpoint
270
CHAPTER17. STEGANOGRAPHY:HIDINGINFORMATION
Three pixels s from message e image
- 99
-103
-105
Three by y eight t pixels from cover r image
- 90- 82- - 88-115-148-155-126- 90-
-119-103- 80- 76- 99-131- - 91- - 43-
-164-120- 85- 63- 59- - 80-120- - 91-
Three by y eight t pixels from cover r image
after hiding g the e message in n the e image e pixels
- 90- 83- - 89-114-148-154-127- 91-
-118-103- 81- 76- 98-131- - 91- - 43-
-164-121- 85- 62- 59- - 80-120- - 91-
Figure17.5:HidingMessageImagePixelsinaCoverImage
VB.NET PowerPoint: Sort and Reorder PowerPoint Slides by Using VB.
clip art or screenshot to PowerPoint document slide large amount of robust PPT slides/pages editing powerful & profession imaging controls, PDF document, image
how to add pdf to powerpoint presentation; how to convert pdf to ppt for
VB.NET PowerPoint: Use PowerPoint SDK to Create, Load and Save PPT
Please refer to following API to create and define a new blank PowerPoint document with a user-defined presentation slides count.
how to add pdf to powerpoint; how to change pdf to powerpoint
17.4. HIDINGIMAGESINIMAGES
271
pixelsinthecoverimage. Thecoverimagemustbeeighttimeswiderthan
themessageimage.
Figures 17.6through 17.9illustrate hiding amessage imageina cover
image.Figure17.6isthemessageimageandFigure17.7istheoriginalcover
image. Figure e 17.8 is the cover image after hiding the message image in
it. Figures s 17.7 and 17.8 are indistinguishable by visualinspection. . The
dierence becomes apparent only when examining the pixelvalues like in
Figure 17.5. . Many y of the pixelvalues of Figure 17.8 are one-o those in
Figure17.7.
Figure17.6:TheCoverImage
Figure17.9showsthemessageimageafteruncoveringitfromFigure17.8.
Figures17.6and17.9areexactlyalike. Thehidinganduncoveringprocess
didnotalterthemessageimage.
Listing17.2showsthesourcecodethat producedFigures17.6through
17.9. Thelistingstartswiththemainprogramthatcallsthesubroutinesto
eitherhideoruncoveramessageimage. Thisinterpretsthecommandline,
ensurestheinputimagesexists,andcheckstheirdimensions.Thedimensions
arecritical.
Furtherdowninlisting17.2showsthesubroutineshide
imageandhide
pixels.
Thehide
imageroutinereadsthemessageandcoverimages,callsthehide
pixels
routine,andwritestheresulttothecoverimagele.Theh
counterloopruns
throughthewidthofthemessageimage. Themaincallingroutineensured
thatthecoverimageiseighttimeswiderthanthemessageimage.
Thehide
pixelsroutinedoesmostoftheworkinthehidingoperation.It
mustdeterminethevalueofeverybitinevery pixelinthemessageimage.
Itmustthensetorcleartheleastsignicantbitofeverypixelinthecover
imageaccordingly.Theroutineusestwomaskarraystodetermineandalter
VB.NET PowerPoint: Merge and Split PowerPoint Document(s) with PPT
of the split PPT document will contain slides/pages 1-4 code in VB.NET to finish PowerPoint document splitting If you want to see more PDF processing functions
convert pdf slides to powerpoint; convert pdf to ppt online
VB.NET PowerPoint: Add Image to PowerPoint Document Slide/Page
insert or delete any certain PowerPoint slide without methods to reorder current PPT slides in both powerful & profession imaging controls, PDF document, tiff
convert pdf into powerpoint online; add pdf to powerpoint presentation
272
CHAPTER17. STEGANOGRAPHY:HIDINGINFORMATION
Figure17.7:TheMessageImage
Figure17.8:TheCoverImagewiththeMessageImageHiddenInIt
VB.NET PowerPoint: How to Convert PowerPoint Document to TIFF in
by Microsoft and it is composed of individual slides. formats, such as JPEG, GIF and PDF, by using below is designed by our programmers to convert PPT document
create powerpoint from pdf; chart from pdf to powerpoint
17.4. HIDINGIMAGESINIMAGES
273
Figure17.9: TheUnhiddenMessageImage
274
CHAPTER17. STEGANOGRAPHY:HIDINGINFORMATION
bits. Theloopovericoversalltherowsofthemessageandcoverimages.
Oneachrow,theloopoverjexamineseachoftheeightbitsinthemessage
image’spixel. The e codethensets orclears theleastsignicant bit of the
correspondingpixelofthecoverimage.
The if(lsb) code is necessary because some images place the least sig-
nicant bit rst while others place it last (the old Intel l and Motorolabit
orderissue). Dependingonthebitorder,thesubroutineuseseithermask1
ormask2tosetorclearbits.
Listing17.2alsoshowsthesubroutinesuncover
imageanduncover
pixels.
These reverse e the hiding process, , so they y are similar r to o the e hiding. . The
uncover
imageroutinereadsthecoverimage,callsuncover
pixelsforevery
pixelintheimage,andwritestherecoveredmessageimagetodisk.
Theuncover
pixelsroutinedoesmostofthework. Itmustdetermineif
theleastsignicantbitofeachpixelinthecoverimageis1or0.Itthenuses
thesebitstobuilduptheeightbitsineverypixelinthemessageimage.The
loopoverirunsthrougheveryrowintheimages. Theloopoverjlooksat
eightpixelsinthemessageimage.Ifapixelisodd,itsleastsignicantbitis
1,sothecorrespondingbitinthecoverimagemustbesetusingthemask1
bit mask. . Clearingbits s isnotnecessarybecausethenew
messagevariable
wassetto0x00priortotheloopoverj.
17.5 Extensions
Thereareseveralextensionstotheconceptspresentedheresuchasincreasing
the storage eciency and hiding executableprogramsandtext inimages.
Themostobviouslimitationtotheimagehidingshownearlieristhecover
imagemustbeeighttimeswiderthanthemessageimage.Thismeansusing
anarrowmessageimage(Figure17.6)andawidecoverimage(Figure17.7).
This ratio can be reducedto three to one. . Instead d of using the least
signicant bit t ofthe cover r image, use e the two least signicant bits. . The
coverimagemaychangefromgrayshade128to131whenhidingthemessage
image. Peoplecannotseethat. . Theotherpartofincreasingeciencyisto
reducethemessageimagefromeight-bitpixelstosix-bitpixels.Thismeans
64shadesofgrayinsteadof256. Peoplecanonlysee40shadesofgray,so
64isplenty. Thesix-bitpixelsinthemessageimagearehiddenintwobits
inthecoverimage.Hencethethreetooneratio.Implementingthisscheme
wouldrequirechangesintheroutinesshowninlisting17.2.
17.6. CONCLUSIONS
275
Steganographyenableshidingexecutableprogramsinsideimages.Inthe
previousdiscussion,themessageimagewasaseriesofeight-bitvalues. An
executableprogramisalsoaseriesofeight-bitvalues. Theleastsignicant
bitsofthecoverimagecanholdthebitsoftheexecutableprogram.Thecover
imagemust containeight timesmore pixels thantheexecutablehasbytes
(fourtimesmorepixelsifyouusethetwoleastsignicantbitsasexplained
earlier).Uncoveringtheexecutableprogramfromthecoverimageisjustlike
uncoveringthemessageimage.
Inthesamemanner,thecoverimagecanhideatextle. Thetextle
is aseriesof eight-bit bytes. . The e least signicant bits in the cover image
canhidetheeight-bittextbytes.Thecoverimagemustcontaineighttimes
morepixels(orfourtimes)thanthetextmessage.Thisuseofsteganography
allowsyoutohideamessageinanimage,sendtheimagetoafriend(ftpor
website),andhavethemreadit.Thewholeworldcanseetheimagewithout
readingthemessageorevensuspectingamessageexists.
17.6 Conclusions
Steganographyworksasatechniquetohideinformationinplainsight.Wa-
termarksandcopyrightscanbeplacedonanimagetoprotecttherightsofits
ownerwithoutalteringtheappearanceoftheimage.Almostlikemagic,im-
ages,executableprograms,andtextmessagescanhideinimages.Thecover
imagedoesnot appearaltered. . People e look atthe coverimage andnever
suspectsomethingishidden.Yourinformationishiddeninplainsight.
17.7 Reference
17.1\ExploringSteganography:SeeingtheUnseen,"NeilF.Johnson,Sushil
Jajodia,Computer,February1998,pp. 26-34.,
http://patriot.net/
~
johnson/Steganography.
276
CHAPTER17. STEGANOGRAPHY:HIDINGINFORMATION
Chapter18
Command-LineProgramming
18.1 Introduction
This chapter willdiscuss using DOS .bat t les. . The e previous chapters all
includedstand-aloneapplicationprogramsthatappliedimageprocessingop-
eratorstoentireimageles. Thischapterwillshowhowtosequencethese
operatorsina.batleprogram.ThesameprinciplesapplytowritingUNIX
scripts. IdonotcoverUNIXscriptshere,butUNIXuserswillunderstand
howtoapplythesameideastothatnesystem.
18.2 BatchProgrammingwith.batFiles
Previouschaptersincludedprogramsthatprocessedentireimageles.These
programs were all l command-line e driven. . Command-line e programs s can be
diculttousebecauseyoumustremembertheobscurecommandsequence.
Asignicant advantageof command-line programs is the user cancall
themfroma.batle. Thisisgoodbecauseweoftenneedtoperformmore
thanoneoperationonanimage.Thereisusuallypre-processing,processing,
andpost-processingaswellasrepetitiveandcomparativeprocessing.
A.batorbatchleisaunformattedtextlecontainingDOScommands.
Batch program are run from the DOS prompt, and they calleach of the
commandstheycontains.
Batchleshavetwoadvantages.Therstistheysavetypinglongcom-
mandsoverandover. Thisisaphysicaladvantagethatappliestoallsitu-
ations. Thesecondadvantageisbatchlespermitperformingusefulimage
277
278
CHAPTER18. COMMAND-LINEPROGRAMMING
rem
This is s a a simple e .bat file
echo off
echo Hello o World
copy a.doc c b.doc
Figure18.1:A.batFile
processing. Abatchlecanperformthesameoperationonaseriesofim-
ages, perform m a series s of f similar operations on one e image, and d perform m a
longprocessingstringonanimage.Theexamplesbelowwillillustratethese
advantages.
18.3 Basicsof.batProgramming
Beforelaunchingintotheexamples,let’sreviewafewbasicsofDOSbatch
leprogramming. AlltextsonDOS,suchastheDOSmanual,discuss.bat
leprogramming.I’llcoverthefeaturesusedintheexamplesbelow.
Figure18.1showsabasic.batle. Therstlinebeginswithremandis
aremarkorcomment. Theremplacescommentsanywhereinthele. . The
secondlineturnsoallechoingordisplayingtothescreen.Withouttheecho
o,the.batwoulddisplayeverystatementastheyexecuted.Thethirdline
displays the words HelloWorldonthescreen. . Allechostatements s except
echoodisplaytexttothescreen.ThenallineistheDOScopycommand.
Itcopieslea.doctoleb.doc. Savingthisleas s rst.batandtypingthe
DOScommand:
rst
woulddisplaythemessageHelloWorldandcopylea.doctob.doc.
Figure18.2isthesameasFigure18.1exceptthelaststatement. Ituses
the%signtoallowreplaceableparametersonthecommandline.Savingthis
leassecond.batandtypingtheDOScommand:
seconda.docb.docc:
woulddisplay themessage Hello Worldand d copy y the le a.doctothele
c:b.doc. The.batlewouldreplace%1witha.doc(therstparameter),%2
withb.doc(thesecondparameter),and%3withc: (thethirdparameter).
Noticehow%3%2becomesc:b.doc. Youcanconcatenate%stomakepath
names.
Documents you may be interested
Documents you may be interested