An Improved Visual Cryptography Scheme for Secret Hiding
Transcript of An Improved Visual Cryptography Scheme for Secret Hiding
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 1/13
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 3, March 2011
AN IMPROVED VISUAL CRYPTOGRAPHY SCHEME
FOR SECRET HIDING G.Prasanna Lakshmi
Computer Science,IBSAR
Karjat,India
Dr. D.A.Chandulal
Professor and HOD, IBSAR
Computer Science
India
Dr.KTV Reddy )
Professor & Principal
Electronics & Telecommunications Dept.
Computer Science
India
Abstract — Cryptography is the practice and study
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
cryptographic schemes typically used to accomplish these
goals: secret key (or symmetric) cryptography, public-key (or
asymmetric) cryptography, and hash functions. In all cases,
the initial unencrypted data is referred to as plaintext . It is
encrypted into ciphertext , which will in turn (usually) be
decrypted into usable plaintext.
Visual Cryptography is a type of cryptography which
encodes a number of images in the way that when the images
on transparencies are stacked together, the hidden messageappears without a trace of original images. The decryption is
done directly by the human visual system with no special
cryptographic calculations. This project presents a system
which 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.
While the previous researches basically handle only
binary images, this project establishes the extended visual
cryptography scheme suitable 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 images. The trade-off between the imagequality 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
INTRODUCTION
Image:
A digital image is a computer file that
contains graphical information instead of text or a program.
Pixels are the basic building blocks of all digital images.
Pixels are small adjoining squares in a matrix across the length
and width of your digital image. They are so small that you
don’t see the actual pixels when the image is on your
computer monitor.Pixels are monochromatic. Each pixel is a single solid
color that is blended from some combination of the 3 primary
colors of Red, Green, and Blue. So, every pixel has a RED
component, a GREEN component and BLUE component. The
physical dimensions of a digital image are measured in pixels
and commonly called pixel or image resolution. Pixels are
scalable to different physical sizes on your computer monitor
or on a photo print. However, all of the pixels in any particular
digital image are the same size. Pixels as represented in a
printed photo become round slightly overlapping dots.
185 http://sites.google.com/site/ijcsis/ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 2/13
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 3, March 2011
Pixel Values: As shown in this bitonal image, each
pixel is assigned a tonal value, in this example 0 for black and1 for white.
PIXEL DIMENSIONS are the horizontal and
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
have pixel dimensions, expressed as the number of pixels
horizontally and vertically that define its resolution (e.g.,
2,048 by 3,072). Calculate the dpi achieved by dividing a
document's dimension into the corresponding pixel dimension
against which it is aligned.
Example:
Fig: An 8" x 10" document that
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).
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-dimensionalarrays (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
MATLAB similar to working with any other type of matrix
data, and makes the full power of MATLAB available for
image processing applications.
IMAGE REPRESENTATION
An image is stored as a matrix using standard Mat lab matrix
conventions. There are four basic types of images supported
by Mat lab:
1. Binary images
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
view of some of the pixel values.
186 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 3/13
(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,
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
documentation uses the variable name I to refer to grayscale
images.
The matrix can be of class uint8, uint16, int16, single,
or double. While grayscale images are rarely saved with a
color map, MATLAB uses a color map to display them.
For a matrix of class single or double, using the
default grayscale color map, the intensity 0 represents black and the intensity 1 represents white. For a matrix of type uint8,
uint16, or int16, the intensity intmin (class (I)) represents
black and the intensity intmax (class (I)) represents white.
The figure below depicts a grayscale image of class double.
Fig: Pixel Values in a Grayscale Image Define Gray Levels
1) Color Images:
A color image is an image in which each pixel is
specified by three values — one each for the red, blue, and
green components of the pixel's color. MATLAB store color
images as an m-by-n-by-3 data array that defines red, green,
and blue color components for each individual pixel. Color
images do not use a color map. The color of each pixel is
determined by the combination of the red, green, and blueintensities stored in each color plane at the pixel's location.
Graphics file formats store color images as 24-bit
images, where the red, green, and blue components are 8 bits
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) isdisplayed 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),
respectively.
187 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 4/13
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 3, March 2011
The following figure depicts a color image of class
double.
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
indices into a colormap. By convention, this documentation
uses the variable name X to refer to the array and map to refer
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
image pixel is determined by using the corresponding value of
X as an index into map.
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 indexedimage. In the figure, the image matrix is of class double, so
the value 5 points to the fifth row of the color map.
Fig: Pixel Values Index to Color map Entries in
Indexed Images
188 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 5/13
(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 arecompressed (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
limited color support.
3. TIFF is an uncompressed file format with 24 or 48 bit
color support. Uncompressed means that all of the color
information from your scanner or digital camera for each
individual pixel is preserved when you save as TIFF. TIFF is
the best format for saving digital images that you will want to
print. Tiff supports embedded file information, including exact
color space, output profile information and EXIF data. Thereis a lossless compression for TIFF called LZW. LZW is much
like 'zipping' the image file because there is no quality loss.
An LZW TIFF decompresses (opens) with all of the original
pixel information unaltered.
4. BMP is a Windows (only) operating system uncompressed
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.
5. Camera RAW is a lossless compressed file format that is
proprietary for each digital camera manufacturer and model. A
camera RAW file contains the 'raw' data from the camera's
imaging sensor. Some image editing programs have their own
version of RAW too. However, camera RAW is the most
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
color information for each pixel. If you shoot JPEG, you only
get 8 bits of color for each pixel. These extra color bits make
shooting camera RAW much like shooting negative film. You
have a little more latitude in setting your exposure and a
slightly wider dynamic range.
Image Coordinate Systems:3) Pixel Coordinates
Generally, the most convenient method for
expressing locations in an image is to use pixel coordinates. In
this coordinate system, the image is treated as a grid of
discrete elements, ordered from top to bottom and left to right,
as illustrated by the following figure.
Fig: The Pixel Coordinate System
For pixel coordinates, the first component r (the row)
increases downward, while the second component c (the
column) increases to the right. Pixel coordinates are integer
values and range between 1 and the length of the row or
column.
There is a one-to-one correspondence between pixel
coordinates and the coordinates MATLAB uses for matrixsubscripting. This correspondence makes the relationship
between an image's data matrix and the way the image is
displayed easy to understand. For example, the data for the
pixel in the fifth row, second column is stored in the matrix
element (5, 2). You use normal MATLAB matrix subscripting
to access values of individual pixels.
For example, the MATLAB code
I (2, 15)
Returns the value of the pixel at row 2, column 15 of the
image I.
4) Spatial Coordinates:
In the pixel coordinate system, a pixel is treated as a
discrete unit, uniquely identified by a single coordinate pair,
such as (5, 2). From this perspective, a location such as (5.3,
2.2) is not meaningful.
At times, however, it is useful to think of a pixel as a
square patch. From this perspective, a location such as (5.3,
2.2) is meaningful, and is distinct from (5, 2). In this spatialcoordinate system, locations in an image are positions on a
plane, and they are described in terms of x and y (not r and c
as in the pixel coordinate system).
The following figure illustrates the spatial coordinate system
used for images. Notice that y increases downward.
189 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 6/13
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 3, March 2011
Fig: The Spatial Coordinate System
This spatial coordinate system corresponds closely to
the pixel coordinate system in many ways. For example, the
spatial coordinates of the center point of any pixel are identicalto the pixel coordinates for that pixel.
There are some important differences, however. In
pixel coordinates, the upper left corner of an image is (1,1),
while in spatial coordinates, this location by default is
(0.5,0.5). This difference is due to the pixel coordinate
system's being discrete, while the spatial coordinate system is
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.
Another potentially confusing difference is largely a
matter of convention: the order of the horizontal and verticalcomponents is reversed in the notation for these two systems.
As mentioned earlier, pixel coordinates are expressed as (r, c),
while spatial coordinates are expressed as (x, y). In the
reference pages, when the syntax for a function uses r and c, it
refers to the pixel coordinate system. When the syntax uses x
and y, it refers to the spatial coordinate system.
Digital image processing:
Digital image processing is the use of computer
algorithms to perform image processing on digital images. As
a subfield of digital signal processing, digital image
processing has many advantages over analog image
processing; it allows a much wider range of algorithms to be
applied to the input data, and can avoid problems such as the
build-up of noise and signal distortion during processing.
IMAGE DIGITIZATION:
An image captured by a sensor is expressed as a
continuous function f(x,y) of two co-ordinates in the plane.
Image digitization means that the function f(x,y) is sampled
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
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
used for the calculation of new pixel brightness:
o Pixel brightness transformations.
o Geometric transformations.
o Pre-processing methods that use a local
neighborhood of the processed pixel.
o Image restoration that requires knowledge
about the entire image.
Image Segmentation:
Image segmentation is one of the most important stepsleading to the analysis of processed image data. Its main goal
is to divide an image into parts that have a strong correlation
with objects or areas of the real world contained in the image.
Two kinds of segmentation
1. Complete segmentation: This results in set of
disjoint regions uniquely corresponding with
objects in the input image. Cooperation with
higher processing levels which use specific
knowledge of the problem domain is necessary.
2. Partial segmentation: in which regions do not
correspond directly with image objects. Image is
divided into separate regions that are
homogeneous with respect to a chosen property
such as brightness, color, reflectivity, texture, etc.
In a complex scene, a set of possibly overlapping
homogeneous regions may result. The partially
segmented image must then be subjected to further
processing, and the final image segmentation may
be found with the help of higher level information.
190 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 7/13
(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
1. First is global knowledge about an image or
its part; the knowledge is usually
represented by a histogram of image
features.
2. Edge-based segmentations form the secondgroup; and
3. Region-based segmentations
II. IMAGE ENHANCEMENT
The aim of image enhancement is to improve the
interpretability or perception of information in images for
human viewers, or to provide `better' input for other automated
image processing techniques. Image enhancement techniques
can be divided into two broad categories:
1. Spatial domain methods, which operate directly on pixels,and
2. Frequency domain methods, which operate on the Fourier
transform of an image.
Unfortunately, there is no general theory for determining what
`good’ image enhancement is when it comes to human
perception. If it looks good, it is good! However, when image
enhancement techniques are used as pre-processing tools for
other image processing techniques, then quantitative measures
can determine which techniques are most appropriate.
VISUAL CRYPTOGRAPHY
Visual cryptography is a cryptographic technique
which allows visual information (pictures, text, etc.) to be
encrypted in such a way that the decryption can be performed
by the human visual system, without the aid of computers.
Visual cryptography was pioneered by Moni Naor
and Adi Shamir in 1994. They demonstrated a visual secret
sharing scheme, where an image was broken up into n shares
so that only someone with all n shares could decrypt the image,
while any n-1 shares revealed no information about the
original image. Each share was printed on a separate
transparency, and decryption was performed by overlaying the
shares. When all n shares were overlaid, the original image
would appear.
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:
Cryptography and steganography are well known and
widely used techniques that manipulate information
(messages) in order to cipher or hide their existence. These
techniques have many applications in computer science and
other related fields: they are used to protect e-mail messages,
credit card information, corporate data, etc. More specifically,
steganography is the art and science of communicating in a
way which hides the existence of the communication (Johnsonand Jajodia, 1998). A steganographic system thus embeds
hidden content in unremarkable cover media so as not to
arouse an eavesdropper’s suspicion. As an example, it is
possible to embed a text inside an image or an audio file. On
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
origin authentication. In this project we will focus only on
confidentiality, i.e., the service used to keep the content of
information from all but those authorized to have it.
Cryptography protects information by transforming it intoan unreadable format. It is useful to achieve confidential
transmission over a public network. The original text, or
plaintext , is converted into a coded equivalent called cipher
text via an encryption algorithm. Only those who possess a
secret key can decipher (decrypt ) the ciphertext into plaintext.
Cryptography systems can be broadly classified into
symmetric-key systems that use a single key (i.e., a password )
that both the sender and the receiver have, and public-key
systems that use two keys, a public key known to everyone
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.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
and stego systems (watermarking systems).
• A cryptographic system is broken when the attacker
can read the secrete message.
• Breaking of a steganographic/watermarking system
has two stages:
- The attacker can detect that
Steganography/watermarking has been used;
- The attacker is able to read, modify or remove the
hidden message.
A steganography/watermarking system is considered
as insecure already if the detection of
steganography/watermarking is possible.
191 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 8/13
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 3, March 2011
Extended Visual Cryptography:
Extended Visual Cryptography is a type of
cryptography which encodes a number of images in the way
that when the images on transparencies are stacked together,
the hidden message appears without a trace of original images.
The decryption is done directly by the human visual system
with no special cryptographic calculations. Generally, visualcryptography 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.
INTRODUCTION
Visual cryptography is a kind of cryptography that can bedecoded 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
image.
Visual Secret Sharing Scheme:
The basic model of the visual cryptography consists
of a several number of transparency sheets. On each
transparency a cipher text is printed which is indistinguishable
from random noise. The hidden message is reconstructed bystacking a certain number of the transparencies and viewing
them. The system can be used by anyone without any
knowledge of cryptography and without performing any
cryptographic computations. Naor and Shamir have developed
the Visual Secret Sharing Scheme (VSSS) to implement this
model. In k out of n VSSS (which is also called (k, n) scheme),
a binary image (picture or text) is transformed into n sheets of
transparencies of random images. The original image becomes
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.
In the scheme, one pixel of the original image is
reproduced by m sub pixels on the sheets. The pixel is
considered “on” (transparent) if the number of transparent sub
pixels is more than a constant threshold, and “off” if the
transparent sub pixels is less than a constant lower threshold,
when the sheets are stacked together. The contrast α is thedifference between the on and off threshold number of
transparent pixels. Ateniese et al. has extended the (k, n) VSSS
to general access structures where senders can specify all
qualified and forbidden subsets of n participants. Droste
considered the problem of sharing more than one secret image
among a set of participants and proposed a method to
reconstruct different images with different Combination of
sheets.
Extended Visual Cryptography:
Naor and Shamir have mentioned an extension of the
model which conceals the very existence of the secret
message. That is, each sheet carries some meaningful imagesrather than random dots. They referred to the (2 , 2) example
with the number of sub pixels m = 4. Ateniese has formalized
this framework as the Extended Visual Cryptography and
developed a Scheme for general access structures
[Ateni01].They also discuss the trade-off between the contrast
of the each images on the sheets and that of the resulting
image when stacked together in(k, k ) cases.
192 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 9/13
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 3, March 2011
Application to the Grayscale and Color
Images:
A few researches have discussed the visual
cryptography for grayscale and color images. Naor and Shamir
mentioned the extension of their scheme to grayscale images.That is, to represent the gray levels of the hidden image by
controlling the way how the opaque sub pixels of the sheets
are stacked together. The grayscale version of the visual
cryptography is fundamentally proposed in the project. There
are some researches that deal with color images. Naor and
Shamir discussed the visual cryptography Scheme which
reconstructs a message with two colors, by arranging the
colored or transparent sub pixels [Naor96]. Koga et al. devised
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
certain position, which means that displaying m colors uses
m−1 Sub pixels. The resulting pixels contain one colored sub
pixel and the rest of the sub pixels are black.
Therefore the more colors are used; the worse the
contrast of the images becomes significantly. Their approaches
cannot be applied to the extended visual cryptography, either.
Rijmen and Preneel talked about enabling multicolor with
relatively less sub pixels (24 colors with m= 4) [Rijme96].
However each sheet must contain color random images, which
means applying this approach to the extended visual
cryptography is impossible. This project focuses on the (2 , 2)
scheme and discusses the method to deal with the natural
images with intermediate gray levels. It also shows how to
enhance the contrast.
About this Program:This program can encode the text images (6 images
max) in a single color image. And also can easily recover the
texts already being hided. It is very simple one, but very useful
Major advantage of this encoded image is like a original image
as before encoding. The image has no visible changes. So no
one can easily read the hidden texts by sight. The decoding
logic only can recover the texts. Thus these special features of
encoded image make it used to save the confidential data. Also
can used for web applications, mail services, media etc.,.
Tips to use program:
• For better results images should be in 24-Bit bit map
(bmp) format.
• Use larger size image (> 512 X 512)
• Avoid small size Fonts.
• All images should be in the same size.
• Text data should be converted to image format (bmp)
before execution.
• Text data should be monochrome (Black letters)
,color text leads to undesired results.
• Change the address of the image mentioned in this
program as per your location in Local drive.
• No need to specify the dimension of the image.
Initialize the Input
In this part obtained the input (1 Color image + 6 Text
images) from local drive. Collect all images as a separate
variable. Change the location of the image mentioned in
imread () function as per your image.
Part Two: Image Encoding
In this part the desire text images (max 6 images) are
going to encoded with the Color image. At first pair of textimages are combined into a single image. Simple logic is used
to achieve this. Pixels are selected from alternate location of
pair of text images. As a result of this, image having details
(but alternate locations) about pair of two text images. Further
explained that if a location (n,m) have the pixel of Image 1
next location (n+1,m+1) have the pixel taken from Image 2.
This task is done by alterim() function. Two arguments of this
function are two text images.
Next step is to encode the text image which was
already obtained from the result of alterim() function. We
obtained 3 single text images from this function. Each image
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
of color image LSB. Because LSB bit is very less significant,
so changing this bit won't affect the entire image. Further the
text image is having only black and white area. So I fix a
threshold as 128. If a pixel value of a text image is >128, LSB
of Color image is set as '1' otherwise '0'. Simply says if text is
present set that LSB as 1 otherwise 0. Similar way I do it for
other two color frames. All the above operations are
performed by imhide () function for each frame respectively.
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.
NOTE: In bmp format each color frame bits are represented by8-bits. We took the LSB of that 8-bit.
Part Three: Recovery of Text image
In this part two functions are used to recover the text
image from Encoded image. First step is to extract the text
image. Remember that text image encoded in the color image
in each frame is the alternate combination of two images
193 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 10/13
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 3, March 2011
(Text). The function txtxtract () just extract the text image
which is the combination of two text images, not by separate.
As we encode our data in LSB of each color frame that bit
alone sufficient to reconstruct our text image. So logical AND
operation is used to recover the LSB. Reverse operation of
function imhide () is used to reconstruct the text. Next step is
to separate the pair of two text images from the result of
function txtxtract (). Alternate selection used in previous
Encoding section is used again for all pair of images.
Part Four: Edge tappering
This part is the final step in my program. The image
obtained from previous step is not a tappered. So finally all
text images are smoothen by using fspecial() function
available in MATLAB.
INTRODUCTION TO MATLAB
What Is MATLAB?
MATLAB® is a high-performance language for
technical computing. It integrates computation, visualization,
and programming in an easy-to-use environment where
problems and solutions are expressed in familiar mathematical
notation. Typical uses include
1. Math and computation
2. Algorithm development
3. Data acquisition
4. Modeling, simulation, and prototyping
5. Data analysis, exploration, and visualization
6. Scientific and engineering graphics
7. Application development, including graphical user
interface building.
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 name MATLAB stands for matrix laboratory. MATLAB
was originally written to provide easy access to matrix
software developed by the LINPACK and EISPACK projects.
Today, MATLAB engines incorporate the LAPACK and
BLAS libraries, embedding the state of the art in software for
matrix computation.
MATLAB has evolved over a period of years with input
from many users. In university environments, it is the standard
instructional tool for introductory and advanced courses in
mathematics, engineering, and science. In industry, MATLAB
is the tool of choice for high-productivity research,
development, and analysis.
MATLAB features a family of add-on application-
specific solutions called toolboxes. Very important to most
users of MATLAB, toolboxes allow you to learn and apply
specialized technology. Toolboxes are comprehensive
collections of MATLAB functions (M-files) that extend the
MATLAB environment to solve particular classes of problems.
Areas in which toolboxes are available include signal
processing, control systems, neural networks, fuzzy logic,
wavelets, simulation, and many others.
The MATLAB System:
The MATLAB system consists of five main parts:
Development Environment:
This is the set of tools and facilities that help you use
MATLAB functions and files. Many of these tools are
graphical user interfaces. It includes the MATLAB desktop
and Command Window, a command history, an editor and
debugger, and browsers for viewing help, the workspace, files,
and the search path.
The MATLAB Mathematical Function:
This is a vast collection of computational algorithms
ranging from elementary functions like sum, sine, cosine, and
complex arithmetic, to more sophisticated functions like
matrix inverse, matrix eigen values, Bessel functions, and fast
Fourier transforms.
The MATLAB Language:
This is a high-level matrix/array language with control
flow statements, functions, data structures, input/output, and
object-oriented programming features. It allows both
"programming in the small" to rapidly create quick and dirty
194 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 11/13
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 3, March 2011
throw-away programs, and "programming in the large" to
create complete large and complex application programs.
Graphics:
MATLAB has extensive facilities for displaying
vectors and matrices as graphs, as well as annotating and
printing these graphs. It includes high-level functions for two-dimensional and three-dimensional data visualization, image
processing, animation, and presentation graphics. It also
includes low-level functions that allow you to fully customize
the appearance of graphics as well as to build complete
graphical user interfaces on your MATLAB applications.
The MATLAB Application Program Interface
(API):
This is a library that allows you to write C and Fortranprograms that interact with MATLAB. It includes facilities for
calling routines from MATLAB (dynamic linking), calling
MATLAB as a computational engine, and for reading and
writing MAT-files.
MATLAB WORKING
ENVIRONMENT:
A. MATLAB DESKTOP:-
Mat lab Desktop is the main Mat lab application
window. The desktop contains five sub windows, the
command window, the workspace browser, the current
directory window, the command history window, and one or
more figure windows, which are shown only when the user
displays a graphic.
The command window is where the user types
MATLAB commands and expressions at the prompt (>>) and
where the output of those commands is displayed. MATLAB
defines the workspace as the set of variables that the user
creates in a work session. The workspace browser shows these
variables and some information about them. Double clicking
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 current Directory tab above the workspace tab
shows the contents of the current directory, whose path is
shown in the current directory window. For example, in the
windows operating system the path might be as follows:
C:\MATLAB\Work, indicating that directory “work” is a
subdirectory of the main directory “MATLAB”; WHICH IS
INSTALLED IN DRIVE C. clicking on the arrow in the
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 uses a search path to find M-files and other
MATLAB related files, which are organize in directories inthe computer file system. Any file run in MATLAB must
reside in the current directory or in a directory that is on search
path. By default, the files supplied with MATLAB and math
works toolboxes are included in the search path. The easiest
way to see which directories are on the search path. The
easiest way to see which directories are soon the search paths,
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
search path to avoid repeatedly having the change the current
directory.
The Command History Window contains a record of thecommands a user has entered in the command window,
including both current and previous MATLAB sessions.
Previously entered MATLAB commands can be selected and
re-executed from the command history window by right
clicking on a command or sequence of commands. This
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
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 forcreating M-files and a graphical MATLAB debugger. The
editor can appear in a window by itself, or it can be a sub
window in the desktop. M-files are denoted by the extension
.m, as in pixelup.m. The MATLAB editor window has
numerous pull-down menus for tasks such as saving, viewing,
and debugging files. Because it performs some simple checks
and also uses color to differentiate between various elements
of code, this text editor is recommended as the tool of choice
for writing and editing M-functions. To open the editor, type
edit at the prompt opens the M-file filename.m in an editor
window, ready for editing. As noted earlier, the file must be in
the current directory, or in a directory in the search path.
Getting Help:
The principal way to get help online is to use the
MATLAB help browser, opened as a separate window either
by clicking on the question mark symbol (?) on the desktop
toolbar, or by typing help browser at the prompt in the
command window. The help Browser is a web browser
integrated into the MATLAB desktop that displays a
195 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 12/13
(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.
RESULTS
Fig 1: Text to be encodedFig 2: Color image before encoding
196 http://sites.google.com/site/ijcsis/
ISSN 1947-5500
8/7/2019 An Improved Visual Cryptography Scheme for Secret Hiding
http://slidepdf.com/reader/full/an-improved-visual-cryptography-scheme-for-secret-hiding 13/13
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 3, March 2011
Fig 3: Extracted Text images
CONCLUSION
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 contrastenhancement 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.
BIBILOGRAPHY
1. G. Ateniese, C. Blundo, A. de Santis, and D. Stinson.
Visual cryptography for general access structures. Information
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,
2001.
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
http://www.iacr.org/conferences.
197 http://sites.google.com/site/ijcsis/