An Improved Visual Cryptography Scheme for Secret Hiding by ijcsis

VIEWS: 1,233 PAGES: 13

									                                                           (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                             Vol. 9, No. 3, March 2011
                                 FOR SECRET HIDING
G.Prasanna Lakshmi
Computer Science,IBSAR

Dr. D.A.Chandulal
Professor and HOD, IBSAR
Computer Science

Dr.KTV Reddy)
Professor & Principal
Electronics & Telecommunications Dept.
Computer Science

          Abstract— Cryptography is the practice and study                                INTRODUCTION
of hiding information. Cryptography, then, not only protects
data from theft or alteration, but can also be used for user
authentication. There are, in general, three types of                   Image: 
cryptographic schemes typically used to accomplish these
goals: secret key (or symmetric) cryptography, public-key (or
asymmetric) cryptography, and hash functions. In all cases,                                A  digital image is a computer file that
the initial unencrypted data is referred to as plaintext. It is         contains graphical information instead of text or a program.
encrypted into ciphertext, which will in turn (usually) be              Pixels are the basic building blocks of all digital images.
decrypted into usable plaintext.                                        Pixels are small adjoining squares in a matrix across the length
          Visual Cryptography is a type of cryptography which           and width of your digital image. They are so small that you
encodes a number of images in the way that when the images              don’t see the actual pixels when the image is on your
on transparencies are stacked together, the hidden message              computer monitor.
appears without a trace of original images. The decryption is                    Pixels are monochromatic. Each pixel is a single solid
done directly by the human visual system with no special                color that is blended from some combination of the 3 primary
cryptographic calculations. This project presents a system              colors of Red, Green, and Blue. So, every pixel has a RED
which takes three pictures as an input and generates two                component, a GREEN component and BLUE component. The
images which correspond to two of the three input pictures.             physical dimensions of a digital image are measured in pixels
The third picture is reconstructed by printing the two output           and commonly called pixel or image resolution. Pixels are
images onto transparencies and stacking them together.                  scalable to different physical sizes on your computer monitor
          While the previous researches basically handle only           or on a photo print. However, all of the pixels in any particular
binary images, this project establishes the extended visual             digital image are the same size. Pixels as represented in a
cryptography scheme suitable for natural images. Generally,             printed photo become round slightly overlapping dots.
visual cryptography suffers from the deterioration of the image
quality. This project also describes the method to improve the
quality of the output images. The trade-off between the image
quality and the security are discussed and assessed by
observing the actual results of this method. Furthermore, the
optimization of the image quality is discussed.

