Journal of Mobile, Embedded and Distributed Systems, vol. II, no. 1, 2010
with a totalof 40 bytes used presents the size of theinfo header zone, value 28 in hexadecimal;image dimensions represented by heightand width; number of planes; the colordepth given by the number of bits perpixel; compression, if there is any; totalimage size if compression was specified;horizontal and vertical resolution stored on8 bytes both; number of colors used; thenumber of important colors;
representedby the color table, is present only if thenumber of bits per pixel is less or equal to8;
the actual zonewhere useful information is stored.In figure 1 are presented the first 54 byteswhich are selected, meaning theinformation of both bitmap header andbitmap info header from a bitmap file withthe following attributes:
2 bytes, value
ASCI and 4D42h;
4 bytes, value0010B476h meaning 1.094.774 bytes;
4 bytes reserved;
4 bytes, value 36hmeaning that the actual image data willbegin after 54 bytes at the end of theselected zone;
info header size
4 bytes, value28h equivalent of 40 bytes;
4 bytes, value 26Ehmeaning 622 pixels;
4 bytes, value 1B8hmeaning 440 pixels;
and other useful information.Fig. 1 Hexadecimal view of a bitmapFor hiding a message in a bitmap file, apassword is needed representing theactual step at which parts of the messagewill be stored by modifying the pixelsfound in the image.The process of encrypting a message ispresented in the following algorithm:1.
message length calculation;2.
storing the length of the message,only 2
bytes meaning that the messageis limited by the maximum value stored in3 bytes, representing the RGB colors;3.
total number of pixels count,width*height
calculating the X and Y coordinatesbased on the value of the ASCI code of every byte read from the password codeand the dispersion component calculatedbased on the length of both message andpassword;5.
writing every byte of the messagestream along with a byte of the passwordcode read in reverse order at calculatedpositions.The application developed that implementsthis algorithm is briefly presented in thefollowing pictures.In figure 2, is represented the informationto hide,
with the keypassword
. The picture in which theencryption will take place is a BMP imageof 100x100 pixels, 32 bit representation.Fig. 2 Hidden informationThe process of hiding the message willtake every byte of the message and writeit to the image as follows:
the dispersion calculated for a streamlength of 28, 2 bytes for every character,and a length of the key password of 8bytes, is 8, meaning that every step atwhich a byte of the message will bewritten will be multiplied with thedispersion value;
the first character of the message,
,ASCI code 72, will be written after the first54 bytes along with S, the first characterin reverse order of the key password, at anoffset of 80*8, where 80 is the ASCII valueof the first character in the key password,