Keywords- Visual Cryptography, Digital Image, Mat lab

                                                                                                   ISSN 1947-5500
                                                             (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                               Vol. 9, No. 3, March 2011
                                                                                        Images in MATLAB:

                                                                                   The basic data structure in MATLAB is the array, an
                                                                         ordered set of real or complex elements. This object is
                                                                         naturally suited to the representation of images, real-valued
                                                                         ordered sets of color or intensity data.
                                                                                   MATLAB stores most images as two-dimensional
                                                                         arrays (i.e., matrices), in which each element of the matrix
                                                                         corresponds to a single pixel in the displayed image. (Pixel is
                                                                         derived from picture element and usually denotes a single dot
                                                                         on a computer display.)
                                                                                   For example, an image composed of 200 rows and
                                                                         300 columns of different colored dots would be stored in
                                                                         MATLAB as a 200-by-300 matrix. Some images, such as
                                                                         color images, require a three-dimensional array, where the first
                                                                         plane in the third dimension represents the red pixel
                                                                         intensities, the second plane represents the green pixel
                                                                         intensities, and the third plane represents the blue pixel
                                                                         intensities. This convention makes working with images in
           Pixel Values: As shown in this bitonal image, each            MATLAB similar to working with any other type of matrix
pixel is assigned a tonal value, in this example 0 for black and         data, and makes the full power of MATLAB available for
                           1 for white.                                  image processing applications.
         PIXEL DIMENSIONS are the horizontal and                                        IMAGE REPRESENTATION
vertical measurements of an image expressed in pixels. The
pixel dimensions may be determined by multiplying both the
width and the height by the dpi. A digital camera will also               An image is stored as a matrix using standard Mat lab matrix
have pixel dimensions, expressed as the number of pixels                  conventions. There are four basic types of images supported
horizontally and vertically that define its resolution (e.g.,                                     by Mat lab:
2,048 by 3,072). Calculate the dpi achieved by dividing a
document's dimension into the corresponding pixel dimension                  1.   Binary images
against which it is aligned.
                                                                             2.   Intensity images

                                                                             3.   RGB images
                                                                             4.   Indexed images

                                                                                             Binary Images:

                                                                         In a binary image, each pixel assumes one of only two discrete
                                                                          values: 1 or 0. A binary image is stored as a logical array. By
                                                                         convention, this documentation uses the variable name BW to
                                                                                              refer to binary images.

                                                                           The following figure shows a binary image with a close-up
                              Fig: An 8" x 10" document that                           view of some of the pixel values.

is scanned at 300 dpi has the pixel dimensions of 2,400 pixels

        (8" x 300 dpi) by 3,000 pixels (10" x 300 dpi).

                                                                                                     ISSN 1947-5500
                                                              (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                                Vol. 9, No. 3, March 2011

            Fig: Pixel Values in a Binary Image

Grayscale Images:

          A grayscale image (also called gray-scale, gray scale,
                                                                          Fig: Pixel Values in a Grayscale Image Define Gray Levels
or gray-level) is a data matrix whose values represent
intensities within some range. MATLAB stores a grayscale
image as an individual matrix, with each element of the matrix
corresponding to one image pixel. By convention, this
                                                                            1)   Color Images:
documentation uses the variable name I to refer to grayscale
                                                                                    A color image is an image in which each pixel is
        The matrix can be of class uint8, uint16, int16, single,          specified by three values — one each for the red, blue, and
or double. While grayscale images are rarely saved with a                 green components of the pixel's color. MATLAB store color
color map, MATLAB uses a color map to display them.                       images as an m-by-n-by-3 data array that defines red, green,
                                                                          and blue color components for each individual pixel. Color
         For a matrix of class single or double, using the                images do not use a color map. The color of each pixel is
default grayscale color map, the intensity 0 represents black             determined by the combination of the red, green, and blue
and the intensity 1 represents white. For a matrix of type uint8,         intensities stored in each color plane at the pixel's location.
uint16, or int16, the intensity intmin (class (I)) represents
black and the intensity intmax (class (I)) represents white.                        Graphics file formats store color images as 24-bit
                                                                          images, where the red, green, and blue components are 8 bits
The figure below depicts a grayscale image of class double.               each. This yields a potential of 16 million colors. The
                                                                          precision with which a real-life image can be replicated has
                                                                          led to the commonly used term color image.

                                                                                   A color array can be of class uint8, uint16,
                                                                          single, or double. In a color array of class single or
                                                                          double, each color component is a value between 0 and 1. A
                                                                          pixel whose color components are (0, 0, 0) is displayed as
                                                                          black, and a pixel whose color components are (1, 1, 1) is
                                                                          displayed as white. The three color components for each pixel
                                                                          are stored along the third dimension of the data array. For
                                                                          example, the red, green, and blue color components
                                                                          of the pixel (10,5) are stored in RGB(10,5,1),
                                                                          RGB(10,5,2),            and       RGB(10,5,3),

                                                                                                     ISSN 1947-5500
                                                           (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                             Vol. 9, No. 3, March 2011
The following figure depicts a color image of class                     image pixel is determined by using the corresponding value of
                                                                        X as an index into map.
double.                                                                          A colormap is often stored with an indexed image
                                                                        and is automatically loaded with the image when you use the
                                                                        imread function. After you read the image and the color map
                                                                        into the MATLAB workspace as separate variables, you must
                                                                        keep track of the association between the image and color map.
                                                                        However, you are not limited to using the default color map--
                                                                        you can use any color map that you choose.

                                                                                  The relationship between the values in the image
                                                                        matrix and the color map depends on the class of the image
                                                                        matrix. If the image matrix is of class single or double, it
                                                                        normally contains integer values 1 through p, where p is the
                                                                        length of the color map. The value 1 points to the first row in
                                                                        the color map, the value 2 points to the second row, and so on.
                                                                        If the image matrix is of class logical, uint8 or uint16,
                                                                        the value 0 points to the first row in the color map, the value 1
                                                                        points to the second row, and so on.

                                                                        The following figure illustrates the structure of an indexed
                                                                        image. In the figure, the image matrix is of class double, so
                                                                        the value 5 points to the fifth row of the color map.

          Fig: Color Planes of a True color Image

  2)   Indexed Images:

          An indexed image consists of an array and a
colormap matrix. The pixel values in the array are direct                Fig: Pixel Values Index to Color map Entries in
indices into a colormap. By convention, this documentation
uses the variable name X to refer to the array and map to refer                               Indexed Images
to the colormap.

       The colormap matrix is an m-by-3 array of class
double containing floating-point values in the range [0, 1].
Each row of map specifies the red, green, and blue
components of a single color. An indexed image uses direct
mapping of pixel values to colormap values. The color of each

                                                                                                   ISSN 1947-5500
                                                            (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                              Vol. 9, No. 3, March 2011
Digital Image File Types:
The 5 most common digital image file types are as follows:

1. JPEG is a compressed file format that supports 24 bit color
(millions of colors). This is the best format for photographs to
be shown on the web or as email attachments. This is because
the color informational bits in the computer file are
compressed (reduced) and download times are minimized.
2. GIF is an uncompressed file format that supports only 256
distinct colors. Best used with web clip art and logo type
images. GIF is not suitable for photographs because of its                              Fig: The Pixel Coordinate System
limited color support.
                                                                                  For pixel coordinates, the first component r (the row)
3. TIFF is an uncompressed file format with 24 or 48 bit                 increases downward, while the second component c (the
color support. Uncompressed means that all of the color                  column) increases to the right. Pixel coordinates are integer
information from your scanner or digital camera for each                 values and range between 1 and the length of the row or
individual pixel is preserved when you save as TIFF. TIFF is             column.
the best format for saving digital images that you will want to
print. Tiff supports embedded file information, including exact                There is a one-to-one correspondence between pixel
color space, output profile information and EXIF data. There             coordinates and the coordinates MATLAB uses for matrix
is a lossless compression for TIFF called LZW. LZW is much               subscripting. This correspondence makes the relationship
like 'zipping' the image file because there is no quality loss.          between an image's data matrix and the way the image is
An LZW TIFF decompresses (opens) with all of the original                displayed easy to understand. For example, the data for the
pixel information unaltered.                                             pixel in the fifth row, second column is stored in the matrix
                                                                         element (5, 2). You use normal MATLAB matrix subscripting
4. BMP is a Windows (only) operating system uncompressed                 to access values of individual pixels.
file format that supports 24 bit color. BMP does not support
embedded information like EXIF, calibrated color space and
output profiles. Avoid using BMP for photographs because it
produces approximately the same file sizes as TIFF without
any of the advantages of TIFF.                                                  For example, the MATLAB code

5. Camera RAW is a lossless compressed file format that is                      I (2, 15)
proprietary for each digital camera manufacturer and model. A
camera RAW file contains the 'raw' data from the camera's                Returns the value of the pixel at row 2, column 15 of the
imaging sensor. Some image editing programs have their own               image I.
version of RAW too. However, camera RAW is the most                        4)   Spatial Coordinates:
common type of RAW file. The advantage of camera RAW is
that it contains the full range of color information from the
sensor. This means the RAW file contains 12 to 14 bits of                          In the pixel coordinate system, a pixel is treated as a
color information for each pixel. If you shoot JPEG, you only            discrete unit, uniquely identified by a single coordinate pair,
get 8 bits of color for each pixel. These extra color bits make          such as (5, 2). From this perspective, a location such as (5.3,
shooting camera RAW much like shooting negative film. You                2.2) is not meaningful.
have a little more latitude in setting your exposure and a
slightly wider dynamic range.                                                      At times, however, it is useful to think of a pixel as a
                                                                         square patch. From this perspective, a location such as (5.3,
Image Coordinate Systems:                                                2.2) is meaningful, and is distinct from (5, 2). In this spatial
                                                                         coordinate system, locations in an image are positions on a
 3) Pixel Coordinates                                                    plane, and they are described in terms of x and y (not r and c
          Generally, the most convenient method for                      as in the pixel coordinate system).
expressing locations in an image is to use pixel coordinates. In
this coordinate system, the image is treated as a grid of                The following figure illustrates the spatial coordinate system
discrete elements, ordered from top to bottom and left to right,         used for images. Notice that y increases downward.
as illustrated by the following figure.

                                                                                                     ISSN 1947-5500
                                                              (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                                Vol. 9, No. 3, March 2011
                                                                           into a matrix with M rows and N columns. The image
                                                                           quantization assigns to each continuous sample an integer
                                                                           value. The continuous range of the image function f(x,y) is
                                                                           split into K intervals. The finer the sampling (i.e., the larger M
                                                                           and N) and quantization (the larger K) the better the
                                                                           approximation of the continuous image function f(x,y).

                                                                                          IMAGE PRE-PROCESSING:
                                                                                Pre-processing is a common name for operations with
                                                                           images at the lowest level of abstraction -- both input and
                                                                           output are intensity images. These iconic images are of the
                                                                           same kind as the original data captured by the sensor, with an
         Fig: The Spatial Coordinate System                                intensity image usually represented by a matrix of image
                                                                           function values (brightness). The aim of pre-processing is an
                                                                           improvement of the image data that suppresses unwanted
                                                                           distortions or enhances some image features important for
                                                                           further processing. Four categories of image pre-processing
                                                                           methods according to the size of the pixel neighborhood that is
          This spatial coordinate system corresponds closely to            used for the calculation of new pixel brightness:
the pixel coordinate system in many ways. For example, the
spatial coordinates of the center point of any pixel are identical                       o   Pixel brightness transformations.
to the pixel coordinates for that pixel.
                                                                                         o   Geometric transformations.
          There are some important differences, however. In
pixel coordinates, the upper left corner of an image is (1,1),                           o   Pre-processing methods that use a local
while in spatial coordinates, this location by default is                                    neighborhood of the processed pixel.
(0.5,0.5). This difference is due to the pixel coordinate
                                                                                         o   Image restoration that requires knowledge
system's being discrete, while the spatial coordinate system is
                                                                                             about the entire image.
continuous. Also, the upper left corner is always (1,1) in pixel
coordinates, but you can specify a non default origin for the
spatial coordinate system.                                                 Image Segmentation:
          Another potentially confusing difference is largely a
matter of convention: the order of the horizontal and vertical                  Image segmentation is one of the most important steps
components is reversed in the notation for these two systems.              leading to the analysis of processed image data. Its main goal
As mentioned earlier, pixel coordinates are expressed as (r, c),           is to divide an image into parts that have a strong correlation
while spatial coordinates are expressed as (x, y). In the                  with objects or areas of the real world contained in the image.
reference pages, when the syntax for a function uses r and c, it           Two kinds of segmentation
refers to the pixel coordinate system. When the syntax uses x
and y, it refers to the spatial coordinate system.                             1.      Complete segmentation: This results in set of
                                                                                       disjoint regions uniquely corresponding with
Digital image processing:                                                              objects in the input image. Cooperation with
                                                                                       higher processing levels which use specific
         Digital image processing is the use of computer                               knowledge of the problem domain is necessary.
algorithms to perform image processing on digital images. As
a subfield of digital signal processing, digital image                         2.      Partial segmentation: in which regions do not
processing has many advantages over analog image                                       correspond directly with image objects. Image is
processing; it allows a much wider range of algorithms to be                           divided into separate regions that are
applied to the input data, and can avoid problems such as the                          homogeneous with respect to a chosen property
build-up of noise and signal distortion during processing.                             such as brightness, color, reflectivity, texture, etc.
                                                                                       In a complex scene, a set of possibly overlapping
                                                                                       homogeneous regions may result. The partially
                 IMAGE DIGITIZATION:                                                   segmented image must then be subjected to further
        An image captured by a sensor is expressed as a                                processing, and the final image segmentation may
continuous function f(x,y) of two co-ordinates in the plane.                           be found with the help of higher level information.
Image digitization means that the function f(x,y) is sampled

                                                                                                       ISSN 1947-5500
                                                           (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                             Vol. 9, No. 3, March 2011
Segmentation methods can be divided into three groups
according to the dominant features they employ                               Cryptography and steganography are well known and
                                                                        widely used techniques that manipulate information
             1.   First is global knowledge about an image or           (messages) in order to cipher or hide their existence. These
                  its part; the knowledge is usually                    techniques have many applications in computer science and
                  represented by a histogram of image                   other related fields: they are used to protect e-mail messages,
                  features.                                             credit card information, corporate data, etc. More specifically,
                                                                        steganography is the art and science of communicating in a
             2.   Edge-based segmentations form the second              way which hides the existence of the communication (Johnson
                  group; and                                            and Jajodia, 1998). A steganographic system thus embeds
                                                                        hidden content in unremarkable cover media so as not to
             3.   Region-based segmentations                            arouse an eavesdropper’s suspicion. As an example, it is
                                                                        possible to embed a text inside an image or an audio file. On
 II.   IMAGE ENHANCEMENT                                                the other hand, cryptography is the study of mathematical
                                                                        techniques related to aspects of information security such as
                                                                        confidentiality, data integrity, entity authentication, and data
         The aim of image enhancement is to improve the                 origin authentication. In this project we will focus only on
interpretability or perception of information in images for             confidentiality, i.e., the service used to keep the content of
human viewers, or to provide `better' input for other automated         information from all but those authorized to have it.
image processing techniques. Image enhancement techniques
can be divided into two broad categories:
1. Spatial domain methods, which operate directly on pixels,                 Cryptography protects information by transforming it into
and                                                                     an unreadable format. It is useful to achieve confidential
2. Frequency domain methods, which operate on the Fourier               transmission over a public network. The original text, or
transform of an image.                                                  plaintext, is converted into a coded equivalent called cipher
                                                                        text via an encryption algorithm. Only those who possess a
Unfortunately, there is no general theory for determining what          secret key can decipher (decrypt) the ciphertext into plaintext.
`good’ image enhancement is when it comes to human                      Cryptography systems can be broadly classified into
perception. If it looks good, it is good! However, when image           symmetric-key systems that use a single key (i.e., a password)
enhancement techniques are used as pre-processing tools for             that both the sender and the receiver have, and public-key
other image processing techniques, then quantitative measures           systems that use two keys, a public key known to everyone
can determine which techniques are most appropriate.                    and a private key that only the recipient of messages uses.
                                                                             The purpose of both is to provide secret communication.
                                                                        Cryptography hides the contents of the message from an
                                                                        attacker, but not the existence of the message.
              VISUAL CRYPTOGRAPHY                                       Steganography/watermarking even hide the very existence of
                                                                        the message in the communicating data. Consequently, the
                                                                        concept of breaking the system is different for cryptosystems
         Visual cryptography is a cryptographic technique               and stego systems (watermarking systems).
which allows visual information (pictures, text, etc.) to be
encrypted in such a way that the decryption can be performed                •    A cryptographic system is broken when the attacker
by the human visual system, without the aid of computers.                       can read the secrete message.
                                                                            •    Breaking of a steganographic/watermarking system
         Visual cryptography was pioneered by Moni Naor                         has two stages:
and Adi Shamir in 1994. They demonstrated a visual secret                       -         The      attacker     can    detect   that
sharing scheme, where an image was broken up into n shares              Steganography/watermarking has been used;
so that only someone with all n shares could decrypt the image,                 - The attacker is able to read, modify or remove the
while any n-1 shares revealed no information about the                  hidden message.
original image. Each share was printed on a separate
transparency, and decryption was performed by overlaying the                    A steganography/watermarking system is considered
shares. When all n shares were overlaid, the original image             as    insecure    already     if     the  detection    of
would appear.                                                           steganography/watermarking is possible.

Using a similar idea, transparencies can be used to implement
a one-time pad encryption, where one transparency is a shared
random pad, and another transparency acts as the cipher text
  Differences between Cryptography & Steganography:

                                                                                                   ISSN 1947-5500
                                                            (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                              Vol. 9, No. 3, March 2011
Extended Visual Cryptography:                                            visible when any k sheets of the n transparencies are put
                                                                         together, but any combination of less than k sheets cannot
                                                                         reveal the original binary image.
         Extended Visual Cryptography is a type of                                 In the scheme, one pixel of the original image is
cryptography which encodes a number of images in the way                 reproduced by m sub pixels on the sheets. The pixel is
that when the images on transparencies are stacked together,             considered “on” (transparent) if the number of transparent sub
the hidden message appears without a trace of original images.           pixels is more than a constant threshold, and “off” if the
The decryption is done directly by the human visual system               transparent sub pixels is less than a constant lower threshold,
with no special cryptographic calculations. Generally, visual            when the sheets are stacked together. The contrast α is the
cryptography suffers from the deterioration of the image                 difference between the on and off threshold number of
quality. This project also describes the method to improve the           transparent pixels. Ateniese et al. has extended the (k, n) VSSS
quality of the output images. The trade-off between the image            to general access structures where senders can specify all
quality and the security are discussed and assessed by                   qualified and forbidden subsets of n participants. Droste
observing the actual results of this method. Furthermore, the            considered the problem of sharing more than one secret image
optimization of the image quality is discussed.                          among a set of participants and proposed a method to
                                                                         reconstruct different images with different Combination of

Visual cryptography is a kind of cryptography that can be
decoded directly by the human visual system without any
special calculation for decryption. As shown in below figure,
our visual cryptography system takes three pictures as an input
and generates two images which correspond to two of the
three input pictures. The third picture is reconstructed by
printing the two output images onto transparencies and
stacking them together. This type of visual cryptography,
which reconstructs the image by stacking some meaningful
images together, is especially called Extended Visual
Cryptography. In this project, the pictures shown on the output
images are called sheets and the resulting image reconstructed
by stacking the two sheets together is called the target.
Previous works on the extended visual cryptography deal with
binary images such as text images, but natural images such as
photographs are difficult to handle in such scheme. This
project establishes the extended visual cryptography scheme
for natural images. Generally, visual cryptography suffers
from the deterioration of the image quality. This project also
describes the method to improve the quality of the output

               Visual Secret Sharing Scheme:
                                                                                       Extended Visual Cryptography:
         The basic model of the visual cryptography consists
of a several number of transparency sheets. On each                               Naor and Shamir have mentioned an extension of the
transparency a cipher text is printed which is indistinguishable         model which conceals the very existence of the secret
from random noise. The hidden message is reconstructed by                message. That is, each sheet carries some meaningful images
stacking a certain number of the transparencies and viewing              rather than random dots. They referred to the (2, 2) example
them. The system can be used by anyone without any                       with the number of sub pixels m = 4. Ateniese has formalized
knowledge of cryptography and without performing any                     this framework as the Extended Visual Cryptography and
cryptographic computations. Naor and Shamir have developed               developed a Scheme for general access structures
the Visual Secret Sharing Scheme (VSSS) to implement this                [Ateni01].They also discuss the trade-off between the contrast
model. In k out of n VSSS (which is also called (k, n) scheme),          of the each images on the sheets and that of the resulting
a binary image (picture or text) is transformed into n sheets of         image when stacked together in(k, k) cases.
transparencies of random images. The original image becomes

                                                                                                    ISSN 1947-5500
                                                             (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                               Vol. 9, No. 3, March 2011
Application to the Grayscale and Color                                          • Text data should be converted to image format (bmp)
                                                                                   before execution.

Images:                                                                         • Text data should be monochrome (Black letters)
                                                                                   ,color text leads to undesired results.
          A few researches have discussed the visual                            • Change the address of the image mentioned in this
cryptography for grayscale and color images. Naor and Shamir                       program as per your location in Local drive.
mentioned the extension of their scheme to grayscale images.
That is, to represent the gray levels of the hidden image by                    • No need to specify the dimension of the image.
controlling the way how the opaque sub pixels of the sheets
are stacked together. The grayscale version of the visual                                   Initialize the Input
cryptography is fundamentally proposed in the project. There
are some researches that deal with color images. Naor and                          In this part obtained the input (1 Color image + 6 Text
Shamir discussed the visual cryptography Scheme which                        images) from local drive. Collect all images as a separate
reconstructs a message with two colors, by arranging the                      variable. Change the location of the image mentioned in
colored or transparent sub pixels [Naor96]. Koga et al. devised                         imread () function as per your image.
a lattice-based (k, n) scheme [Koga98]. The approach by
Verheul and van Tilborg [E.R.V97] is basically similar to
Koga’s. Both approaches assign a color to a sub pixel at a
                                                                                      Part Two: Image Encoding
certain position, which means that displaying m colors uses                         In this part the desire text images (max 6 images) are
m−1 Sub pixels. The resulting pixels contain one colored sub              going to encoded with the Color image. At first pair of text
pixel and the rest of the sub pixels are black.                           images are combined into a single image. Simple logic is used
          Therefore the more colors are used; the worse the               to achieve this. Pixels are selected from alternate location of
contrast of the images becomes significantly. Their approaches            pair of text images. As a result of this, image having details
cannot be applied to the extended visual cryptography, either.            (but alternate locations) about pair of two text images. Further
Rijmen and Preneel talked about enabling multicolor with                  explained that if a location (n,m) have the pixel of Image 1
relatively less sub pixels (24 colors with m= 4) [Rijme96].               next location (n+1,m+1) have the pixel taken from Image 2.
However each sheet must contain color random images, which                This task is done by alterim() function. Two arguments of this
means applying this approach to the extended visual                       function are two text images.
cryptography is impossible. This project focuses on the (2, 2)
scheme and discusses the method to deal with the natural                            Next step is to encode the text image which was
images with intermediate gray levels. It also shows how to                already obtained from the result of alterim() function. We
enhance the contrast.                                                     obtained 3 single text images from this function. Each image
                 About this Program:                                      is encoded in each color frames R, G and B respectively. To
                                                                          do this I used a simple logic. i.e. encode the text image as a bit
          This program can encode the text images (6 images               of color image LSB. Because LSB bit is very less significant,
max) in a single color image. And also can easily recover the             so changing this bit won't affect the entire image. Further the
texts already being hided. It is very simple one, but very useful         text image is having only black and white area. So I fix a
Major advantage of this encoded image is like a original image            threshold as 128. If a pixel value of a text image is >128, LSB
as before encoding. The image has no visible changes. So no               of Color image is set as '1' otherwise '0'. Simply says if text is
one can easily read the hidden texts by sight. The decoding               present set that LSB as 1 otherwise 0. Similar way I do it for
logic only can recover the texts. Thus these special features of          other two color frames. All the above operations are
encoded image make it used to save the confidential data. Also            performed by imhide () function for each frame respectively.
can used for web applications, mail services, media etc.,.                Arguments of this function are a color frame and a text image
                                                                          obtained from alterim() function. Finally each frames are
                                                                          added to form a Encoded Water mark image.
                Tips to use program:
                                                                          NOTE: In bmp format each color frame bits are represented by
      • For better results images should be in 24-Bit bit map                       8-bits. We took the LSB of that 8-bit.
         (bmp) format.

      • Use larger size image (> 512 X 512)                                    Part Three: Recovery of Text image
      • Avoid small size Fonts.                                                   In this part two functions are used to recover the text
                                                                          image from Encoded image. First step is to extract the text
      • All images should be in the same size.                            image. Remember that text image encoded in the color image
                                                                          in each frame is the alternate combination of two images

                                                                                                      ISSN 1947-5500
                                                             (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                               Vol. 9, No. 3, March 2011
(Text). The function txtxtract () just extract the text image             BLAS libraries, embedding the state of the art in software for
which is the combination of two text images, not by separate.             matrix computation.
As we encode our data in LSB of each color frame that bit
alone sufficient to reconstruct our text image. So logical AND                  MATLAB has evolved over a period of years with input
operation is used to recover the LSB. Reverse operation of                from many users. In university environments, it is the standard
function imhide () is used to reconstruct the text. Next step is          instructional tool for introductory and advanced courses in
to separate the pair of two text images from the result of                mathematics, engineering, and science. In industry, MATLAB
function txtxtract (). Alternate selection used in previous               is the tool of choice for high-productivity research,
Encoding section is used again for all pair of images.                    development, and analysis.

            Part Four: Edge tappering                                           MATLAB features a family of add-on application-
                                                                          specific solutions called toolboxes. Very important to most
       This part is the final step in my program. The image               users of MATLAB, toolboxes allow you to learn and apply
obtained from previous step is not a tappered. So finally all             specialized technology. Toolboxes are comprehensive
text images are smoothen by using fspecial() function                     collections of MATLAB functions (M-files) that extend the
available in MATLAB.                                                      MATLAB environment to solve particular classes of problems.
                                                                          Areas in which toolboxes are available include signal
                                                                          processing, control systems, neural networks, fuzzy logic,
  INTRODUCTION TO MATLAB                                                  wavelets, simulation, and many others.

                                                                          The MATLAB System:
                                                                                   The MATLAB system consists of five main parts:
      MATLAB is a high-performance language for
technical computing. It integrates computation, visualization,            Development Environment:
and programming in an easy-to-use environment where
problems and solutions are expressed in familiar mathematical
notation. Typical uses include                                                    This is the set of tools and facilities that help you use
                                                                          MATLAB functions and files. Many of these tools are
    1.   Math and computation                                             graphical user interfaces. It includes the MATLAB desktop
                                                                          and Command Window, a command history, an editor and
    2.   Algorithm development                                            debugger, and browsers for viewing help, the workspace, files,
                                                                          and the search path.
    3.   Data acquisition

    4.   Modeling, simulation, and prototyping

    5.   Data analysis, exploration, and visualization
                                                                          The MATLAB Mathematical Function:
                                                                                This is a vast collection of computational algorithms
    6.   Scientific and engineering graphics
                                                                          ranging from elementary functions like sum, sine, cosine, and
    7.   Application development, including graphical user                complex arithmetic, to more sophisticated functions like
         interface building.                                              matrix inverse, matrix eigen values, Bessel functions, and fast
                                                                          Fourier transforms.
       MATLAB is an interactive system whose basic data
element is an array that does not require dimensioning. This
allows you to solve many technical computing problems,
especially those with matrix and vector formulations, in a
fraction of the time it would take to write a program in a scalar
non interactive language such as C or FORTRAN.
                                                                          The MATLAB Language:

                                                                                 This is a high-level matrix/array language with control
 The name MATLAB stands for matrix laboratory. MATLAB                     flow statements, functions, data structures, input/output, and
was originally written to provide easy access to matrix                   object-oriented programming features. It allows both
software developed by the LINPACK and EISPACK projects.                   "programming in the small" to rapidly create quick and dirty
Today, MATLAB engines incorporate the LAPACK and

                                                                                                     ISSN 1947-5500
                                                            (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                              Vol. 9, No. 3, March 2011
throw-away programs, and "programming in the large" to                   C:\MATLAB\Work, indicating that directory “work” is a
create complete large and complex application programs.                  subdirectory of the main directory “MATLAB”; WHICH IS
                                                                         INSTALLED IN DRIVE C. clicking on the arrow in the
Graphics:                                                                current directory window shows a list of recently used paths.
                                                                         Clicking on the button to the right of the window allows the
                                                                         user to change the current directory.
        MATLAB has extensive facilities for displaying
vectors and matrices as graphs, as well as annotating and                       MATLAB uses a search path to find M-files and other
printing these graphs. It includes high-level functions for two-         MATLAB related files, which are organize in directories in
dimensional and three-dimensional data visualization, image              the computer file system. Any file run in MATLAB must
processing, animation, and presentation graphics. It also                reside in the current directory or in a directory that is on search
includes low-level functions that allow you to fully customize           path. By default, the files supplied with MATLAB and math
the appearance of graphics as well as to build complete                  works toolboxes are included in the search path. The easiest
graphical user interfaces on your MATLAB applications.                   way to see which directories are on the search path. The
                                                                         easiest way to see which directories are soon the search paths,
The MATLAB Application Program Interface                                 or to add or modify a search path, is to select set path from the
                                                                         File menu the desktop, and then use the set path dialog box. It
                                                                         is good practice to add any commonly used directories to the
(API):                                                                   search path to avoid repeatedly having the change the current

       This is a library that allows you to write C and Fortran                The Command History Window contains a record of the
programs that interact with MATLAB. It includes facilities for           commands a user has entered in the command window,
calling routines from MATLAB (dynamic linking), calling                  including both current and previous MATLAB sessions.
MATLAB as a computational engine, and for reading and                    Previously entered MATLAB commands can be selected and
writing MAT-files.                                                       re-executed from the command history window by right
                                                                         clicking on a command or sequence of commands. This
MATLAB                                       WORKING                     action launches a menu from which to select various options in
                                                                         addition to executing the commands. This is useful to select
                                                                         various options in addition to executing the commands. This is
ENVIRONMENT:                                                             a useful feature when experimenting with various commands
                                                                         in a work session.

                                                                                Using the MATLAB Editor to create M-Files:
                                                                                The MATLAB editor is both a text editor specialized for
                                                                         creating M-files and a graphical MATLAB debugger. The
      Mat lab Desktop is the main Mat lab application                    editor can appear in a window by itself, or it can be a sub
window. The desktop contains five sub windows, the                       window in the desktop. M-files are denoted by the extension
command window, the workspace browser, the current                       .m, as in pixelup.m. The MATLAB editor window has
directory window, the command history window, and one or                 numerous pull-down menus for tasks such as saving, viewing,
more figure windows, which are shown only when the user                  and debugging files. Because it performs some simple checks
displays a graphic.                                                      and also uses color to differentiate between various elements
                                                                         of code, this text editor is recommended as the tool of choice
      The command window is where the user types                         for writing and editing M-functions. To open the editor, type
MATLAB commands and expressions at the prompt (>>) and                   edit at the prompt opens the M-file filename.m in an editor
where the output of those commands is displayed. MATLAB                  window, ready for editing. As noted earlier, the file must be in
defines the workspace as the set of variables that the user              the current directory, or in a directory in the search path.
creates in a work session. The workspace browser shows these
variables and some information about them. Double clicking                                        Getting Help:
on a variable in the workspace browser launches the Array
Editor, which can be used to obtain information and income
instances edit certain properties of the variable.                             The principal way to get help online is to use the
                                                                         MATLAB help browser, opened as a separate window either
     The current Directory tab above the workspace tab                   by clicking on the question mark symbol (?) on the desktop
shows the contents of the current directory, whose path is               toolbar, or by typing help browser at the prompt in the
shown in the current directory window. For example, in the               command window. The help Browser is a web browser
windows operating system the path might be as follows:                   integrated into the MATLAB desktop that displays a

                                                                                                     ISSN 1947-5500
                                                        (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                                          Vol. 9, No. 3, March 2011
Hypertext Markup Language(HTML) documents. The Help
Browser consists of two panes, the help navigator pane, used
to find information, and the display pane, used to view the
information. Self-explanatory tabs other than navigator pane
are used to perform a search.


                 Fig 1: Text to be encoded
                                                                             Fig 2: Color image before encoding

                                                                                             ISSN 1947-5500
                               (IJCSIS) International Journal of Computer Science and Information Security,
                                                                                 Vol. 9, No. 3, March 2011

                                                   This project proposed the extended visual
                                         cryptography scheme for natural images. Next it showed a
                                         method to improve the image quality of the output by
                                         enhancing the image contrast beyond the constraints given by
                                         the previous studies. The method enables the contrast
                                         enhancement by extending the concept of error and by
                                         performing half toning and encryption simultaneously. The
                                         trade-off between the image quality and the security are
                                         assessed by observing the actual results of this method.
                                         Furthermore, the optimization of the image quality at a given
                                         contrast is discussed. Under an assumption that the occurrence
                                         of the violations is stochastically even in the images, a CFR
                                         function is introduced for the image quality optimization. The
                                         validity of the assumption and the effect of image quality
                                         improvement are also verified with the experiments. Fig.4
                                         shows an example of the results created by proposed method.


                                         1. G. Ateniese, C. Blundo, A. de Santis, and D. Stinson.
                                         Visual cryptography for general access structures. Information
Fig 3: Extracted Text images             and Computation, 129(2):86–106, 1996.
                                         2. Giuseppe Ateniese, Carlo Blundo, Alfredo De Santis, and
                                         Douglas R. Stinson. Extended capabilities for visual
                                         cryptography. Theoretical Computer Science, 250:143–161,
                                         3. E.R.Verheul and H.C.A.van Tilborg. Constructions and
                                         properties of k out of n visual secret sharing schemes. Design
                                         Codes and Cryptography, 11(2):179–196, 1997.
                                         4. R.W. Floyd and L. Steinberg. An adaptive algorithm for
                                         spatial greyscale. Proc.SID, 17/2:75–77, 1975.
                                         [Gomes97] Jonas Gomes and Luiz Velho. Image Processing
                                         for Computer Graphics. Springer, 1997.
                                         5. [Hofme97] T. Hofmeister, M. Krause, and H.U.Simon.
                                         Contrast-optimal k out of n secret sharing schemes in visual
                                         cryptography. In COCCON ’97, Lecture Notes in Computer
                                         Science, volume 1276, pages 176–185, Berlin, 1997. Springer.
                                         6. [Koga98] Hiroki Koga and Hirosuke Yamamoto. Proposal
                                         of a lattice-based visual secret sharing scheme for color and
                                         gray-scale images. IEICE Transaction on Fundamentals, E81-
                                         A(6):1262–1269, June 1998.
                                         [Naor95] M. Naor and A. Shamir. Visual cryptography,
                                         advances in cryptology. Eurocrypt ’94 Proceeding LNCS,
                                         950:1–12, 1995.
                                         7. M. Naor and A. Shamir. Visual cryptography ii: Improving
                                         the contrast via the cover base. Theory of Cryptography
                                         Library, (96-07), 1996.
                                         8. V. Rijmen and B. Preneel. Efficient colour visual
                                         encryption or shared colors of benetton. presented at
                                         EUROCRYPT’          96    Rump       Session,    available  as

                                                                    ISSN 1947-5500

To top