SlideShare a Scribd company logo
1 of 77
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 1 SJCET
CHAPTER -1
INTRODUCTION
1.1 Overview:
The basic principle of the visual cryptography scheme (VCS) was first
introduced by Naor and Shamir. VCS is a kind of secret sharing scheme that focuses
on sharing secret images. The idea of the visual cryptography model proposed in is
to split a secret image into two random shares (printed on transparencies) which
separately reveals no information about the secret image other than the size of the
secret image. The secret image can be reconstructed by stacking the two shares. The
underlying operation of this scheme is logical operation OR. In this paper, we call a
VCS with random shares the traditional VCS or simply the VCS. In general, a
traditional VCS takes a secret image as input, and outputs shares that satisfy two
conditions: 1) any qualified subset of shares can recover the secret image; 2) any
forbidden subset of shares cannot obtain any information of the secret image other
than the size of the secret image but after stacking shares ,the secret image can be
observed visually by the participants. VCS has many special applications, for
example, transmitting military orders to soldiers who may have no cryptographic
knowledge or computation devices in the battle field. Many other applications of
VCS, other than its original objective (i.e., sharing secret image), have been found,
for example, authentication and identification, watermarking and transmitting
passwords etc.
The associated secret sharing problem and its physical properties such as
contrast, pixel expansion, and color were extensively studied by researchers
worldwide. For example, showed constructions of threshold VCS with perfect
reconstruction of the black pixels.
Secret sharing schemes are ideal for storing information that is highly
sensitive and highly important. Examples include: encryption keys, missile launch
codes.Each of these pieces of information must be kept highly confidential, as their
exposure could be disastrous, however, it is also critical that they should not be lost.
Traditional methods for encryption are ill-suited for simultaneously achieving high
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 2 SJCET
levels of confidentiality and reliability. This is because when storing the encryption
key, one must choose between keeping a single copy of the key in one location for
maximum secrecy, or keeping multiple copies of the key in different locations for
greater reliability. Increasing reliability of the key by storing multiple copies lowers
confidentiality by creating additional attack vectors; there are more opportunities
for a copy to fall into the wrong hands. Secret sharing schemes address this
problem, and allow arbitrarily high levels of confidentiality and reliability to be
achieved. The (2, 2) VC scheme divides the secret image into two shares so that
reconstruction of an image from a share is impossible. Each share is printed in
transparency. A share is a random noise. Encryption is performed for each pixel. It
shows the 2 different shares for black and white pixels. In these we have to
understood how a pixel in a image in divided into two sub pixels depending on
whether the pixel is black or white. By doing so the width of the share increases.
This is termed as Pixel Expansion.
1.1.1.Black and White Images:
Visual cryptographic solutions operate on binary or binarized inputs.
Therefore, natural (continuous-tone) images must be first converted into halftone
images by using the density of the net dots to simulate the original gray or color
levels in the target binary representation. Then, the halftone version of the input
image is used instead of the original secret image to produce the shares. The
decrypted image is obtained by stacking the shares together. Because binary data can
be displayed either as frosted or transparent when printed on transparencies or
viewed on the screen, overlapping shares that contain seemingly random information
can reveal the secret image without additional computations or any knowledge of
cryptographic keys. However, due to the nature of the algorithm, the decrypted
image is darker, contains a number of visual impairments, and most of visual
cryptography solutions increase the spatial resolution of the secret image. In
addition, the requirement for inputs of the binary or dithered nature only limits the
applicability of visual cryptography. Most of the existing secret sharing schemes are
generalized within the so-called {k,n}-threshold framework that confidentially
divides the content of a secret message into n shares in the way that requires the
presence of at least k, for k≤n, shares for the secret message reconstruction, Thus,
the framework can use any of n!/(k!(n−k)!) possible combinations of k shares to
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 3 SJCET
recover the secret message, whereas the use of k−1 or less shares should not reveal
the secret message.
Use of digital media has exploded in the past few years, primarily due to
several distinct advantages that digital media can offer over analog media. These
advantages include higher quality, easier editing, perfect copying and easier and
more efficient transmission over information network. The wide dissemination of
digital media also creates some potential problems. Due to the popularity of Internet
commerce and digital library applications, the intellectual property right (IPR)
protection is becoming increasingly important. Content providers will be reluctant
to provide their valuable contents if they are not assure d that their contents are
securely protected. Some good examples are the deployments of the digital versatile
disk (DVD) market and the online music market.
Fig1.1: random selection of pixels
1.1.2. VCS and the structures of sub-pixels:
The IPR management and protection issue is currently being addressed in the
emerging MPEG-4 standards for moving pictures compression. Several
technologies have been developed for IPR protection. One is conditional access
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 4 SJCET
through encryption. The digital media will be scrambled before it is distributed.
Only authorized users who have the proper key for decryption can access the clear
content. The other one is digital watermarking that securely embeds hidden
message into the multimedia data to identify the owner, or the buyer of a digital
media. These two techniques are complementary to each other. We focus on
conditional access through encryption in this project. Digital images/video are often
communicated or distributed over non-private channels, such as satellite links, cable
television networks, wireless networks, and the Internet.
Conditional access systems for private digital image/video transmission or
storage are a necessity for many applications, for example, pay-tv, confidential
videoconferences, confidential facsimile transmissions, and medical image
transmission and storage in a database. In general, complex cryptography
techniques make cracking of the system difficult, but are also expensive to
implement. Since digital video transmission system usually includes a compression
module that aims to reduce the transmitted bit rate, the cryptography techniques
have to be carefully designed to avoid potential adverse impact on the compression
efficiency, and on the functionalities that the compression format provides.
VC has been studied intensively since the pioneer work of Noor and Shamir. Most
of the previous research work on VC focused on improving two parameters: pixel
expansion and contrast. In these cases, all participants who hold shares are assumed
to be semi-honest, that is, they will not present false or fake shares during the phase
of recovering the secret image. Thus, the image shown on the stacking of shares is
considered as the real secret image.
Nevertheless, cryptography is supposed to guarantee security even under the
attack of malicious adversaries who may deviate from the scheme in any way. We
have seen that it is possible to cheat in VC, though it seems hard to imagine. For
cheating, a cheater presents some fake shares such that the stacking of fake and
genuine shares together reveals a fake image. With the property of unconditional
security, VC is suitable for sending highly classified orders to a secret agent when
computing devices may not be available.
The secret agent carried some shares, each with a pre-determined order, when
departing to the hostile country. When the headquarter decides to execute a specific
order, it can simply send another share to the agent so that the agent can recover
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 5 SJCET
what the order is. We can see that it would be terrible if the dispatched share cannot
be verified due to a cheater’s attack.
A VCS would be helpful if the shares are meaningful or identifiable to every
participant. A VCS with this extended characteristic is called extended VCS
(EVCS). EVCS is like a -VCS except that each share displays a meaningful image,
which will be called share image hereafter. Different shares may have different
share images. At first glance, it seems very difficult to cheat in EVCS because the
cheater does not know the share images that appear on the genuine shares and, thus,
has no information about the distributions of black and white pixels of the share
images. This information is crucial for cheating in VC.
A secret image consists of a collection of black and white pixels where each
pixel is treated independently. To encode the secret, we split the original image into
n modified versions (referred as shares) such that each pixel in a share now
subdivides into m black and white sub-pixels. To decode the image, we simply pick
a subset S of those n shares and Xerox each of them onto a transparency. It is
divided into 4 shares, which is denoted by Q containing at least one of the three sets
{1, 2}, {2, 3} or {3, 4}.
Then the qualified sets are exactly the following:
Equal = {1, 2}, {2, 3}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}, {1, 2, 3, 4}
1.1.2.1. How are shares divided?
We have used halftone Visual Cryptography to achieve Visual Cryptography
via half- toning. Based on the blue-noise dithering principles, the proposed method
utilizes the void and cluster algorithm to encode a secret binary image into n
halftone shares (images) carrying significant visual information.
1.1.2.2. How is Cheating done?
The issue of cheating by dishonest participants, called cheaters, in visual
cryptography is that, cheating is possible when the cheaters form a coalition in
order to deceive honest participants. At the outset two simple cheating prevention
visual cryptographic schemes where proposed by G.B.Hond, T.G.Chen, and
D.S.Tsai.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 6 SJCET
1.1.2.3. How is Decoding done?
Along with this basic setup, Noor and Shamir also proposed (k, n) threshold
model as its extension. This extended scheme is constructed such that any k shares
can be stacked together to reveal the original secret.
1.1.3. Modular Description:
This system deals with security during transmission of images. In Cheating
Prevention in Visual Cryptography the following are the main modules and each
module is explained below.
f Images
1.1.3.1. Security & Login Module:
This module deals with ensuring that only authorized users can access to this
application. A database with user-id and password is used to validate the User entry.
The input user-id is validated for a minimum of four characters. The application the
opens into the application screen on validation
1.1.3.2. Encoding the Image:
This system uses the Secret Sharing Scheme, which is a method for sharing a
secret among a set p of p participants. The secret is encoded into n pieces called
shares each of which is given to a distinct participant. Certain qualified subsets of
participants can recover the secret by pooling together their information, whereas
forbidden subsets of participants have information on the secret. The specification
of the qualified sets and the forbidden sets is called access structure. A special kind
of secret sharing scheme are Visual Cryptography Schemes (VCSs), that is,
schemes where the secret to share is an image and the shares consist of Xeroxed
transparencies which are stacked to recover the shared image. In this paper we
analyze the relationship between secret sharing schemes and VCSs, focusing our
attention on the amount of randomness required to generate the shares. We show
how to transform a secret sharing scheme for a given accessness of the original
scheme. An important consequence of this transformation is that lower bounds on
the randomness of visual cryptography schemes apply to general secret sharing
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 7 SJCET
schemes. Our randomness preserving transformation has also been applied to derive
a new upper bound on the randomness k, n threshold VCSs which dramatically
improves on the previously known bounds. All VCSs obtained by applying our
randomness preserving transformation allow a perfect reconstruction of black
pixels.
1.1.3.3. Decoding the Image:
The secret image consists of a collection of black and white pixels. To
construct shares of an image for participants, we need to prepare two collections,
which consist of Boolean matrices. A row in a matrix corresponds to sub-pixels of a
pixel, where 0 denotes the white sub-pixel and 1 denotes the black sub-pixel. For a
white (or black) pixel in the image, we randomly choose a matrix from (or,
respectively) and assign row of to the corresponding position of share. Each pixel of
the original image will be encoded into pixels, each of which consists of sub-pixels
on each share. Since a matrix in and constitutes only one pixel for each share. For
security, the number of matrices in and must be huge. For succinct description and
easier realization of the VC construction, we do not construct directly. Instead, we
construct two basis matrices and then let and be the set of all matrices obtained by
permuting columns of and , respectively.
Two collections (multi-sets) of Boolean matrices constitute a -VCS if there exist a
value and a set satisfying the following:
1) Any qualified set can recover the secret image by stacking their shares.
2) Any forbidden set has no information on the secret image.
Formally, the two collections, of matrices obtained by restricting each matrix in to
rows, are indistinguishable in the sense that they contain the same matrices with the
same frequencies.
In visual cryptography scheme, the carriers (share-image holders) will bring their
shares to the target place. The decoder will then stack the share images to find the
original image.
1.1.3.4. Verification of Images :
In existing visual cryptography scheme, the carriers (share-image holders)
will bring their shares to the target place; the decoder will then stack the share
images to find the original image. Here, there is no guarantee that carriers would not
have changed or faked their images. This is the problem statement as known.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 8 SJCET
In the proposed method, the decoder should be able to find whether the share
images brought to the target place are faked or not. Also, each share-holder should
be able to verify that other share-holder images are faked or not. In order to achieve
this, the proposed method creates a verification image for each share holder.
Each shareholder should bring this verification image also to the target place. In the
target place, before decoding, each share-holder will verify the other share-holders
image. Then, the decoder will also check each share-holders image.
In the proposed method, during encoding, a verification image is specified. The
share-images are created in such a way that stacking one share and other share-
holders verification-share will reveal the verification image. Suppose there are two
share- holders. During encoding, two images for each share-holder are created. One
of them is secrete share and other is verification share. So totally four images will
be created during encoding. In the target place, the decoder will know what
verification image should be displayed during stacking. The decoder will check all
verification images by combining each secret share with every other verification
share.
In our implementation, we have taken (2,2) viscrypt scheme. that is, there
will be two share-holders and both two of them will participate in stacking, as u
know. To do automated verification, we have defined the options called flag1 and
flag2 will be enabled after verification only. Also note that the message box should
come automatically showing whether the verification is successful or not. This
cannot be done automatically. The encoding and decoding can be done by
computer. But the verification can be done by humans only, by manually seeing
whether the verification image that came is correct or not. that is, verification can be
done by visually only.
1.2. Problem outline:
It suffers a management problem, because of which dealers cannot visually
identify each share. This problem is solved by the extended visual cryptography
scheme (EVCS), which adds a meaningful cover image in each share. But while
removing the extra cover image it produces extra noise or degrades the hidden
image quality. Hence we are Extending the visual cryptography algorithm without
removing cover images where it reduces pixel expansion problem and shares match
duration.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 9 SJCET
By reducing no of shares with increased participants, we can reduce the
complexity. It makes the decoding system easy and improves the efficiency. The
analysis is done by using the Matlab.
1.3. Objective:
The primary property of visual cryptography is using a method called
stacking shares, to recover secret image. Stacking refers to layering the shares on top
of the one another. The secret dealer creates two or more shares for secret message.
Each can not be caused to make public the secret alone. Receiving all the shares
printing each share on to a transparency and using human visual system, the secret
image can be visible without any computation. In this way, VC has verified to
provide perfect security Furthermore, the technique can be applied to group secret
system, which is using (k, n)-threshold visual secret sharing scheme in order to
perform secret sharing, where k=n. With (k, n)-threshold visual secret sharing
scheme, the dealer or the secret owner can base a group of n participants to produce
n shares for the secret message . Each participant in the group can have his own
share. When recovering the secret message, only k or more transparency stacks are
required without any computation. The secret message cannot be restored if less than
k transparencies are used . Each pixel in the secret image is expanded to four sub
pixels in each share that consist of white and black according to the patterns. The
summary points of Naor and Shamir‟s scheme
1) The secret data can be divided into n parts.
2) Any k or more than k parts can recover the secret
3) Any k -1 or fewer than k parts cannot compute the secret data.
1.4. Approach:
Wu and Chen were first researchers to present the visual cryptography
schemes to share two secret images in two shares. They hidden two secret binary
images into two random shares, namely A and B, such that the first secret can be
seen by stacking the two shares, denoted by A⊗ B, and the second secret can be
obtained by first rotating A Ө anti-clockwise. They designed the rotation angle Ө to
be 90◦. However, it is easy to obtain that Ө can be 180◦ or 270◦. To overcome the
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 10 SJCET
angle restriction of Wu and Chen’s scheme, Hsu et al. proposed a scheme to hide
two secret images in two rectangular share images with arbitrary rotating angles.
Wu and Chang also refined the idea of Wu and Chen by encoding
shares to be circles so that the restrictions to the rotating angles (Ө = 90◦, 180◦ or
270◦) can be removed.
In 1994 the basic problem of visual cryptography was introduced by Noor
and Shamir. In visual cryptography we are dealing with the problem of encrypting
pictures in a secure way such that the decryption can be done by the human visual
system. The encryption of a secret image is achieved by encoding the information
into several shadow images, called shares. The decoding is done by printing the
shares on transparencies and stacking them. The system can be used by everyone
without any knowledge of cryptography and without performing cryptographic
computations. This is the major difference to usual cryptography schemes. This is
the major difference to usual cryptography schemes where the secret information,
represented as numbers, is encrypted by using one-way functions. The decryption
can only be done if one knows the appropriate secret key.
Noor and Shamir have described a k out of n (with k<=n ) system where the
secret is encoded in n shares and the decoding can be done by stacking k or more
transparencies. Using less than k transparencies won’t reveal the secret not even to
an infinitely powerful cryptanalyst.
In general it is possible that k and n are reasonably big numbers. In order to
reveal the secret information it is necessary to have at least k people stack their
shares together. Since k can be reasonably big, it might be very unlikely to find a
coalition of at least k traitors who will be willing to misuse their . shares, in general
one share-holder might not even know k-1 other share-holders. Obviously, it is
much easier to find 0<t<k traitors who are looking for a way to sabotage the system.
We assume that t<k share-holders stack their shares together and publish the
information so that other small groups of less than k people can stack their shares
on top of the published information and will therefore be able to reveal the actual
secret. (It is possible to iterate the scenario in such a way that at first the
information of t then t+t’ shares etc. gets published.) Since there is no way in
keeping t people from publishing the accumulated information we are looking for a
possibility to trace the traitors.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 11 SJCET
S J Shyu et al were first researchers to advise the multiple secrets sharing in
visual cryptography. This scheme encodes a set of n ≥ 2 secrets into two circle
shares. The n secrets can be obtained one by one by stacking the first share and the
rotated second shares with n different rotation angles. To encode unlimited shapes
of image and to remove the limitation of transparencies to be circular, Fang offered
reversible visual cryptography scheme. In this scheme two secret images which are
encoded into two shares; one secret image appears with just stacking two shares and
the other secret image appears with stack two shares after reversing one of them.
Jen-Bang Feng et al developed a visual secret sharing scheme for hiding multiple
secret images into two shares. The proposed scheme analyzes the secret pixels and
the corresponding share blocks to construct a stacking relationship graph, in which
the vertices denote the share blocks and the edges denote two blocks stacked
together at the desired decryption angle. According to this graph and the pre-
defined visual pattern set, two shares are generated.
To provide more randomness for generating the shares Mustafa Ulutas et al
advised secret sharing scheme based on the rotation of shares. In this scheme shares
are rectangular in shape and are created in a fully random manner. Stacking the two
shares reconstructs the first secret. Rotating the first share by 90° counterclockwise
and stacking it with the second share reconstructs the second secret.
Tzung-Her Chen et al offered the multiple image encryption schemes by
rotating random grids, without any pixel expansion and codebook redesign. A non-
expansion reversible visual secret sharing method that does not need to define the
lookup table offered by Fang . To encode four secrets into two shares and
recovering the reconstructed images without distortions Zhengxin Fu et al intended
a rotation visual cryptography scheme. Rotation visual cryptography scheme
construction was based on correlative matrices set and random permutation, which
can be used to encode four secret images into two shares. Jonathan Weiretal
suggested sharing multiple secrets using visual cryptography. A master key is
generated for all the secrets; correspondingly, secrets are shared using the master
key and multiple shares are obtained.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 12 SJCET
1.4.1. Visual cryptography scheme for binary Images
Implementation of ‘2 out of 2’ scheme
The (2, 2) – Visual cryptography scheme (VCS) is illustrated to bring in the
basic concepts of threshold visual secret sharing schemes. In the encryption process
every secret pixel is turned into two shares, and each share belongs to the
corresponding share image. In the decryption process the two corresponding shares
are stacked together (using OR operation) to recover the secret pixel. Two share of a
white secret pixel are of the same while those of a black secret pixel are opposite.
Fig 1.2:(a) share-1 (b) share-2
(c) overlapped image
Therefore a white secret pixel is improved by a share with the stacked result of
half white sub-pixels and a black secret pixel is recovered by all black. In XOR
based VCS scheme where the share images are superimposed using XOR operation
which results in perfect reconstruction of both Black and white pixels as and sub
sampling a 2×2 share into a single pixel we get decrypted image of the same size as
original secret image.
1.5. Thesis Outline:
In Chapter 2: Fundamentals of visual cryptography; Chapter 3: Algorithm
approach ; Chapter 4: System Design-Block diagram ,Functional Description of
each Block; Chapter 5:Total Outline; Chapter 6: Result Observation-Simulation
result; Chapter 7:Conclusion and Future Scope
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 13 SJCET
CHAPTER -2
FUNDAMENTALS
2.1.Binary Images:
2.1.1. Geometric Properties
For a given image size, a binary image is easier to digitize, store, and
transmit than a full gray-level image, since it contains about an order of magnitude
fewer bits. Naturally, some information is lost and fewer options are open to us in
processing such an image. In fact, we can present a fairly complete theory of what
can and cannot be done with binary images, something that still eludes us in the
case of gray-level images.First of all, we can compute various geometric properties,
such as the size and position of the object in the image. If there is more than one
object in the field of view, we can determine some topological properties of the
assembly, such as the difference between the number of objects and the number of
holes. It is also possible to label the individual objects and to perform the
geometrical computations for each one separately. Finally, we can simplify binary
images for further processing by modifying them in an iterative fashion.Binary
image processing is well understood and lends itself to highspeed hardware
implementation, but one must keep in mind its limitations.We have already
mentioned the need for high object-to-background contrast.Moreover, the pattern
obtained must be essentially two-dimensional.Remember that all we have is the
outline or silhouette of the object. This gives little information about the object’s
overall shape or its attitude in space.The characteristic function b(x, y) has a value
for each point in the image. We call this a continuous binary image. Later, we shall
consider discrete binary images, obtained by tessellating the image plane suitably.
2.1.1.1. Simple Geometrical Properties:
Assume for now that we have a single object in the field of view. Thearea of
the object, given the characteristic function b(x, y), can be found as
A = ∫∫I b(x, y) dx dy,
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 14 SJCET
where the integration is over the whole image I. If there is more than one object,
this formula will give the total area.
2.1.1.2. Area and Position:
How do we determine the position of the object in the image? Since the
object is usually not just a single point, we must give a precise meaning
to the term “position.” The usual practice is to choose the center of area
as the representative point .
2.1.1.3. Orientation:
We also want to determine how the object lies in the field of view, that
is, its orientation. This is a little harder. Let us assume that the object is somewhat
elongated; then the orientation of the axis of elongation can be used to define the
orientation of the object . (There is a remaining two-way ambiguity, however, as
discussed .) How precisely do we define the direction in which the object is
elongated? The usual practice is to choose the axis of least second moment. This is
the two-dimensional equivalent of the axis of least inertia. We find the line for
which the integral of the square of the distance to points in the object is a minimum;
that integral is
E = ∫∫ I r2 b(x, y) dx dy,
where r is the perpendicular distance from the point (x, y) to the line sought after.
To choose a particular line in the plane, we need to specify two parameters.A
convenient pair consists of the distance ρ from the origin to the closest point on the
line, and the angle θ between the x-axis and the line, measured counterclockwise
.We prefer these parameters because they change continuously when the coordinate
system is translated or rotated. There are no problems when the line is parallel, or
nearly parallel, to either of the coordinate axes. Using these parameters, we can
write the equation of the line in the form
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 15 SJCET
x sin θ − y cos θ + ρ = 0
by noting that the line intersects the x-axis at −ρ/ sin θ and the yaxis
at +ρ/ cos θ. The closest point on the line to the origin is at (−ρ sin θ,+ρ cos θ). We
can write parametric equations for points on the line as follows:
x0 = −ρ sin θ + s cos θ and y0 = +ρ cos θ + s sin θ,
where s is the distance along the line from the point closest to the origin
2.1.1.4. Projections:
The position and orientation of an object can be calculated using first and
second moments only We do not need the original image to obtain
the first and second moments; projections of the image are sufficient. This is of
interest since the projections are more compact and suggest much faster algorithms.
2.1.2. Discrete Binary Images:
So far we have dealt with continuous binary images, defined at all pointsin
the image plane. It should be obvious that the integrals become sumswhen we turn
to discrete binary images The area, for example,can be computed using the sum
A = ∑n
i=1∑m
j=1 bij,
Where bij is the value of the binary image at the point in the ith row and the jth
column.Here we have assumed that the image has been digitized on a square grid
with n rows and m columns. Usually the image is scanned out row by row, in the
same sequence as the beam on a television set explores the screen (except for
interlace). As each picture cell is read, we check whether bij = 1. If so, we add 1, i,
j,i2, ij, and j2 to the accumulated totals for the area, first moments, and second
moments, as appropriate. At the end of the scan, the area, position, and orientation
can be easily calculated from these totals.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 16 SJCET
2.1.2.1. Run-Length Coding:
For binary images there are several coding techniques that can compress the
data even further. A popular one is run-length coding. This method exploits the fact
that along any particular scan line there will usually be
long runs of zeros or ones. Instead of transmitting the individual bits, then,we can
send numbers indicating the lengths of such runs. The run-length code for the image
line
0 1 1 1 1 0 0 0 1 1 0 0 0 0
is just . Some special code may be used to indicate the beginning of each line.
Further, a convention is followed as to whether the line starts with a zero or a one.
If the line starts the other way, an initial run-length code of zero is sent. Let us use
the convention that rik is the kth run of the ith line and that the first run in each row
is a run of zeros. (Thus all the even runs will correspond to ones in the image.)
Suppose further that there are mi runs on the ith line. (This number will be odd if
the last run contains zeros.) How do we use run-length codes to rapidly compute the
desired geometric properties? Clearly the area is just the sum of the run lengths
corresponding to ones in the image:
n mi ∕ 2
A = ∑ ∑ ri,2k
i=1 k=1
Note that the sum is over the even runs only. The center of area is a
little harder to calculate. First of all, we obtain the horizontal projection
mi ∕ 2
hi = ∑ ri ,2k
k=1
From this we can easily compute the vertical position i of the center of area
Using
n
Ai = ∑ i hi
i=1
But what about the vertical projection vj? Remember that a particular
entry in this projection is obtained by adding up all picture cell values
in one column of the image. It is therefore hard to compute the vertical
projection directly from the run lengths.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 17 SJCET
2.1.2.2. Bitmap images :
Bitmap images are made of individual dots called pixels (picture elements)
that are arranged and colored differently to form a pattern .The individual squares
that make up the total image can be seen when zoomed in. However, from a greater
distance the color and shape of a bitmap image appear continuous .Since each pixel
is colored individually, you can easily work with photographs with so many colors
and can create photorealistic effects such as shadowing and increasing color by
manipulating select areas, one pixel at a time. Bitmap programs are ideal to retouch
photographs, editing images and video files and creating original artwork. Variety
of changes to photographs can be made, such as adjusting the lighting, removing
scratches, people, and things, swapping details between images, adding text and
objects, adjusting color, and applying combinations of special effects.
Fig 2.1: bitmap images
To the left you see an image and to the right the top of one of the mountains
when zoomed in. As you can see, the image consists of hundreds of rows and
columns of small elements that all have their own color. Hence, if you work on a
bigscale multimedia project or design a Web site, what graphic formatwill be the
best choice for your needs? Which features of images are more important for the
nature of your project: flexibility in scaling, file size, or photorealistic vs.computer
generated look? In the next section, I will talk about these issues.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 18 SJCET
Bitmap Image
Text
Text
Whereas, bitmap image formats give a realistic result for representation of
the real world, vectorbased images can only come as close as cartoon style drawings
of the objects For instance, you cannot easily scale bitmap images, but you can
control every single pixel. Thus, when you work with complex images, such as
photographs, you can do number of effects whi ch are impossible in vector based
images If you want photorealistic images, then the solution will be the use of
bitmaps. However, if the download speed of graphics is important for youand your
audience and the graphics are supposed to be resized and manipulated, then you
should consider vector based formats.
2.2. Secret sharing Algorithm:
In cryptography, secret sharing refers to a method for distributing a secret
amongst a group of participants, each of which is allocated a share of the secret.
The secret can only be reconstructed when the shares are combined together
individual shares are of no use on their own There is a secret picture to be shared
among n participants.The picture is divided into n transparencies(shares) such that
if any m transparencies are placed together, the picture becomes visible but if fewer
than m transparencies are placed together, nothing can be seen.
A secret-sharing scheme is a method by which a dealer distributes shares to
parties such that only authorized subsets of parties can reconstruct the secret.
Secret-sharing schemes are important tools in cryptography and they are used as a
building box in many secure protocols, e.g., general protocol for multiparty
computation, Byzantine agreement, threshold cryptography, access control,
attribute-based encryption, and generalized oblivious transfer messages. Secret
sharing (also called secret splitting) refers to methods for distributing a
secret amongst a group of participants, each of whom is allocated a share of the
secret. The secret can be reconstructed only when a sufficient number, of possibly
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 19 SJCET
different types, of shares are combined together; individual shares are of no use on
their own.
In one type of secret sharing scheme there is one dealer and n players. The
dealer gives a share of the secret to the players, but only when specific conditions
are fulfilled will the players be able to reconstruct the secret from their shares. The
dealer accomplishes this by giving each player a share in such a way that any group
of t (for threshold) or more players can together reconstruct the secret but no group
of fewer than t players can. Such a system is called a (t, n)-threshold scheme
sometimes it is written as an (n, t)-threshold scheme.
There is a simple algorithm for binary (black and white) visual cryptography
that creates 2 encrypted images from an original unencrypted image.
The algorithm is as follows:
 First create an image of random pixels the same size and shape as the original
image.
 Set the same pixel of the second encrypted image to the opposite color. Where a
pixel of the original image is different than the corresponding pixel in the first
encrypted image.
 The two apparently random images can now be combined using an exclusive-or
(XOR) to re-create the original image
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 20 SJCET
Fig 2.2:secret image,share 1&share 2,overlapped image
From secret image two shares are generated,those are share 1& share 2 are
generates from black &white pixel components of secret image.Then these shares
are overlapped it leads to Decrypted image that is approximately equal to original
secret image,
2.2.1. Current Methodology:
In the current scenario, as shown in the Figure, when the end user wants to
access his confidential information online (in the form of money transfer or payment
gateway) by logging into his bank account or secure mail account, the person enters
information like username, password, credit card no. etc. on the login page. But quite
often, this information can be captured by attackers using phishing techniques (for
instance, a phishing website can collect the login information the user enters and
redirect him to the original site). There is no such information that cannot be directly
obtained from the user at the time of his login input.
In the current scenario, as shown in the Figure when the end user wants to access
his confidential information online (in the form of money transfer or payment
gateway) by logging into his bank account or secure mail account, the person enters
information like username, password, credit card no. etc. on the login page. But
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 21 SJCET
quite often, this information can be captured by attackers using phishing techniques
(for instance, a phishing website can collect the login information the user enters
and redirect him to the original site). There is no such information that cannot be
directly obtained from the user at the time of his login input.
Fig 2.3: Existing system scenario
2.3. Blur Kernal:
In image processing, a kernel, convolution matrix, or mask is a
small matrix useful for blurring, sharpening, embossing, edge-detection, and more.
This is accomplished by means of convolution between a kernel and an image.
2.3.1. The Gaussian kernel:
The Gaussian (better Gaußian) kernel is named after Carl Friedrich Gauß
(1777-1855), a brilliant German mathematician. This chapter discusses many of the
nice and peculiar properties of the Gaussian kernel.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 22 SJCET
Fig 2.4: The Gaussian kernel is apparent on every German banknote of DM 10,-
where it is depicted next to its famous inventor when he was 55 years old. The new
Euro replaces these banknotes.
The Gaussian kernel is defined in 1-D, 2D and N-D respectively as
In 1-D G1D In 2-D G2D
-(x2 /2σ2) -((x2 +y2)/2σ2)
G1D(x;σ) = (1/√2πσ)* e G2D(x,y;σ) = (1/2πσ2)* e
The s determines the width of the Gaussian kernel. In statistics, when we
consider the Gaussian probabilitydensity function it is called the standard deviation,
and the square of it, s2, the variance. In the rest of this book, when we consider the
Gaussian as an aperture function of some observation, we will refer to s as the
inner scale or shortly scale. In the whole of this book the scale can only take
positive values, s > 0. In the process of observation s can never become zero. For,
this would imply making an observation through an infinitesimally small aperture,
which is impossible. The factor of 2 in the exponent is a matter of convention,
because we then have a 'cleaner' formula for the diffusion equation, as we will see
later on. The semicolon between the spatial and scale parameters is conventionally
put there to make the difference between these parameters explicit. The scale-
dimension is not just another spatial dimension, as we will thoroughly discuss
in the remainder of this concept.
Standard Deviation:
The Standard deviation of the Gaussian function plays an important role in its
behaviour.The values located between +/- σ account for 68% of the set, while two
standard deviations from the mean (blue and brown) account for 95%, and three
standard deviations account for 99.7%.This is very important when designing a
Gaussian kernel of fixed length.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 23 SJCET
The Gaussian function is used in numerous research areas:
 It defines a probability distribution for noise or data.
 It is a smoothing operator.
 It is used in mathematics.
The Gaussian function has important properties which are verified with
respect to its integral:
-∞
I = ∫ exp(-X2) dx=√∏
∞
In probabilistic terms, it describes 100% of the possible values of any
given space when varying from negative to positive valuesGauss function is never
equal to zero.It is a symmetric function.
When working with images we need to use the two dimensional
Gaussian function.This is simply the product of two 1D Gaussian functions for each
and is given by:
- ((x2+y2)/2σ2)
G(x,y) =1/2πσ2 e
A graphical representation of the 2D Gaussian distribution with mean(0,0)
and σ = 1 is shown to the right.
The Gaussian filter works by using the 2D distribution as a point-spread
function.This is achieved by convolving the 2D Gaussian distribution function
with the image.We need to produce a discrete approximation to the Gaussian
function.This theoretically requires an infinitely large convolution kernel, as the
Gaussian distribution is non-zero everywhere.Fortunately the distribution has
approached very close to zero at aboutthree standard deviations from the mean.
99% of the distributionfalls within 3 standard deviations.This means we can
normally limit the kernel size to contain only values with in three standard
deviations of the mean.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 24 SJCET
Gaussian kernel coefficients are sampled from the 2D Gaussian
function.
- ((x2+y2)/2σ2)
G(x,y) =1/2πσ2 e
Where σ is the standard deviation of the distribution.
The distribution is assumed to have a mean of zero.
We need to discretize the continuous Gaussian functions to store it as
discrete pixels.
The Gaussian filter is a non-uniform low pass filter.The kernel coefficients
diminish with increasing distance from the kernel’s centre.Central pixels have a
higher weighting than those on the periphery.Larger values of σ produce a wider
peak Kernel size must increase with increasing σ to maintain the Gaussian nature
of the filter.Gaussian kernel coefficients depend on the value of σ.At the edge of the
mask, coefficients must be close to 0.The kernel is rotationally symmetric with no
directional bias.Gaussian kernel is separable which allows fast computation
Gaussian filters might not preserve image brightness.
2.3.2. Gaussian Filtering examples:
Is the kernel 1 6 1 a 1D Gaussian kernel?
Give a suitable integer-value 5 by 5 convolution mask that approximates a
Gaussian function with a σ of 1.4.
How many standard deviations from the mean are
required for a Gaussian function to fall to 5% or 1% of
5%, its peak value?
What is the value of σ for which the value of the
Gaussian function is halved at +/-1 x.
Compute the horizontal Gaussian kernel with mean=0
and σ=1, σ=5.
Gaussian filtering is used to remove noise and detail. It is notparticularly
effective at removing salt and pepper noise.Compare the results below with those
achieved by the median filter.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 25 SJCET
Gaussian filtering is more effective at smoothing images. It has its basis in
the human visual perception system. It has been found that neurons create a similar
filter when processing visual images.The halftone image at left has been smoothed
with a Gaussian filterand is displayed to the right.
This is a common first step in edge detection.The images below have been
processed with a Sobel filter commonlyused in edge detection applications. The
image to the right has had a Gaussian filter applied prior to processing.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 26 SJCET
CHAPTER-3
ALGORITHM APPROACH
3.1. An Extended VC Algorithm for General Access Structure:
Visual cryptography was proposed by Naor and Shamir ,allows the
encryption of secret information in the image form. In the concept of secret sharing,
a secret image can be encrypted as n different share images printed on
transparencies, which are then distributed to n participants. By stacking
transparencies (shares) directly, the secret images can be revealed and visually
recognized by humanswithout any computational devices and cryptographic
knowledge. On the other hand, any one share or a portionof shares can leak nothing
related to the secret image .VC is a very good solution for sharing secrets when
computers cannot be employed for the decryption process. Later on threshold visual
secret sharing scheme, also known as kout- of-n VSS scheme or(k,n)-VSS scheme
have been proposed. Ateniese proposed the concept of general access structure
(GAS) and also developed a VC-based solution for some GASs.By using the GAS ,
dealers can define reasonable combinations of shares as decryption Conditions rather
than specifying the number of shares. Hence, the (k, n)-VSS scheme can be treated
as a special case of the GAS. Conventional VSS schemes generate noise-like
random pixels on shares to hide secret images. So, the secret can be perfectly
concealed on the share images. These schemes suffer from a management problem
so that dealers cannot identify each share visually. The pixel expansion problem is
also a common disadvantage with most of the VSS schemes. When the VC-based
approach is employed, each secret pixel within a secret image is encrypted in a block
consisting of 'm' sub pixels in each constituent share image. Thus, the area of a share
is 'm' times that of the original secret image. Thereby contrast of the recovered
images will be decreased to '1/m' simultaneously. The pixel expansion problem not
only affects the practicability of storage and transmission requirements for shares but
also decreases the contrast of the recovered secret images. So developed a friendly
VC scheme known as the extended visual cryptography scheme, which adds a
meaningful cover image on each share to address the management problem and the
pixel expansion problem.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 27 SJCET
Fig 3.1: Example for Visual Cryptographic Scheme (a) Secret Image (b) Share1
(c) Share2 (d) Stacked Result
This paper proposes a new method that resolves management problem; pixel
expansion problem. This approach can be used for binary secret images
innoncomputer aided decryption environments. The proposed approach consists of
two phases. The first phase of the algorithm uses optimization technique for a given
access structure, constructs a set of noise like shares that are pixelexpansion-free.
This phase identifies and formulates the problem as a combinatorial optimization
problem and then developed a simulated-annealing based algorithm to solve it. The
second phase of the algorithm directly adds a cover image on each share directly via
a stamping algorithm and thereby removing the pixel expansionentirely. The
experimental results shows that this approach is a solution to the pixel expansion
problem of the EVCS. Moreover, the display quality of the recovered image is very
close to that obtained using conventional VC schemes.
3.1.1. Ideal Contrast Secret Sharing Scheme through Meaningful Shares with
Enveloping Digital Watermarking using Bit Plane based (k,n)-VCS:
A new secret sharing scheme with meaningful shares using (k,n)-threshold
visual cryptography and digital watermarking for grayscale images based on bit
plane encoding is proposed in this method. Initially, an image is decomposed into its
bit plane images that generate a binary image at each bit plane. Secondly, the
traditional binary secret sharing scheme is used to get the sharing images. Finally, a
proposed watermarking technique is used to generate meaningful shares. To decrypt
hidden secret image, extract the shares from the cover image and decompose each
share into bit planes and then secret grayscale image is reconstructed. This scheme
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 28 SJCET
provides a more efficient way to hide images in different meaningful shares. To
reduce the interest of hackers, we have proposed a technique called digital
enveloping. This is nothing but an extended invisible digital watermarking
technique. Using this technique, the shares, produced by k-n secret sharing visual
cryptography are embedded into the envelope images by LSB replacement . This can
be done by replacing the b Least Significant Bits (LSB) of each channel represented
with 8 bits of the 24-bit color image.
3.2. Phase 1-Generating I-Shares:
This phase 1 of this method aims to construct a pixel expansion-free VCS for
a given access structure (Tqual,Tforb). The idea behind the solution is as follows. A
security system employs n' different keys to protect a secretand distributes these keys
to n different participants. Each and every key may be duplicated and will be
distributed to at least one participant. Each participant is allowed to hold at least one
key.
If someone wants to access the secret, he/she has to collect n' different keys
from a set of participants. If he/she misses any one type of key, the secret will
remain protected. So for an access structure(Tqual, Tforb)the dealer has to carefully
distribute n' different keys to any set of participants X,X ЄTqual and has to
guarantee that any set of participants Y, YЄTforb, will not hold all types of keys. In
summary, phase I of the proposed algorithm contains two sub procedures: First,
finding the number of basis n' shares and a corresponding construction set C for a
(Tqual,Tforb)- VCS. We develop a GAS solver to deal with these works. Before
Encryption we need to halftone the color secret image in to binary image and
generate color meaningful shares R,G,B with the proposed scheme. During this
phase an Error Diffusion Half toning algorithm is used to halftone the Secret Image.
Second, basis shares S1,...,Sn that were yielded by constructions of (n',n')-VCS and
the construction set C will be utilized to obtain uncovered I-shares. This work will be
carried out by This work will be carried out by the encryptor using Yang's
probabilistic vss scheme and the share synthesizer. In the 2nd phase, a stamping
algorithm based on LSB replacement in which cover images itself will stamp
together produces the resultant secret image. During that phase an Inverse
Halftoning algorithm using Neural Network method is used for generating the secret
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 29 SJCET
image. The proposed methods offer a high quality of secret image compared with the
previous schemes.
3.2.1. GAS Solver-General Access Structure Solver:
For a set of participants P= {i1,i2,….in} and access structure (ΓQual , ΓForb)
the GAS solver is used to finding a construction set C with minimal n1.In this
section, we develop an algorithm based on the simulated annealing approach to solve
the proposed mathematic optimization formulation for the GAS problem. Inorder to
simplify optimization procedures, use penalized energy function in the model. The
penalized energy function Ep can be defined as Ep= Nf + |TQual| / (1 + Nq) where
Nq denotes the amount of a set that can recover the secret image and Nf represents
the amount of an insecure forbidden set in TForb. Our solution approach adopts an
iterative improvement framework. The iteration is based on the decision variable n1.
The proposed iterative improvement framework is listed in Algorithm 1. The pseudo
code for the proposed SAbasedalgorithm, GAS_SA() is in Ref.
(a)Algorithm : SA based algorithm for GAS Solver:
(b)Algorithm for Share Constructor:
The share constructor consists of two modules in Figure 1: the encryptor and
share synthesizer. The encryptor adopts Yang’s construction for the (n1,n1) –
ProbVSS scheme. In the share constructor, encryptor generates the basis shares by
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 30 SJCET
employing Yang’s ProbVSS scheme. Then the share synthesizer produces
intermediate shares (I- shares) by stacking the basis shares upon the construction set
C. The procedure for the share constructor is described in Ref . The share constructor
phase is applied on three planes.
3.3. Phase II-Stamping:
After generating color shares using Error diffusion halftoning algorithm,
those color shares are encrypted using Yang's Prob VSS scheme and synthesized, ie
distributes those shares to corresponding P participants. In the 2nd phase,a stamping
algorithm is used in which cover images itself will stamp together produces the
resultant secret image. If the random looking shares are enveloped into meaningful
images using cover images, the interest of hackers can be reduced, thereby providing
more security to visual cryptography. Otherwise hackers thought that it might be a
critical information. Therefore here used a technique called digital enveloping or
stamping or embedding of cover images into shares using LSB replacement. In LSB
steganography , the least significant bits of the cover media's digital data are used to
conceal the message.LSB replacement steganography flips the last bit of each of the
data values to reflect the message that needs to be hidden. Consider an 8-bit
grayscale bitmap image where each pixel is stored as a byte representing a grayscale
value.It is clear that on average, only half the LSBs need to change.The difference
between the cover (i.e. original) image and the stego image will be hardly noticeable
to the human eye.Results show a cover image and a stego image with data is
embedded, there is no visible difference between the two images.LSB matching
randomly increments or decrements the data value by one. LSB matching is also
known as ±1 embedding.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 31 SJCET
Proposed Stamping Algorithm:
3.4. Proposed Scheme :
In the Proposed scheme we used (2, 2) Visual Cryptography Scheme. The
whole design is divided into two process
1) Encryption(Creating shares)
2) Decryption(Human Visual System)
3.4.1. Encryption process
Encryption process is partitioned into two stages and shown in figure
(a)First stage :
An original binary image of size 100X100 has been considered in our design
where each pixel is either 0 or 1.
A (2, 2) Visual Sharing technique is applied on original binary image. From
this process two binary share images will be generated.
(b)Second stage :
In the second stage four share images are generated from the two share
images obtained from first stage using (2,2) VCS, this is called chain share of order
2. Further to enhance the security, share encryption is performed on four shares
obtained from previous step using 8-bit different LFSR sequence XOR ing the share
bit with LFSR bit and it is repeated for whole binary share image. Hence, no two
share should generate partial image.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 32 SJCET
Fig 3.2 : Encryption of shares
3.4.2. Decryption process :
Decryption process is reverse process of encryption. It consists of two stages
and pictorial representation of decryption process is given in figure.
(a)First Stage :
To decrypt the four shares from encrypted shares same LFSR sequence must
be used which was used in earlier encryption process and bitwise XOR operation
performed between encrypted share and LFSR bit sequence. Otherwise original
image will not be recovered in future.
From four decrypted share of the previous step, two partial shares were
obtained by performing bitwise logical ORing between share 1,2 and share 3,4.
(b)Second Stage:
Bitwise logical OR operation performed on two obtained share images from
previous stage to get back the retrieved image. The obtained image is identical to
original image.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 33 SJCET
Figure 3.3: Encryption Process with two stages
Figure 3.4 : Decryption Process with two stages
3.4.3. Results :
Matlab 7.2 Software tool is used to analyze the result. To study the
performance of proposed scheme three different binary images of size 100X100
were used and shown in figures. The stage by stage result of proposed scheme is
given in table .
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 34 SJCET
Fig 3.5:secret image1
Fig 3.6:secret image2 Fig 3.7:secret image3
shows the Encryption process of the original binary image. In the table Figure shows
three different original binary images, are shares generated in the 1st stage. The
result shows no residual information of original image perceptually observed among
the two shares. In the second stage four different shares are generated and is given in
In this four shares stacking process of any two shares gives residue of original
information. So to provide additional security share encryption is performed on all
the four shares as discussed is scrambled shares using 8 stage LFSR sequence.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 35 SJCET
Table 3.1: Encryption process:
Table gives decryption process and it is reverse process of encryption. In the table3
the figure is same scrambled share image. The same LFSR initial sequence or key
need to be used to get back the four shares. The obtained shares are shown in the
figure. It is observed that no residual information is visually seen. Figure are the
shares obtained from BIT ORing the shares shown in Fig 4p and 4q and Fig
respectively. Reconstructed image given in figure obtained by BIT ORing the
previous shares i.e.,Fig From figure image can be easily identified but contrast is
poor. In order to obtain the efficient reconstructed image Bitwise XOR is applied
between the shares and obtained image shown in figure.The figure image is identical
to original image except the size.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 36 SJCET
Table 3.2: Decryption Process:
3.4.4. Conclusion :
Using the proposed design original image successfully encoded into 4 share
images. In This scheme two stages were used it’s very difficult to access the original
information by unauthorized receiver. In this paper we used only order 2(two stages)
because if we increase the order even though we can generate many number of
shares, but quality of the reconstructed image will be poor (more number of
columns) and needs more storage space for shares.Difficulties for image
reconstruction by unauthorized receiver
1. Order and orientation of chain share: If the order of the chain share is
unknown and orientation is mismatched we will not get the original image
2. LFSR sequence: We have to use same LFSR sequence for encryption as well
as decryption to get back the original image
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 37 SJCET
3. Number of shares: All the four shares compulsorily necessary to identify the
original binary image. The secret image consists of a collection of black and white
pixels. To construct shares of an image for participants, we need to prepare two
collections, which consist of Boolean matrices. A row in a matrix corresponds to
sub-pixels of a pixel, where 0 denotes the white sub-pixel and 1 denotes the black
sub-pixel. For a white (or black) pixel in the image, we randomly choose a matrix
from (or, respectively) and assign row of to the corresponding position of share.
 Each pixel of the original image will be encoded into pixels, each of which consists
of sub-pixels on each share. Since a matrix in and constitutes only one pixel for
each share. For security, the number of matrices in and must be huge. For succinct
description and easier realization of the VC construction, we do not construct and
directly. Instead, we construct two basis matrices and then let and be the set of all
matrices obtained by permuting columns of and, respectively. Two collections
(multi-sets) and of Boolean matrices constitute a –VCS.
 Each white pixel in the original image is split into two of the same small blocks that
have half black and white pixels. When these two blocks are overlapped, they line
up exactly, and the result is a light-colored block (with half black and half white
pixels). Each black pixel in the original logo is split into two complementary small
blocks. When these two blocks are overlapped, the result is a completely black box.
 If each pixel in the original image is split randomly as described above, then each
individual share is a totally random collection of blocks. Only when the shares are
combined is any information revealed about the original image.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 38 SJCET
CHAPTER-4
SYSTEM DESIGN
4.1.Block Diagram
Fig 4.1: Block Diagram of VCS
4.2. PLAIN TEXT:
The message in its original-human readable-form is called Plain text.
In cryptography, plaintext is information a sender wishes to transmit to a
receiver. Cleartext is often used as a synonym. Plaintext has reference to the
operation of cryptographic algorithms, usually encryption algorithms, and is the
input upon which they operate. Cleartext, by contrast, refers to data that is
transmitted or stored unencrypted.
4.2.1. Overview of Plain Text:
Before the computer era, plaintext most commonly meant message text in the
language of the communicating parties. Since computers became commonly
available, the definition has expanded to include:
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 39 SJCET
 messages (for example, email messages)
 document content such as word processor and spreadsheet files
 audio and video files, digital photographs and any other multimedia
 files containing other files such as Zip files or ISO images
 ATM, credit card and other banking information
 sensor data
 any other data that a person wishes to keep private
Much of this data is not directly meaningful to humans, being already
transformed into computer manipulable forms. While the original definition implied
that the message could be read by a human being, the modern definition emphasizes
that a person using a computer could easily interpret the data.
Any information which the communicating parties wish to conceal from
others can now be treated, and referred to, as plaintext. Thus, in a significant sense,
plaintext is the 'normal' representation of data before any action has been taken to
conceal, compress, or 'digest' it. It need not represent text, and even if it does, the
text may not be "plain".
Plaintext is used as input to an encryption algorithm the output is usually
termed ciphertext particularly when the algorithm is a cipher. Codetext is less often
used, and almost always only when the algorithm involved is actually a code. In
some systems, however, multiple layers of encryption are used, in which case the
output of one encryption algorithm becomes plaintext input for the next.
4.2.2. Secure handling of plaintext :
In a cryptosystem, weaknesses can be introduced through insecure handling
of plaintext, allowing an attacker to bypass the cryptography altogether. Plaintext is
vulnerable in use and in storage, whether in electronic or paper format. Physical
security deals with methods of securing information and its storage media from
local, physical, attacks. For instance, an attacker might enter a poorly secured
building and attempt to open locked desk drawers or safes. An attacker can also
engage in dumpster diving, and may be able to reconstruct shredded information if it
is sufficiently valuable to be worth the effort. One countermeasure is to burn or
thoroughly crosscut shred discarded printed plaintexts or storage media; NSA is
infamous for its disposal security precautions.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 40 SJCET
If plaintext is stored in a computer file (and the situation of automatically
made backup files generated during program execution must be included here, even
if invisible to the user), the storage media along with the entire computer and its
components must be secure. Sensitive data is sometimes processed on computers
whose mass storage is removable, in which case physical security of the removed
disk is separately vital. In the case of securing a computer, useful (as opposed
to hand waving) security must be physical (e.g., against burglary, brazen removal
under cover of supposed repair, installation of covert monitoring devices, etc.), as
well as virtual (e.g., operating system modification, illicit network access,
Trojan programs, ...). The wide availability of key drives, which can plug into most
modern computers and store large quantities of data, poses another severe security
headache. A spy (perhaps posing as a cleaning person) could easily conceal one and
even swallow it, if necessary.
Discarded computers, disk drives and media are also a potential source of
plaintexts. Most operating systems do not actually erase anything — they simply
mark the disk space occupied by a deleted file as 'available for use', and remove its
entry from the file system directory. The information in a file deleted in this way
remains fully present until overwritten at some later time when the operating system
reuses the disk space. With even low-end computers commonly sold with many
gigabytes of disk space and rising monthly, this 'later time' may be months later, or
never. Even overwriting the portion of a disk surface occupied by a deleted file is
insufficient in many cases. Peter Gutmann of the University of Auckland wrote a
celebrated 1996 paper on the recovery of overwritten information from magnetic
disks; areal storage densities have gotten much higher since then, so this sort of
recovery is likely to be more difficult than it was when Gutmann wrote.
Also, independently, modern hard drives automatically remap sectors that are
starting to fail; those sectors no longer in use will contain information that is
entirely invisible to the file system (and all software which uses it for access to disk
data), but is nonetheless still present on the physical drive platter. It may, of course,
be sensitive plaintext. Some government agencies (e.g., NSA) require that all disk
drives be physically pulverized when they are discarded, and in some cases,
chemically treated with corrosives before or after. This practice is not widespread
outside of the government, however. For example, Garfinkel and Shelat (2003)
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 41 SJCET
analyzed 158 second-hand hard drives acquired at garage sales and the like and
found that less than 10% had been sufficiently sanitized. A wide variety of personal
and confidential information was found readable from the others. See data
remanence.
Laptop computers are a special problem. The US State Department, the
British Secret Service, and the US Department of Defense have all had laptops
containing secret information,some perhaps in plaintext form, 'vanish' in recent
years. Announcements of similar losses are becoming a common item in news
reports. Disk encryption techniques can provide protection against such loss or theft
if properly chosen and used.
On occasion, even when the data on the host systems is itself encrypted, the
media used to transfer data between such systems is nevertheless plaintext due to
poorly designed data policy. An incident in October 2007 in which HM Revenue
and Customs lost CDs containing no less than the records of 25 million child
benefit recipients in the United Kingdom the data apparently being entirely
unencrypted is a case in point.
Modern cryptographic systems are designed to resist known plaintext or
even chosen plaintext attacks and so may not be entirely compromised when
plaintext is lost or stolen. Older systems used techniques such
as padding and Russian copulation to obscure information in plaintext that could be
easily guessed, and to resist the effects of loss of plaintext on the security of the
cryptosystem.
4.3. CIPHER TEXT:
The message in its coded human unreadable form is called Cipher text.
In cryptography, ciphertext (or cyphertext) is the result of encryption performed
on plaintext using an algorithm, called a cipher. Ciphertext is also known as
encrypted or encoded information because it contains a form of the original plaintext
that is unreadable by a human or computer without the proper cipher to decrypt
it. Decryption, the inverse of encryption, is the process of turning ciphertext into
readable plaintext. Ciphertext is not to be confused with code text because the latter
is a result of a code, not a cipher.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 42 SJCET
4.3.1. Types of Ciphers:
The history of cryptography began thousands of years ago. Cryptography
uses a variety of different types of encryption. Earlier algorithms were performed by
hand and are substantially different from modern algorithms, which are generally
executed by a machine.
(a)Historical ciphers:
Historical pen and paper ciphers used in the past are sometimes known
as classical ciphers. They include:
(b)Substitution cipher:
The units of plaintext are replaced with ciphertext (Caesar Cipher and one-
time pad).In cryptography, a substitution cipher is a method of encoding by which
units of plaintext are replaced with ciphertext, according to a regular system; the
"units" may be single letters (the most common), pairs of letters, triplets of letters,
mixtures of the above, and so forth. The receiver deciphers the text by performing
an inverse substitution.
Substitution ciphers can be compared with transposition ciphers. In a
transposition cipher, the units of the plaintext are rearranged in a different and
usually quite complex order, but the units themselves are left unchanged. By
contrast, in a substitution cipher, the units of the plaintext are retained in the same
sequence in the ciphertext, but the units themselves are altered.
There are a number of different types of substitution cipher. If the cipher
operates on single letters, it is termed a simple substitution cipher; a cipher that
operates on larger groups of letters is termed polygraphic. A monoalphabetic
cipher uses fixed substitution over the entire message, whereas a polyalphabetic
cipher uses a number of substitutions at different positions in the message, where a
unit from the plaintext is mapped to one of several possibilities in the ciphertext and
vice versa.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 43 SJCET
(c)Transposition cipher: the ciphertext is a permutation of the plaintext (Rail fence
cipher). In cryptography, a transposition cipher is a method of encryption by which
the positions held by units of plaintext (which are commonly characters or groups of
characters) are shifted according to a regular system, so that the ciphertext
constitutes a permutation of the plaintext. That is, the order of the units is changed
(the plaintext is reordered). Mathematically a bijective function is used on the
characters' positions to encrypt and an inverse function to decrypt.
These are two types
 Rail Fence cipher
 Route cipher
(d)Polyalphabetic cipher: A substitution cipher using multiple substitution
alphabets (Vigenère cipher and Enigma machine)
A polyalphabetic cipher is any cipher based on substitution, using multiple
substitution alphabets. The Vigenère cipher is probably the best-known example of
a polyalphabetic cipher, though it is a simplified special case. The Enigma
machine is more complex but still fundamentally a polyalphabetic substitution
cipher.
The Alberti cipher by Leon Battista Alberti around 1467 was believed to be
the first polyalphabetic cipher. Alberti used a mixed alphabet to encrypt a message,
but whenever he wanted to, he would switch to a different alphabet, indicating that
he had done so by including an uppercase letter or a number in the cryptogram. For
this encipherment Alberti used a decoder device, his cipher disk, which
implemented a polyalphabetic substitution with mixed alphabets.
Although Alberti is usually considered the father of polyalphabetic cipher, it
has been claimed that polyalphabetic ciphers may have been developed by the Arab
cryptologist Al Kindi 600 years before Alberti. Johannes Trithemius in his
bookPolygraphiae libri sex (Six books of polygraphia), which was published in
1518 after his death invented a progressive keypolyalphabetic cipher called
the Trithemius cipher. Unlike Alberti's cipher, which switched alphabets at random
intervals, Trithemius switched alphabets for each letter of the message. He started
with a tabula recta, a square with 26 alphabets in it (although Trithemius, writing
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 44 SJCET
in Latin, used 24 alphabets). Each alphabet was shifted one letter to the left from the
one above it, and started again with A after reaching Z (see image).
Fig 4.2: Tabula recta
Trithemius's idea was to encipher the first letter of the message using the first
shifted alphabet, so A became B, B became C, etc. The second letter of the message
was enciphered using the second shifted alphabet, etc. Alberti's cipher disk
implemented the same scheme. It had two alphabets, one on a fixed outer ring, and
the other on the rotating disk. A letter is enciphered by looking for that letter on the
outer ring, and encoding it as the letter underneath it on the disk. The disk started
with A underneath B, and the user rotated the disk by one letter after encrypting
each letter.
The cipher was trivial to break, and Alberti's machine implementation not
much more difficult. Key progression in both cases was poorly concealed from
attackers. Even Alberti's implementation of his polyalphabetic cipher was rather
easy to break (the capitalized letter is a major clue to the cryptanalyst). For most of
the next several hundred years, the significance of using multiple substitution
alphabets was missed by almost everyone. Polyalphabetic substitution cipher
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 45 SJCET
designers seem to have concentrated on obscuring the choice of a few such
alphabets (repeating as needed), not on the increased security possible by using
many and never repeating any.
The principle (particularly Alberti's unlimited additional substitution
alphabets) was a major advance the most significant in the several hundred years
since frequency analysis had been developed. A reasonable implementation would
have been (and, when finally achieved, was) vastly harder to break. It was not until
the mid-19th century (in Babbage's secret work during the Crimean
War and Friedrich Kasiski's generally equivalent public disclosure some years
later), that cryptanalysis of well-implemented polyalphabetic ciphers got anywhere
at all.
4.3.1.1. Permutation cipher:
In classical cryptography, a permutation cipher is a transposition cipher in
which the key is a permutation.
To apply a cipher, a random permutation of size e is generated (the larger the
value of e the more secure the cipher). The plaintext is then broken into segments of
size e and the letters within that segment are permuted according to this key.
In theory, any transposition cipher can be viewed as a permutation cipher
where e is equal to the length of the plaintext; this is too cumbersome a
generalisation to use in actual practice, however.
4.3.1.2. Identifying the cipher:
Because the cipher doesn't change any of the characters, the ciphertext will
have exactly the same letter frequencies as the underlying plaintext. This means that
the cipher can in many cases be identified as a transposition by the close similarity
of its letter statistics with the letter frequencies of the underlying language.
4.3.1.3. Breaking the cipher:
Because the cipher operates on blocks of size e, the plaintext and the
ciphertext have to have a length which is some multiple of e. This causes two
weaknesses in the system: first, the plaintext may have to be padded (if the padding
is identifiable then part of the key is revealed ) and second, information relating to
the length of the key is revealed by the length of the ciphertext. To see this, note
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 46 SJCET
that if the ciphertext is of length i then e must be one of the divisors of i. With the
different possible key sizes different possible permutations are tried to find the
permutation which results in the highest number of
frequent bigrams and trigrams as found in the underlying language of the plaintext.
Trying to find this permutation is essentially the same problem encountered when
analysing a columnar transposition cipher: multiple anagramming.
4.4. ENCRYPTION:
The process of converting plain text into cipher text is called Encryption
Encryption involves creating “shares” of the image which in a sense will be a
piece of the image.
In cryptography, encryption is the process of encoding messages or
information in such a way that only authorized parties can read it. Encryption does
not of itself prevent interception, but denies the message content to the
interceptor. In an encryption scheme, the message or information, referred to
as plaintext, is encrypted using an encryption algorithm, generating ciphertext that
can only be read if decrypted. For technical reasons, an encryption scheme usually
uses a pseudo-random encryption key generated by an algorithm. It is in principle
possible to decrypt the message without possessing the key, but, for a well-designed
encryption scheme, large computational resources and skill are required. An
authorized recipient can easily decrypt the message with the key provided by the
originator to recipients, but not to unauthorised interceptors.
They are two encryption keys
1. Symmetric key 2.public key encryptions
But we are not using keys where we are using shares.
Share generation
2 out of 2 scheme(4sub pixels)
• Each pixel encoded as
• a 2x2 cell
• in two shares
• Each share has 2 black, 2 white sub pixels
• When stacked, shares combine to
• Solid black
Half black (seen as gray)
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 47 SJCET
4.4.1. IMPLEMENTATION:
Fig 4.3:Implementation of 2 out of 2 scheme
4.4.1.1. Uses of Encryption:
Encryption has long been used by militaries and governments to facilitate
secret communication. It is now commonly used in protecting information within
many kinds of civilian systems. For example, the Computer Security
Institute reported that in 2007, 71% of companies surveyed utilized encryption for
some of their data in transit, and 53% utilized encryption for some of their data in
storage. Encryption can be used to protect data "at rest", such as files on computers
and storage devices (e.g. USB flash drives). In recent years there have been
numerous reports of confidential data such as customers' personal records being
exposed through loss or theft of laptops or backup drives. Encrypting such files at
rest helps protect them should physical security measures fail. Digital rights
management systems, which prevent unauthorized use or reproduction of
copyrighted material and protect software against reverse engineering (see
also copy protection), is another somewhat different example of using encryption
on data at rest.
Encryption is also used to protect data in transit, for example data being
transferred via networks (e.g. the Internet, e-commerce), mobile
telephones, wireless microphones, wireless intercom systems, Bluetooth devices
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 48 SJCET
and bank automatic teller machines. There have been numerous reports of data in
transit being intercepted in recent years. Encrypting data in transit also helps to
secure it as it is often difficult to physically secure all access to networks.
4.4.1.2. Message verification:
Encryption, by itself, can protect the confidentiality of messages, but
other techniques are still needed to protect the integrity and authenticity of a
message; for example, verification of a message authentication code (MAC) or
a digital signature. Standards for cryptographic software and hardware to perform
encryption are widely available, but successfully using encryption to ensure security
may be a challenging problem. A single error in system design or execution can
allow successful attacks. Sometimes an adversary can obtain unencrypted
information without directly undoing the encryption. See, e.g., traffic
analysis, TEMPEST, or Trojan horse.
Digital signature and encryption must be applied to the ciphertext when it is
created (typically on the same device used to compose the message) to avoid
tampering; otherwise any node between the sender and the encryption agent could
potentially tamper with it. Encrypting at the time of creation is only secure if the
encryption device itself has not been tampered with.
4.5. DECRYPTION:
The process of converting cipher text into plain text is called Decryption.
Decryption involving bringing together an appropriate combination and the human
visual system.
Decryption is the process of taking encoded or encrypted text or other data
and converting it back into text that you or the computer can read and understand.
This term could be used to describe a method of un-encrypting the data manually or
with un-encrypting the data using the proper codes or keys.
Data may be encrypted to make it difficult for someone to steal the
information. Some companies also encrypt data for general protection of company
data and trade secrets. If this data needs to be viewable, it may require decryption. If
a decryption passcode or key is not available, special software may be needed to
decrypt the data using algorithms to crack the decryption and make the data
readable.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 49 SJCET
Derived from the name of the mathematician Muhammed ibn-Musa Al-
Khowarizmi, an algorithm is a list of instructions, procedures, or formulas used to
solve a problem. Today, algorithms are used millions of times every day for a variety
of tasks. For example, an algorithm could look at an incoming e-mail to determine if
it is spam or a legitimate e-mail and discard only spam messages. Ada Lovelace is
credited as being the first person to develop an algorithm for a machine.
Decryption is the process of transforming data that has been rendered
unreadable through encryption back to its unencrypted form. In decryption, the
system extracts and converts the garbled data and transforms it to texts and images
that are easily understandable not only by the reader but also by the system.
Decryption may be accomplished manually or automatically. It may also be
performed with a set of keys or passwords.
One of the foremost reasons for implementing an encryption-decryption
system is privacy. As information travels over the World Wide Web, it becomes
subject to scrutiny and access from unauthorized individuals or organizations. As a
result, data is encrypted to reduce data loss and theft. Some of the common items
that are encrypted include email messages, text files, images, user data and
directories. The person in charge of decryption receives a prompt or window in
which a password may be entered to access encrypted information.
Decryption is the reverse process to Encryption. Frequently, the same Cipher
is used for both Encryption and Decryption. While Encryption creates a Ciphertext
from a Plaintext, Decryption creates a Plaintext from a Ciphertext.
Sender :The main function of the sender is it encrypts the plain text to cipher
text,that is in the human readable form.The examples of plain text is a text
document,an executable file or an image.
Receiver :The function of receiver is it decrypts the cipher text to plain text,that is
is the scrambled version of plain text and it is not understandable form.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 50 SJCET
CHAPTER-5
TOOL OUTLINE
5.1 Introduction to 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
 Math and computation Algorithm development
 Data acquisition
 Modeling, simulation, and prototyping
 Data analysis, exploration, and visualization
 Scientific and engineering graphics
 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 vecto 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 (Mfiles) that extend the MATLAB environment to solve
particular classes of problems. Areas in which toolboxes are available include signal
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 51 SJCET
processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and
many others.
The tutorials are independent of the rest of the document. The primarily
objective is to help you learn quickly the ¯rst steps. The emphasis here is “learning
by doing". Therefore, the best way to learn is by trying it yourself. Working through
the examples will give you a feel for the way that MATLAB operates. In this
introduction we will describe how MATLAB handles simple numerical expressions
and mathematical formulas.
The name MATLAB stands for MATrix LABoratory. MATLAB was written
originally to provide easy access to matrix software developed by the LINPACK
(linear system package) and EISPACK (Eigen system package) projects. MATLAB
is a high-performance language for technical computing. It integrates computation,
visualization, and programming environment. Furthermore, MATLAB is a modern
programming language environment: it has sophisticated data structures, contains
built-in editing and debugging tools, and supports object-oriented programming.
These factors make MATLAB an excellent tool for teaching and research.
MATLAB has many advantages compared to conventional computer
languages (e.g., C, FORTRAN) for solving technical problems. MATLAB is an
interactive system whose basic data element is an array that does not require
dimensioning. The software package has been commercially available since 1984
and is now considered as a standard tool at most universities and industries
worldwide. It has powerful built-in routines that enable a very wide variety of
computations. It also has easy to use graphics commands that make the visualization
of results immediately available. Specific applications are collected in packages
referred to as toolbox. There are toolboxes for signal processing, symbolic
computation, control theory, simulation, optimiza-tion, and several other fields of
applied science and engineering.
5.1.1. Basic features
As we mentioned earlier, the following tutorial lessons are designed to get you
started quickly in MATLAB. The lessons are intended to make you familiar with the
basics of MATLAB. We urge you to complete the exercises given at the end of each
lesson.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 52 SJCET
5.1.2. Starting MATLAB
After logging into your account, you can enter MATLAB by double-clicking
on the MATLAB shortcut icon (MATLAB 7.0.4) on your Windows desktop. When
you start MATLAB, a special window called the MATLAB desktop appears. The
desktop is a window that contains other windows. The major tools within or
accessible from the desktop are:
 The Command Window
 The Command History
 The Workspace
 The Current Directory
 The Help Browser
 The Start button
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 Library-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 eigenvalues, Bessel functions, and fast Fourier transforms. The MATLAB
Language- This is a highlevel 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 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
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 53 SJCET
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
Fortran programs 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.
5.2 Language Description
5.2.1 The MATLAB System
The MATLAB system consists of five main parts:
5.2.2 Development Environment.
Development Environment Include the set of tools and facilities that help us
use MATLAB functions and files. Many of these tools are graphical user interfaces.
Mat lab by itself can be used as a calculator, where all the calculations are done at
the command prompt. Mat lab 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.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 54 SJCET
Figure 5.1: Basic view of Mat lab.
Mat lab is a copyright of Math Works Incorporation. The Math Works is
committed to making MATLAB as fast as 3GL programming languages, like C and
FORTRAN. The basic windows that help the user use Mat lab are five.
These five windows are to enable ease access and interaction with Mat lab.
These windows include,
 The Command Window
 Command history
 Workspace Browser
 Current Directory
 Launch Pad
Apart from these windows, the main Matlab window is called The Matlab
desktop. If all the above shown windows are closed, then what we see is the Matlab
desktop. This window is the main window and opens when Matlab starts and closes
only when Matlab exists. In other words, exiting Matlab means closing or quitting
this Matlab desktop. The figure below shows how this Matlab desktop looks.
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 55 SJCET
Fig 5.2 Matlab Desktop
This window is the main window but do not provide any access to Matlab
commands or functions. To interact with Matlab we need the first window ofthe
above listed windows, The Command window. Shown in figure3, is The Command
window. In the command window, we have the command prompt .This command
prompt is just like the dos prompt where we type all the commands so that Matlab
can understand the commands and give us the desired output. This is the point of
interaction between the user and Matlab. We type different commands at the
command prompt in the command window to execute our programs and achieve the
desired tasks.
Let us assume that we have a variable ‘a’, which has to hold the value
‘115’. So declare this variable, as we do in any other language, we say,
>> a=115 this statement declares the variable, a and assigns it the value 115.
Now declaring some more variables,
>> b=2 ; >> c=10;
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 56 SJCET
Figure5.3: The Command Window
>> myvar=1001
>> var1=2001;
See the figure4 below and observe the difference between declaring the variables
using a semicolon (‘;’) at the end of the declaration.
Figure5.4: Variables
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 57 SJCET
From the figure we can observe that, for the declarations made using the ‘;’,
there is no display of the variable and the value. And for those variables declared
without ‘;’, the variable and its corresponding value is displayed immediately after
the execution of the command (Any command is executed just by pressing the return
key.). To clear the command window, we use the command, >> clc this command
clears the command window. This is a basic command in Matlab.
Matlab is case-sensitive hence the command typed
>> a=115 is far different from the command
>> A=115 these two commands creates two variables, ‘a’ and assigns 115 and
‘A’ and assigns the value 115.
The next window in the above listed sequence is The Command History.
By its name we can say that it is nothing but the history of the commands typed at
the command prompt. See figure5 for the Command History.
Statements you enter in the Command Window are logged in the Command History.
All the statements we can see in the command history are the commands typed at the
command prompt. There is a time stamp at the beginning of the window, which
denotes the start of each session of Matlab.
Figure5.5: The Command History
The command history not only stores the Matlab commands but it also stores
everything what ever is typed at the command prompt. E.g.: the ‘abcdef’ in the
ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB
Dept of ECE 58 SJCET
command history. This ‘abcdef’ is not a valid Matlab command but still is store in
the command history since it is typed at the command prompt. The next window is
The Workspace Browser. The MATLAB workspace consists of the set of variables
(named arrays) built up during a MATLAB session and stored in memory. You add
variables to the workspace by using functions, running M-files, and loading saved
workspaces. To view the workspace and information about each variable, use the
Workspace browser.
Figure5.6: Workspace Browser
5.3 Image Processing schemes
Image processing is referred to processing of a 2D picture by a computer.
Basic definitions: An image defined in the “real world” is considered to be a
function of two real variables, for example, a(x,y) with a as the amplitude (e.g.
brightness) of the image at the real coordinate position (x,y). Modern digital
technology has made it possible to manipulate multidimensional signals with
systems that range from simple digital circuits to advanced parallel computers. The
goal of this manipulation can be divided into three categories:
 Image Processing (image in -> image out)
 Image Analysis (image in -> measurements out)
 Image Understanding (image in -> high-level description out)
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc
main doc

More Related Content

What's hot

Hierarchical Key Agreement Protocol for Wireless Sensor Networks
Hierarchical Key Agreement Protocol for Wireless Sensor NetworksHierarchical Key Agreement Protocol for Wireless Sensor Networks
Hierarchical Key Agreement Protocol for Wireless Sensor Networksidescitation
 
Image and text Encryption using RSA algorithm in java
Image and text Encryption using RSA algorithm in java  Image and text Encryption using RSA algorithm in java
Image and text Encryption using RSA algorithm in java PiyushPatil73
 
IMAGE ENCRYPTION TECHNIQUES USING FRACTAL FUNCTION: A REVIEW
IMAGE ENCRYPTION TECHNIQUES USING FRACTAL FUNCTION: A REVIEWIMAGE ENCRYPTION TECHNIQUES USING FRACTAL FUNCTION: A REVIEW
IMAGE ENCRYPTION TECHNIQUES USING FRACTAL FUNCTION: A REVIEWijcsit
 
Lsb hiding using random approach for image watermarking
Lsb hiding using random approach for image watermarkingLsb hiding using random approach for image watermarking
Lsb hiding using random approach for image watermarkingeSAT Publishing House
 
Lsb hiding using random approach for image watermarking
Lsb hiding using random approach for image watermarkingLsb hiding using random approach for image watermarking
Lsb hiding using random approach for image watermarkingeSAT Journals
 
Certificate less key management scheme in
Certificate less key management scheme inCertificate less key management scheme in
Certificate less key management scheme inIJNSA Journal
 
Techniques of lattice based
Techniques of lattice basedTechniques of lattice based
Techniques of lattice basedijcsa
 
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATIONSPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATIONShakas Technologies
 
IRJET- A Probabilistic Model of Visual Cryptography Scheme for Anti-Phis...
IRJET-  	  A Probabilistic  Model of Visual Cryptography Scheme for Anti-Phis...IRJET-  	  A Probabilistic  Model of Visual Cryptography Scheme for Anti-Phis...
IRJET- A Probabilistic Model of Visual Cryptography Scheme for Anti-Phis...IRJET Journal
 
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
 SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATIONNexgen Technology
 
Identity based Encryption Utilizing Revocable Capacity of Distributed Computi...
Identity based Encryption Utilizing Revocable Capacity of Distributed Computi...Identity based Encryption Utilizing Revocable Capacity of Distributed Computi...
Identity based Encryption Utilizing Revocable Capacity of Distributed Computi...ijtsrd
 
Image Cryptography using RSA Algorithm
Image Cryptography using RSA AlgorithmImage Cryptography using RSA Algorithm
Image Cryptography using RSA Algorithmijtsrd
 

What's hot (15)

call for papers, research paper publishing, where to publish research paper, ...
call for papers, research paper publishing, where to publish research paper, ...call for papers, research paper publishing, where to publish research paper, ...
call for papers, research paper publishing, where to publish research paper, ...
 
Hierarchical Key Agreement Protocol for Wireless Sensor Networks
Hierarchical Key Agreement Protocol for Wireless Sensor NetworksHierarchical Key Agreement Protocol for Wireless Sensor Networks
Hierarchical Key Agreement Protocol for Wireless Sensor Networks
 
R04405103106
R04405103106R04405103106
R04405103106
 
Image and text Encryption using RSA algorithm in java
Image and text Encryption using RSA algorithm in java  Image and text Encryption using RSA algorithm in java
Image and text Encryption using RSA algorithm in java
 
BIOMETRIC REMOTE AUTHENTICATION
BIOMETRIC REMOTE AUTHENTICATIONBIOMETRIC REMOTE AUTHENTICATION
BIOMETRIC REMOTE AUTHENTICATION
 
IMAGE ENCRYPTION TECHNIQUES USING FRACTAL FUNCTION: A REVIEW
IMAGE ENCRYPTION TECHNIQUES USING FRACTAL FUNCTION: A REVIEWIMAGE ENCRYPTION TECHNIQUES USING FRACTAL FUNCTION: A REVIEW
IMAGE ENCRYPTION TECHNIQUES USING FRACTAL FUNCTION: A REVIEW
 
Lsb hiding using random approach for image watermarking
Lsb hiding using random approach for image watermarkingLsb hiding using random approach for image watermarking
Lsb hiding using random approach for image watermarking
 
Lsb hiding using random approach for image watermarking
Lsb hiding using random approach for image watermarkingLsb hiding using random approach for image watermarking
Lsb hiding using random approach for image watermarking
 
Certificate less key management scheme in
Certificate less key management scheme inCertificate less key management scheme in
Certificate less key management scheme in
 
Techniques of lattice based
Techniques of lattice basedTechniques of lattice based
Techniques of lattice based
 
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATIONSPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
 
IRJET- A Probabilistic Model of Visual Cryptography Scheme for Anti-Phis...
IRJET-  	  A Probabilistic  Model of Visual Cryptography Scheme for Anti-Phis...IRJET-  	  A Probabilistic  Model of Visual Cryptography Scheme for Anti-Phis...
IRJET- A Probabilistic Model of Visual Cryptography Scheme for Anti-Phis...
 
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
 SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
SPACE-EFFICIENT VERIFIABLE SECRET SHARING USING POLYNOMIAL INTERPOLATION
 
Identity based Encryption Utilizing Revocable Capacity of Distributed Computi...
Identity based Encryption Utilizing Revocable Capacity of Distributed Computi...Identity based Encryption Utilizing Revocable Capacity of Distributed Computi...
Identity based Encryption Utilizing Revocable Capacity of Distributed Computi...
 
Image Cryptography using RSA Algorithm
Image Cryptography using RSA AlgorithmImage Cryptography using RSA Algorithm
Image Cryptography using RSA Algorithm
 

Similar to main doc

Paper id 212014107
Paper id 212014107Paper id 212014107
Paper id 212014107IJRAT
 
IJAER Publishes
IJAER PublishesIJAER Publishes
IJAER PublishesAmAl C
 
11.biometric data security using recursive visual cryptography
11.biometric data security using recursive visual cryptography11.biometric data security using recursive visual cryptography
11.biometric data security using recursive visual cryptographyAlexander Decker
 
A Novel Scheme for Mutual Authentication and Cheating Prevention in Visual Cr...
A Novel Scheme for Mutual Authentication and Cheating Prevention in Visual Cr...A Novel Scheme for Mutual Authentication and Cheating Prevention in Visual Cr...
A Novel Scheme for Mutual Authentication and Cheating Prevention in Visual Cr...IDES Editor
 
A comparatively study on visual cryptography
A comparatively study on visual cryptographyA comparatively study on visual cryptography
A comparatively study on visual cryptographyeSAT Journals
 
IMPACT OF ERROR FILTERS ON SHARES IN HALFTONE VISUAL CRYPTOGRAPHY
IMPACT OF ERROR FILTERS ON SHARES IN HALFTONE VISUAL CRYPTOGRAPHYIMPACT OF ERROR FILTERS ON SHARES IN HALFTONE VISUAL CRYPTOGRAPHY
IMPACT OF ERROR FILTERS ON SHARES IN HALFTONE VISUAL CRYPTOGRAPHYcscpconf
 
MEANINGFUL AND UNEXPANDED SHARES FOR VISUAL SECRET SHARING SCHEMES
MEANINGFUL AND UNEXPANDED SHARES FOR VISUAL SECRET SHARING SCHEMESMEANINGFUL AND UNEXPANDED SHARES FOR VISUAL SECRET SHARING SCHEMES
MEANINGFUL AND UNEXPANDED SHARES FOR VISUAL SECRET SHARING SCHEMESijiert bestjournal
 
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...IJCSEA Journal
 
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...IJCSEA Journal
 
A Joint Encryption/Watermarking Algorithm for Secure Image Transfer
A Joint Encryption/Watermarking Algorithm for Secure Image TransferA Joint Encryption/Watermarking Algorithm for Secure Image Transfer
A Joint Encryption/Watermarking Algorithm for Secure Image Transferijcnac
 
DWT-SVD BASED SECURED IMAGE WATERMARKING FOR COPYRIGHT PROTECTION USING VISUA...
DWT-SVD BASED SECURED IMAGE WATERMARKING FOR COPYRIGHT PROTECTION USING VISUA...DWT-SVD BASED SECURED IMAGE WATERMARKING FOR COPYRIGHT PROTECTION USING VISUA...
DWT-SVD BASED SECURED IMAGE WATERMARKING FOR COPYRIGHT PROTECTION USING VISUA...cscpconf
 
Digital Image Sharing Using NVSS
Digital Image Sharing Using NVSSDigital Image Sharing Using NVSS
Digital Image Sharing Using NVSSIRJET Journal
 
Unified Approach With Neural Network for Authentication, Security and Compres...
Unified Approach With Neural Network for Authentication, Security and Compres...Unified Approach With Neural Network for Authentication, Security and Compres...
Unified Approach With Neural Network for Authentication, Security and Compres...CSCJournals
 
A Survey on Visual Cryptography Schemes
A Survey on Visual Cryptography Schemes  A Survey on Visual Cryptography Schemes
A Survey on Visual Cryptography Schemes AmAl C
 

Similar to main doc (20)

Paper id 212014107
Paper id 212014107Paper id 212014107
Paper id 212014107
 
IJAER Publishes
IJAER PublishesIJAER Publishes
IJAER Publishes
 
11.biometric data security using recursive visual cryptography
11.biometric data security using recursive visual cryptography11.biometric data security using recursive visual cryptography
11.biometric data security using recursive visual cryptography
 
A Novel Scheme for Mutual Authentication and Cheating Prevention in Visual Cr...
A Novel Scheme for Mutual Authentication and Cheating Prevention in Visual Cr...A Novel Scheme for Mutual Authentication and Cheating Prevention in Visual Cr...
A Novel Scheme for Mutual Authentication and Cheating Prevention in Visual Cr...
 
Improved extended
Improved extendedImproved extended
Improved extended
 
A comparatively study on visual cryptography
A comparatively study on visual cryptographyA comparatively study on visual cryptography
A comparatively study on visual cryptography
 
IMPACT OF ERROR FILTERS ON SHARES IN HALFTONE VISUAL CRYPTOGRAPHY
IMPACT OF ERROR FILTERS ON SHARES IN HALFTONE VISUAL CRYPTOGRAPHYIMPACT OF ERROR FILTERS ON SHARES IN HALFTONE VISUAL CRYPTOGRAPHY
IMPACT OF ERROR FILTERS ON SHARES IN HALFTONE VISUAL CRYPTOGRAPHY
 
Fz2510901096
Fz2510901096Fz2510901096
Fz2510901096
 
390
390390
390
 
Visual Cryptography
Visual CryptographyVisual Cryptography
Visual Cryptography
 
Fx3610771081
Fx3610771081Fx3610771081
Fx3610771081
 
MEANINGFUL AND UNEXPANDED SHARES FOR VISUAL SECRET SHARING SCHEMES
MEANINGFUL AND UNEXPANDED SHARES FOR VISUAL SECRET SHARING SCHEMESMEANINGFUL AND UNEXPANDED SHARES FOR VISUAL SECRET SHARING SCHEMES
MEANINGFUL AND UNEXPANDED SHARES FOR VISUAL SECRET SHARING SCHEMES
 
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
 
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
IMAGE RECOGNITION-BASED AUTOMATIC DECRYPTION METHOD FOR TEXT ENCRYPTED USING ...
 
A Joint Encryption/Watermarking Algorithm for Secure Image Transfer
A Joint Encryption/Watermarking Algorithm for Secure Image TransferA Joint Encryption/Watermarking Algorithm for Secure Image Transfer
A Joint Encryption/Watermarking Algorithm for Secure Image Transfer
 
DWT-SVD BASED SECURED IMAGE WATERMARKING FOR COPYRIGHT PROTECTION USING VISUA...
DWT-SVD BASED SECURED IMAGE WATERMARKING FOR COPYRIGHT PROTECTION USING VISUA...DWT-SVD BASED SECURED IMAGE WATERMARKING FOR COPYRIGHT PROTECTION USING VISUA...
DWT-SVD BASED SECURED IMAGE WATERMARKING FOR COPYRIGHT PROTECTION USING VISUA...
 
Digital Image Sharing Using NVSS
Digital Image Sharing Using NVSSDigital Image Sharing Using NVSS
Digital Image Sharing Using NVSS
 
Kaur2013
Kaur2013Kaur2013
Kaur2013
 
Unified Approach With Neural Network for Authentication, Security and Compres...
Unified Approach With Neural Network for Authentication, Security and Compres...Unified Approach With Neural Network for Authentication, Security and Compres...
Unified Approach With Neural Network for Authentication, Security and Compres...
 
A Survey on Visual Cryptography Schemes
A Survey on Visual Cryptography Schemes  A Survey on Visual Cryptography Schemes
A Survey on Visual Cryptography Schemes
 

main doc

  • 1. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 1 SJCET CHAPTER -1 INTRODUCTION 1.1 Overview: The basic principle of the visual cryptography scheme (VCS) was first introduced by Naor and Shamir. VCS is a kind of secret sharing scheme that focuses on sharing secret images. The idea of the visual cryptography model proposed in is to split a secret image into two random shares (printed on transparencies) which separately reveals no information about the secret image other than the size of the secret image. The secret image can be reconstructed by stacking the two shares. The underlying operation of this scheme is logical operation OR. In this paper, we call a VCS with random shares the traditional VCS or simply the VCS. In general, a traditional VCS takes a secret image as input, and outputs shares that satisfy two conditions: 1) any qualified subset of shares can recover the secret image; 2) any forbidden subset of shares cannot obtain any information of the secret image other than the size of the secret image but after stacking shares ,the secret image can be observed visually by the participants. VCS has many special applications, for example, transmitting military orders to soldiers who may have no cryptographic knowledge or computation devices in the battle field. Many other applications of VCS, other than its original objective (i.e., sharing secret image), have been found, for example, authentication and identification, watermarking and transmitting passwords etc. The associated secret sharing problem and its physical properties such as contrast, pixel expansion, and color were extensively studied by researchers worldwide. For example, showed constructions of threshold VCS with perfect reconstruction of the black pixels. Secret sharing schemes are ideal for storing information that is highly sensitive and highly important. Examples include: encryption keys, missile launch codes.Each of these pieces of information must be kept highly confidential, as their exposure could be disastrous, however, it is also critical that they should not be lost. Traditional methods for encryption are ill-suited for simultaneously achieving high
  • 2. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 2 SJCET levels of confidentiality and reliability. This is because when storing the encryption key, one must choose between keeping a single copy of the key in one location for maximum secrecy, or keeping multiple copies of the key in different locations for greater reliability. Increasing reliability of the key by storing multiple copies lowers confidentiality by creating additional attack vectors; there are more opportunities for a copy to fall into the wrong hands. Secret sharing schemes address this problem, and allow arbitrarily high levels of confidentiality and reliability to be achieved. The (2, 2) VC scheme divides the secret image into two shares so that reconstruction of an image from a share is impossible. Each share is printed in transparency. A share is a random noise. Encryption is performed for each pixel. It shows the 2 different shares for black and white pixels. In these we have to understood how a pixel in a image in divided into two sub pixels depending on whether the pixel is black or white. By doing so the width of the share increases. This is termed as Pixel Expansion. 1.1.1.Black and White Images: Visual cryptographic solutions operate on binary or binarized inputs. Therefore, natural (continuous-tone) images must be first converted into halftone images by using the density of the net dots to simulate the original gray or color levels in the target binary representation. Then, the halftone version of the input image is used instead of the original secret image to produce the shares. The decrypted image is obtained by stacking the shares together. Because binary data can be displayed either as frosted or transparent when printed on transparencies or viewed on the screen, overlapping shares that contain seemingly random information can reveal the secret image without additional computations or any knowledge of cryptographic keys. However, due to the nature of the algorithm, the decrypted image is darker, contains a number of visual impairments, and most of visual cryptography solutions increase the spatial resolution of the secret image. In addition, the requirement for inputs of the binary or dithered nature only limits the applicability of visual cryptography. Most of the existing secret sharing schemes are generalized within the so-called {k,n}-threshold framework that confidentially divides the content of a secret message into n shares in the way that requires the presence of at least k, for k≤n, shares for the secret message reconstruction, Thus, the framework can use any of n!/(k!(n−k)!) possible combinations of k shares to
  • 3. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 3 SJCET recover the secret message, whereas the use of k−1 or less shares should not reveal the secret message. Use of digital media has exploded in the past few years, primarily due to several distinct advantages that digital media can offer over analog media. These advantages include higher quality, easier editing, perfect copying and easier and more efficient transmission over information network. The wide dissemination of digital media also creates some potential problems. Due to the popularity of Internet commerce and digital library applications, the intellectual property right (IPR) protection is becoming increasingly important. Content providers will be reluctant to provide their valuable contents if they are not assure d that their contents are securely protected. Some good examples are the deployments of the digital versatile disk (DVD) market and the online music market. Fig1.1: random selection of pixels 1.1.2. VCS and the structures of sub-pixels: The IPR management and protection issue is currently being addressed in the emerging MPEG-4 standards for moving pictures compression. Several technologies have been developed for IPR protection. One is conditional access
  • 4. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 4 SJCET through encryption. The digital media will be scrambled before it is distributed. Only authorized users who have the proper key for decryption can access the clear content. The other one is digital watermarking that securely embeds hidden message into the multimedia data to identify the owner, or the buyer of a digital media. These two techniques are complementary to each other. We focus on conditional access through encryption in this project. Digital images/video are often communicated or distributed over non-private channels, such as satellite links, cable television networks, wireless networks, and the Internet. Conditional access systems for private digital image/video transmission or storage are a necessity for many applications, for example, pay-tv, confidential videoconferences, confidential facsimile transmissions, and medical image transmission and storage in a database. In general, complex cryptography techniques make cracking of the system difficult, but are also expensive to implement. Since digital video transmission system usually includes a compression module that aims to reduce the transmitted bit rate, the cryptography techniques have to be carefully designed to avoid potential adverse impact on the compression efficiency, and on the functionalities that the compression format provides. VC has been studied intensively since the pioneer work of Noor and Shamir. Most of the previous research work on VC focused on improving two parameters: pixel expansion and contrast. In these cases, all participants who hold shares are assumed to be semi-honest, that is, they will not present false or fake shares during the phase of recovering the secret image. Thus, the image shown on the stacking of shares is considered as the real secret image. Nevertheless, cryptography is supposed to guarantee security even under the attack of malicious adversaries who may deviate from the scheme in any way. We have seen that it is possible to cheat in VC, though it seems hard to imagine. For cheating, a cheater presents some fake shares such that the stacking of fake and genuine shares together reveals a fake image. With the property of unconditional security, VC is suitable for sending highly classified orders to a secret agent when computing devices may not be available. The secret agent carried some shares, each with a pre-determined order, when departing to the hostile country. When the headquarter decides to execute a specific order, it can simply send another share to the agent so that the agent can recover
  • 5. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 5 SJCET what the order is. We can see that it would be terrible if the dispatched share cannot be verified due to a cheater’s attack. A VCS would be helpful if the shares are meaningful or identifiable to every participant. A VCS with this extended characteristic is called extended VCS (EVCS). EVCS is like a -VCS except that each share displays a meaningful image, which will be called share image hereafter. Different shares may have different share images. At first glance, it seems very difficult to cheat in EVCS because the cheater does not know the share images that appear on the genuine shares and, thus, has no information about the distributions of black and white pixels of the share images. This information is crucial for cheating in VC. A secret image consists of a collection of black and white pixels where each pixel is treated independently. To encode the secret, we split the original image into n modified versions (referred as shares) such that each pixel in a share now subdivides into m black and white sub-pixels. To decode the image, we simply pick a subset S of those n shares and Xerox each of them onto a transparency. It is divided into 4 shares, which is denoted by Q containing at least one of the three sets {1, 2}, {2, 3} or {3, 4}. Then the qualified sets are exactly the following: Equal = {1, 2}, {2, 3}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}, {1, 2, 3, 4} 1.1.2.1. How are shares divided? We have used halftone Visual Cryptography to achieve Visual Cryptography via half- toning. Based on the blue-noise dithering principles, the proposed method utilizes the void and cluster algorithm to encode a secret binary image into n halftone shares (images) carrying significant visual information. 1.1.2.2. How is Cheating done? The issue of cheating by dishonest participants, called cheaters, in visual cryptography is that, cheating is possible when the cheaters form a coalition in order to deceive honest participants. At the outset two simple cheating prevention visual cryptographic schemes where proposed by G.B.Hond, T.G.Chen, and D.S.Tsai.
  • 6. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 6 SJCET 1.1.2.3. How is Decoding done? Along with this basic setup, Noor and Shamir also proposed (k, n) threshold model as its extension. This extended scheme is constructed such that any k shares can be stacked together to reveal the original secret. 1.1.3. Modular Description: This system deals with security during transmission of images. In Cheating Prevention in Visual Cryptography the following are the main modules and each module is explained below. f Images 1.1.3.1. Security & Login Module: This module deals with ensuring that only authorized users can access to this application. A database with user-id and password is used to validate the User entry. The input user-id is validated for a minimum of four characters. The application the opens into the application screen on validation 1.1.3.2. Encoding the Image: This system uses the Secret Sharing Scheme, which is a method for sharing a secret among a set p of p participants. The secret is encoded into n pieces called shares each of which is given to a distinct participant. Certain qualified subsets of participants can recover the secret by pooling together their information, whereas forbidden subsets of participants have information on the secret. The specification of the qualified sets and the forbidden sets is called access structure. A special kind of secret sharing scheme are Visual Cryptography Schemes (VCSs), that is, schemes where the secret to share is an image and the shares consist of Xeroxed transparencies which are stacked to recover the shared image. In this paper we analyze the relationship between secret sharing schemes and VCSs, focusing our attention on the amount of randomness required to generate the shares. We show how to transform a secret sharing scheme for a given accessness of the original scheme. An important consequence of this transformation is that lower bounds on the randomness of visual cryptography schemes apply to general secret sharing
  • 7. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 7 SJCET schemes. Our randomness preserving transformation has also been applied to derive a new upper bound on the randomness k, n threshold VCSs which dramatically improves on the previously known bounds. All VCSs obtained by applying our randomness preserving transformation allow a perfect reconstruction of black pixels. 1.1.3.3. Decoding the Image: The secret image consists of a collection of black and white pixels. To construct shares of an image for participants, we need to prepare two collections, which consist of Boolean matrices. A row in a matrix corresponds to sub-pixels of a pixel, where 0 denotes the white sub-pixel and 1 denotes the black sub-pixel. For a white (or black) pixel in the image, we randomly choose a matrix from (or, respectively) and assign row of to the corresponding position of share. Each pixel of the original image will be encoded into pixels, each of which consists of sub-pixels on each share. Since a matrix in and constitutes only one pixel for each share. For security, the number of matrices in and must be huge. For succinct description and easier realization of the VC construction, we do not construct directly. Instead, we construct two basis matrices and then let and be the set of all matrices obtained by permuting columns of and , respectively. Two collections (multi-sets) of Boolean matrices constitute a -VCS if there exist a value and a set satisfying the following: 1) Any qualified set can recover the secret image by stacking their shares. 2) Any forbidden set has no information on the secret image. Formally, the two collections, of matrices obtained by restricting each matrix in to rows, are indistinguishable in the sense that they contain the same matrices with the same frequencies. In visual cryptography scheme, the carriers (share-image holders) will bring their shares to the target place. The decoder will then stack the share images to find the original image. 1.1.3.4. Verification of Images : In existing visual cryptography scheme, the carriers (share-image holders) will bring their shares to the target place; the decoder will then stack the share images to find the original image. Here, there is no guarantee that carriers would not have changed or faked their images. This is the problem statement as known.
  • 8. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 8 SJCET In the proposed method, the decoder should be able to find whether the share images brought to the target place are faked or not. Also, each share-holder should be able to verify that other share-holder images are faked or not. In order to achieve this, the proposed method creates a verification image for each share holder. Each shareholder should bring this verification image also to the target place. In the target place, before decoding, each share-holder will verify the other share-holders image. Then, the decoder will also check each share-holders image. In the proposed method, during encoding, a verification image is specified. The share-images are created in such a way that stacking one share and other share- holders verification-share will reveal the verification image. Suppose there are two share- holders. During encoding, two images for each share-holder are created. One of them is secrete share and other is verification share. So totally four images will be created during encoding. In the target place, the decoder will know what verification image should be displayed during stacking. The decoder will check all verification images by combining each secret share with every other verification share. In our implementation, we have taken (2,2) viscrypt scheme. that is, there will be two share-holders and both two of them will participate in stacking, as u know. To do automated verification, we have defined the options called flag1 and flag2 will be enabled after verification only. Also note that the message box should come automatically showing whether the verification is successful or not. This cannot be done automatically. The encoding and decoding can be done by computer. But the verification can be done by humans only, by manually seeing whether the verification image that came is correct or not. that is, verification can be done by visually only. 1.2. Problem outline: It suffers a management problem, because of which dealers cannot visually identify each share. This problem is solved by the extended visual cryptography scheme (EVCS), which adds a meaningful cover image in each share. But while removing the extra cover image it produces extra noise or degrades the hidden image quality. Hence we are Extending the visual cryptography algorithm without removing cover images where it reduces pixel expansion problem and shares match duration.
  • 9. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 9 SJCET By reducing no of shares with increased participants, we can reduce the complexity. It makes the decoding system easy and improves the efficiency. The analysis is done by using the Matlab. 1.3. Objective: The primary property of visual cryptography is using a method called stacking shares, to recover secret image. Stacking refers to layering the shares on top of the one another. The secret dealer creates two or more shares for secret message. Each can not be caused to make public the secret alone. Receiving all the shares printing each share on to a transparency and using human visual system, the secret image can be visible without any computation. In this way, VC has verified to provide perfect security Furthermore, the technique can be applied to group secret system, which is using (k, n)-threshold visual secret sharing scheme in order to perform secret sharing, where k=n. With (k, n)-threshold visual secret sharing scheme, the dealer or the secret owner can base a group of n participants to produce n shares for the secret message . Each participant in the group can have his own share. When recovering the secret message, only k or more transparency stacks are required without any computation. The secret message cannot be restored if less than k transparencies are used . Each pixel in the secret image is expanded to four sub pixels in each share that consist of white and black according to the patterns. The summary points of Naor and Shamir‟s scheme 1) The secret data can be divided into n parts. 2) Any k or more than k parts can recover the secret 3) Any k -1 or fewer than k parts cannot compute the secret data. 1.4. Approach: Wu and Chen were first researchers to present the visual cryptography schemes to share two secret images in two shares. They hidden two secret binary images into two random shares, namely A and B, such that the first secret can be seen by stacking the two shares, denoted by A⊗ B, and the second secret can be obtained by first rotating A Ө anti-clockwise. They designed the rotation angle Ө to be 90◦. However, it is easy to obtain that Ө can be 180◦ or 270◦. To overcome the
  • 10. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 10 SJCET angle restriction of Wu and Chen’s scheme, Hsu et al. proposed a scheme to hide two secret images in two rectangular share images with arbitrary rotating angles. Wu and Chang also refined the idea of Wu and Chen by encoding shares to be circles so that the restrictions to the rotating angles (Ө = 90◦, 180◦ or 270◦) can be removed. In 1994 the basic problem of visual cryptography was introduced by Noor and Shamir. In visual cryptography we are dealing with the problem of encrypting pictures in a secure way such that the decryption can be done by the human visual system. The encryption of a secret image is achieved by encoding the information into several shadow images, called shares. The decoding is done by printing the shares on transparencies and stacking them. The system can be used by everyone without any knowledge of cryptography and without performing cryptographic computations. This is the major difference to usual cryptography schemes. This is the major difference to usual cryptography schemes where the secret information, represented as numbers, is encrypted by using one-way functions. The decryption can only be done if one knows the appropriate secret key. Noor and Shamir have described a k out of n (with k<=n ) system where the secret is encoded in n shares and the decoding can be done by stacking k or more transparencies. Using less than k transparencies won’t reveal the secret not even to an infinitely powerful cryptanalyst. In general it is possible that k and n are reasonably big numbers. In order to reveal the secret information it is necessary to have at least k people stack their shares together. Since k can be reasonably big, it might be very unlikely to find a coalition of at least k traitors who will be willing to misuse their . shares, in general one share-holder might not even know k-1 other share-holders. Obviously, it is much easier to find 0<t<k traitors who are looking for a way to sabotage the system. We assume that t<k share-holders stack their shares together and publish the information so that other small groups of less than k people can stack their shares on top of the published information and will therefore be able to reveal the actual secret. (It is possible to iterate the scenario in such a way that at first the information of t then t+t’ shares etc. gets published.) Since there is no way in keeping t people from publishing the accumulated information we are looking for a possibility to trace the traitors.
  • 11. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 11 SJCET S J Shyu et al were first researchers to advise the multiple secrets sharing in visual cryptography. This scheme encodes a set of n ≥ 2 secrets into two circle shares. The n secrets can be obtained one by one by stacking the first share and the rotated second shares with n different rotation angles. To encode unlimited shapes of image and to remove the limitation of transparencies to be circular, Fang offered reversible visual cryptography scheme. In this scheme two secret images which are encoded into two shares; one secret image appears with just stacking two shares and the other secret image appears with stack two shares after reversing one of them. Jen-Bang Feng et al developed a visual secret sharing scheme for hiding multiple secret images into two shares. The proposed scheme analyzes the secret pixels and the corresponding share blocks to construct a stacking relationship graph, in which the vertices denote the share blocks and the edges denote two blocks stacked together at the desired decryption angle. According to this graph and the pre- defined visual pattern set, two shares are generated. To provide more randomness for generating the shares Mustafa Ulutas et al advised secret sharing scheme based on the rotation of shares. In this scheme shares are rectangular in shape and are created in a fully random manner. Stacking the two shares reconstructs the first secret. Rotating the first share by 90° counterclockwise and stacking it with the second share reconstructs the second secret. Tzung-Her Chen et al offered the multiple image encryption schemes by rotating random grids, without any pixel expansion and codebook redesign. A non- expansion reversible visual secret sharing method that does not need to define the lookup table offered by Fang . To encode four secrets into two shares and recovering the reconstructed images without distortions Zhengxin Fu et al intended a rotation visual cryptography scheme. Rotation visual cryptography scheme construction was based on correlative matrices set and random permutation, which can be used to encode four secret images into two shares. Jonathan Weiretal suggested sharing multiple secrets using visual cryptography. A master key is generated for all the secrets; correspondingly, secrets are shared using the master key and multiple shares are obtained.
  • 12. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 12 SJCET 1.4.1. Visual cryptography scheme for binary Images Implementation of ‘2 out of 2’ scheme The (2, 2) – Visual cryptography scheme (VCS) is illustrated to bring in the basic concepts of threshold visual secret sharing schemes. In the encryption process every secret pixel is turned into two shares, and each share belongs to the corresponding share image. In the decryption process the two corresponding shares are stacked together (using OR operation) to recover the secret pixel. Two share of a white secret pixel are of the same while those of a black secret pixel are opposite. Fig 1.2:(a) share-1 (b) share-2 (c) overlapped image Therefore a white secret pixel is improved by a share with the stacked result of half white sub-pixels and a black secret pixel is recovered by all black. In XOR based VCS scheme where the share images are superimposed using XOR operation which results in perfect reconstruction of both Black and white pixels as and sub sampling a 2×2 share into a single pixel we get decrypted image of the same size as original secret image. 1.5. Thesis Outline: In Chapter 2: Fundamentals of visual cryptography; Chapter 3: Algorithm approach ; Chapter 4: System Design-Block diagram ,Functional Description of each Block; Chapter 5:Total Outline; Chapter 6: Result Observation-Simulation result; Chapter 7:Conclusion and Future Scope
  • 13. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 13 SJCET CHAPTER -2 FUNDAMENTALS 2.1.Binary Images: 2.1.1. Geometric Properties For a given image size, a binary image is easier to digitize, store, and transmit than a full gray-level image, since it contains about an order of magnitude fewer bits. Naturally, some information is lost and fewer options are open to us in processing such an image. In fact, we can present a fairly complete theory of what can and cannot be done with binary images, something that still eludes us in the case of gray-level images.First of all, we can compute various geometric properties, such as the size and position of the object in the image. If there is more than one object in the field of view, we can determine some topological properties of the assembly, such as the difference between the number of objects and the number of holes. It is also possible to label the individual objects and to perform the geometrical computations for each one separately. Finally, we can simplify binary images for further processing by modifying them in an iterative fashion.Binary image processing is well understood and lends itself to highspeed hardware implementation, but one must keep in mind its limitations.We have already mentioned the need for high object-to-background contrast.Moreover, the pattern obtained must be essentially two-dimensional.Remember that all we have is the outline or silhouette of the object. This gives little information about the object’s overall shape or its attitude in space.The characteristic function b(x, y) has a value for each point in the image. We call this a continuous binary image. Later, we shall consider discrete binary images, obtained by tessellating the image plane suitably. 2.1.1.1. Simple Geometrical Properties: Assume for now that we have a single object in the field of view. Thearea of the object, given the characteristic function b(x, y), can be found as A = ∫∫I b(x, y) dx dy,
  • 14. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 14 SJCET where the integration is over the whole image I. If there is more than one object, this formula will give the total area. 2.1.1.2. Area and Position: How do we determine the position of the object in the image? Since the object is usually not just a single point, we must give a precise meaning to the term “position.” The usual practice is to choose the center of area as the representative point . 2.1.1.3. Orientation: We also want to determine how the object lies in the field of view, that is, its orientation. This is a little harder. Let us assume that the object is somewhat elongated; then the orientation of the axis of elongation can be used to define the orientation of the object . (There is a remaining two-way ambiguity, however, as discussed .) How precisely do we define the direction in which the object is elongated? The usual practice is to choose the axis of least second moment. This is the two-dimensional equivalent of the axis of least inertia. We find the line for which the integral of the square of the distance to points in the object is a minimum; that integral is E = ∫∫ I r2 b(x, y) dx dy, where r is the perpendicular distance from the point (x, y) to the line sought after. To choose a particular line in the plane, we need to specify two parameters.A convenient pair consists of the distance ρ from the origin to the closest point on the line, and the angle θ between the x-axis and the line, measured counterclockwise .We prefer these parameters because they change continuously when the coordinate system is translated or rotated. There are no problems when the line is parallel, or nearly parallel, to either of the coordinate axes. Using these parameters, we can write the equation of the line in the form
  • 15. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 15 SJCET x sin θ − y cos θ + ρ = 0 by noting that the line intersects the x-axis at −ρ/ sin θ and the yaxis at +ρ/ cos θ. The closest point on the line to the origin is at (−ρ sin θ,+ρ cos θ). We can write parametric equations for points on the line as follows: x0 = −ρ sin θ + s cos θ and y0 = +ρ cos θ + s sin θ, where s is the distance along the line from the point closest to the origin 2.1.1.4. Projections: The position and orientation of an object can be calculated using first and second moments only We do not need the original image to obtain the first and second moments; projections of the image are sufficient. This is of interest since the projections are more compact and suggest much faster algorithms. 2.1.2. Discrete Binary Images: So far we have dealt with continuous binary images, defined at all pointsin the image plane. It should be obvious that the integrals become sumswhen we turn to discrete binary images The area, for example,can be computed using the sum A = ∑n i=1∑m j=1 bij, Where bij is the value of the binary image at the point in the ith row and the jth column.Here we have assumed that the image has been digitized on a square grid with n rows and m columns. Usually the image is scanned out row by row, in the same sequence as the beam on a television set explores the screen (except for interlace). As each picture cell is read, we check whether bij = 1. If so, we add 1, i, j,i2, ij, and j2 to the accumulated totals for the area, first moments, and second moments, as appropriate. At the end of the scan, the area, position, and orientation can be easily calculated from these totals.
  • 16. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 16 SJCET 2.1.2.1. Run-Length Coding: For binary images there are several coding techniques that can compress the data even further. A popular one is run-length coding. This method exploits the fact that along any particular scan line there will usually be long runs of zeros or ones. Instead of transmitting the individual bits, then,we can send numbers indicating the lengths of such runs. The run-length code for the image line 0 1 1 1 1 0 0 0 1 1 0 0 0 0 is just . Some special code may be used to indicate the beginning of each line. Further, a convention is followed as to whether the line starts with a zero or a one. If the line starts the other way, an initial run-length code of zero is sent. Let us use the convention that rik is the kth run of the ith line and that the first run in each row is a run of zeros. (Thus all the even runs will correspond to ones in the image.) Suppose further that there are mi runs on the ith line. (This number will be odd if the last run contains zeros.) How do we use run-length codes to rapidly compute the desired geometric properties? Clearly the area is just the sum of the run lengths corresponding to ones in the image: n mi ∕ 2 A = ∑ ∑ ri,2k i=1 k=1 Note that the sum is over the even runs only. The center of area is a little harder to calculate. First of all, we obtain the horizontal projection mi ∕ 2 hi = ∑ ri ,2k k=1 From this we can easily compute the vertical position i of the center of area Using n Ai = ∑ i hi i=1 But what about the vertical projection vj? Remember that a particular entry in this projection is obtained by adding up all picture cell values in one column of the image. It is therefore hard to compute the vertical projection directly from the run lengths.
  • 17. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 17 SJCET 2.1.2.2. Bitmap images : Bitmap images are made of individual dots called pixels (picture elements) that are arranged and colored differently to form a pattern .The individual squares that make up the total image can be seen when zoomed in. However, from a greater distance the color and shape of a bitmap image appear continuous .Since each pixel is colored individually, you can easily work with photographs with so many colors and can create photorealistic effects such as shadowing and increasing color by manipulating select areas, one pixel at a time. Bitmap programs are ideal to retouch photographs, editing images and video files and creating original artwork. Variety of changes to photographs can be made, such as adjusting the lighting, removing scratches, people, and things, swapping details between images, adding text and objects, adjusting color, and applying combinations of special effects. Fig 2.1: bitmap images To the left you see an image and to the right the top of one of the mountains when zoomed in. As you can see, the image consists of hundreds of rows and columns of small elements that all have their own color. Hence, if you work on a bigscale multimedia project or design a Web site, what graphic formatwill be the best choice for your needs? Which features of images are more important for the nature of your project: flexibility in scaling, file size, or photorealistic vs.computer generated look? In the next section, I will talk about these issues.
  • 18. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 18 SJCET Bitmap Image Text Text Whereas, bitmap image formats give a realistic result for representation of the real world, vectorbased images can only come as close as cartoon style drawings of the objects For instance, you cannot easily scale bitmap images, but you can control every single pixel. Thus, when you work with complex images, such as photographs, you can do number of effects whi ch are impossible in vector based images If you want photorealistic images, then the solution will be the use of bitmaps. However, if the download speed of graphics is important for youand your audience and the graphics are supposed to be resized and manipulated, then you should consider vector based formats. 2.2. Secret sharing Algorithm: In cryptography, secret sharing refers to a method for distributing a secret amongst a group of participants, each of which is allocated a share of the secret. The secret can only be reconstructed when the shares are combined together individual shares are of no use on their own There is a secret picture to be shared among n participants.The picture is divided into n transparencies(shares) such that if any m transparencies are placed together, the picture becomes visible but if fewer than m transparencies are placed together, nothing can be seen. A secret-sharing scheme is a method by which a dealer distributes shares to parties such that only authorized subsets of parties can reconstruct the secret. Secret-sharing schemes are important tools in cryptography and they are used as a building box in many secure protocols, e.g., general protocol for multiparty computation, Byzantine agreement, threshold cryptography, access control, attribute-based encryption, and generalized oblivious transfer messages. Secret sharing (also called secret splitting) refers to methods for distributing a secret amongst a group of participants, each of whom is allocated a share of the secret. The secret can be reconstructed only when a sufficient number, of possibly
  • 19. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 19 SJCET different types, of shares are combined together; individual shares are of no use on their own. In one type of secret sharing scheme there is one dealer and n players. The dealer gives a share of the secret to the players, but only when specific conditions are fulfilled will the players be able to reconstruct the secret from their shares. The dealer accomplishes this by giving each player a share in such a way that any group of t (for threshold) or more players can together reconstruct the secret but no group of fewer than t players can. Such a system is called a (t, n)-threshold scheme sometimes it is written as an (n, t)-threshold scheme. There is a simple algorithm for binary (black and white) visual cryptography that creates 2 encrypted images from an original unencrypted image. The algorithm is as follows:  First create an image of random pixels the same size and shape as the original image.  Set the same pixel of the second encrypted image to the opposite color. Where a pixel of the original image is different than the corresponding pixel in the first encrypted image.  The two apparently random images can now be combined using an exclusive-or (XOR) to re-create the original image
  • 20. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 20 SJCET Fig 2.2:secret image,share 1&share 2,overlapped image From secret image two shares are generated,those are share 1& share 2 are generates from black &white pixel components of secret image.Then these shares are overlapped it leads to Decrypted image that is approximately equal to original secret image, 2.2.1. Current Methodology: In the current scenario, as shown in the Figure, when the end user wants to access his confidential information online (in the form of money transfer or payment gateway) by logging into his bank account or secure mail account, the person enters information like username, password, credit card no. etc. on the login page. But quite often, this information can be captured by attackers using phishing techniques (for instance, a phishing website can collect the login information the user enters and redirect him to the original site). There is no such information that cannot be directly obtained from the user at the time of his login input. In the current scenario, as shown in the Figure when the end user wants to access his confidential information online (in the form of money transfer or payment gateway) by logging into his bank account or secure mail account, the person enters information like username, password, credit card no. etc. on the login page. But
  • 21. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 21 SJCET quite often, this information can be captured by attackers using phishing techniques (for instance, a phishing website can collect the login information the user enters and redirect him to the original site). There is no such information that cannot be directly obtained from the user at the time of his login input. Fig 2.3: Existing system scenario 2.3. Blur Kernal: In image processing, a kernel, convolution matrix, or mask is a small matrix useful for blurring, sharpening, embossing, edge-detection, and more. This is accomplished by means of convolution between a kernel and an image. 2.3.1. The Gaussian kernel: The Gaussian (better Gaußian) kernel is named after Carl Friedrich Gauß (1777-1855), a brilliant German mathematician. This chapter discusses many of the nice and peculiar properties of the Gaussian kernel.
  • 22. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 22 SJCET Fig 2.4: The Gaussian kernel is apparent on every German banknote of DM 10,- where it is depicted next to its famous inventor when he was 55 years old. The new Euro replaces these banknotes. The Gaussian kernel is defined in 1-D, 2D and N-D respectively as In 1-D G1D In 2-D G2D -(x2 /2σ2) -((x2 +y2)/2σ2) G1D(x;σ) = (1/√2πσ)* e G2D(x,y;σ) = (1/2πσ2)* e The s determines the width of the Gaussian kernel. In statistics, when we consider the Gaussian probabilitydensity function it is called the standard deviation, and the square of it, s2, the variance. In the rest of this book, when we consider the Gaussian as an aperture function of some observation, we will refer to s as the inner scale or shortly scale. In the whole of this book the scale can only take positive values, s > 0. In the process of observation s can never become zero. For, this would imply making an observation through an infinitesimally small aperture, which is impossible. The factor of 2 in the exponent is a matter of convention, because we then have a 'cleaner' formula for the diffusion equation, as we will see later on. The semicolon between the spatial and scale parameters is conventionally put there to make the difference between these parameters explicit. The scale- dimension is not just another spatial dimension, as we will thoroughly discuss in the remainder of this concept. Standard Deviation: The Standard deviation of the Gaussian function plays an important role in its behaviour.The values located between +/- σ account for 68% of the set, while two standard deviations from the mean (blue and brown) account for 95%, and three standard deviations account for 99.7%.This is very important when designing a Gaussian kernel of fixed length.
  • 23. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 23 SJCET The Gaussian function is used in numerous research areas:  It defines a probability distribution for noise or data.  It is a smoothing operator.  It is used in mathematics. The Gaussian function has important properties which are verified with respect to its integral: -∞ I = ∫ exp(-X2) dx=√∏ ∞ In probabilistic terms, it describes 100% of the possible values of any given space when varying from negative to positive valuesGauss function is never equal to zero.It is a symmetric function. When working with images we need to use the two dimensional Gaussian function.This is simply the product of two 1D Gaussian functions for each and is given by: - ((x2+y2)/2σ2) G(x,y) =1/2πσ2 e A graphical representation of the 2D Gaussian distribution with mean(0,0) and σ = 1 is shown to the right. The Gaussian filter works by using the 2D distribution as a point-spread function.This is achieved by convolving the 2D Gaussian distribution function with the image.We need to produce a discrete approximation to the Gaussian function.This theoretically requires an infinitely large convolution kernel, as the Gaussian distribution is non-zero everywhere.Fortunately the distribution has approached very close to zero at aboutthree standard deviations from the mean. 99% of the distributionfalls within 3 standard deviations.This means we can normally limit the kernel size to contain only values with in three standard deviations of the mean.
  • 24. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 24 SJCET Gaussian kernel coefficients are sampled from the 2D Gaussian function. - ((x2+y2)/2σ2) G(x,y) =1/2πσ2 e Where σ is the standard deviation of the distribution. The distribution is assumed to have a mean of zero. We need to discretize the continuous Gaussian functions to store it as discrete pixels. The Gaussian filter is a non-uniform low pass filter.The kernel coefficients diminish with increasing distance from the kernel’s centre.Central pixels have a higher weighting than those on the periphery.Larger values of σ produce a wider peak Kernel size must increase with increasing σ to maintain the Gaussian nature of the filter.Gaussian kernel coefficients depend on the value of σ.At the edge of the mask, coefficients must be close to 0.The kernel is rotationally symmetric with no directional bias.Gaussian kernel is separable which allows fast computation Gaussian filters might not preserve image brightness. 2.3.2. Gaussian Filtering examples: Is the kernel 1 6 1 a 1D Gaussian kernel? Give a suitable integer-value 5 by 5 convolution mask that approximates a Gaussian function with a σ of 1.4. How many standard deviations from the mean are required for a Gaussian function to fall to 5% or 1% of 5%, its peak value? What is the value of σ for which the value of the Gaussian function is halved at +/-1 x. Compute the horizontal Gaussian kernel with mean=0 and σ=1, σ=5. Gaussian filtering is used to remove noise and detail. It is notparticularly effective at removing salt and pepper noise.Compare the results below with those achieved by the median filter.
  • 25. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 25 SJCET Gaussian filtering is more effective at smoothing images. It has its basis in the human visual perception system. It has been found that neurons create a similar filter when processing visual images.The halftone image at left has been smoothed with a Gaussian filterand is displayed to the right. This is a common first step in edge detection.The images below have been processed with a Sobel filter commonlyused in edge detection applications. The image to the right has had a Gaussian filter applied prior to processing.
  • 26. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 26 SJCET CHAPTER-3 ALGORITHM APPROACH 3.1. An Extended VC Algorithm for General Access Structure: Visual cryptography was proposed by Naor and Shamir ,allows the encryption of secret information in the image form. In the concept of secret sharing, a secret image can be encrypted as n different share images printed on transparencies, which are then distributed to n participants. By stacking transparencies (shares) directly, the secret images can be revealed and visually recognized by humanswithout any computational devices and cryptographic knowledge. On the other hand, any one share or a portionof shares can leak nothing related to the secret image .VC is a very good solution for sharing secrets when computers cannot be employed for the decryption process. Later on threshold visual secret sharing scheme, also known as kout- of-n VSS scheme or(k,n)-VSS scheme have been proposed. Ateniese proposed the concept of general access structure (GAS) and also developed a VC-based solution for some GASs.By using the GAS , dealers can define reasonable combinations of shares as decryption Conditions rather than specifying the number of shares. Hence, the (k, n)-VSS scheme can be treated as a special case of the GAS. Conventional VSS schemes generate noise-like random pixels on shares to hide secret images. So, the secret can be perfectly concealed on the share images. These schemes suffer from a management problem so that dealers cannot identify each share visually. The pixel expansion problem is also a common disadvantage with most of the VSS schemes. When the VC-based approach is employed, each secret pixel within a secret image is encrypted in a block consisting of 'm' sub pixels in each constituent share image. Thus, the area of a share is 'm' times that of the original secret image. Thereby contrast of the recovered images will be decreased to '1/m' simultaneously. The pixel expansion problem not only affects the practicability of storage and transmission requirements for shares but also decreases the contrast of the recovered secret images. So developed a friendly VC scheme known as the extended visual cryptography scheme, which adds a meaningful cover image on each share to address the management problem and the pixel expansion problem.
  • 27. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 27 SJCET Fig 3.1: Example for Visual Cryptographic Scheme (a) Secret Image (b) Share1 (c) Share2 (d) Stacked Result This paper proposes a new method that resolves management problem; pixel expansion problem. This approach can be used for binary secret images innoncomputer aided decryption environments. The proposed approach consists of two phases. The first phase of the algorithm uses optimization technique for a given access structure, constructs a set of noise like shares that are pixelexpansion-free. This phase identifies and formulates the problem as a combinatorial optimization problem and then developed a simulated-annealing based algorithm to solve it. The second phase of the algorithm directly adds a cover image on each share directly via a stamping algorithm and thereby removing the pixel expansionentirely. The experimental results shows that this approach is a solution to the pixel expansion problem of the EVCS. Moreover, the display quality of the recovered image is very close to that obtained using conventional VC schemes. 3.1.1. Ideal Contrast Secret Sharing Scheme through Meaningful Shares with Enveloping Digital Watermarking using Bit Plane based (k,n)-VCS: A new secret sharing scheme with meaningful shares using (k,n)-threshold visual cryptography and digital watermarking for grayscale images based on bit plane encoding is proposed in this method. Initially, an image is decomposed into its bit plane images that generate a binary image at each bit plane. Secondly, the traditional binary secret sharing scheme is used to get the sharing images. Finally, a proposed watermarking technique is used to generate meaningful shares. To decrypt hidden secret image, extract the shares from the cover image and decompose each share into bit planes and then secret grayscale image is reconstructed. This scheme
  • 28. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 28 SJCET provides a more efficient way to hide images in different meaningful shares. To reduce the interest of hackers, we have proposed a technique called digital enveloping. This is nothing but an extended invisible digital watermarking technique. Using this technique, the shares, produced by k-n secret sharing visual cryptography are embedded into the envelope images by LSB replacement . This can be done by replacing the b Least Significant Bits (LSB) of each channel represented with 8 bits of the 24-bit color image. 3.2. Phase 1-Generating I-Shares: This phase 1 of this method aims to construct a pixel expansion-free VCS for a given access structure (Tqual,Tforb). The idea behind the solution is as follows. A security system employs n' different keys to protect a secretand distributes these keys to n different participants. Each and every key may be duplicated and will be distributed to at least one participant. Each participant is allowed to hold at least one key. If someone wants to access the secret, he/she has to collect n' different keys from a set of participants. If he/she misses any one type of key, the secret will remain protected. So for an access structure(Tqual, Tforb)the dealer has to carefully distribute n' different keys to any set of participants X,X ЄTqual and has to guarantee that any set of participants Y, YЄTforb, will not hold all types of keys. In summary, phase I of the proposed algorithm contains two sub procedures: First, finding the number of basis n' shares and a corresponding construction set C for a (Tqual,Tforb)- VCS. We develop a GAS solver to deal with these works. Before Encryption we need to halftone the color secret image in to binary image and generate color meaningful shares R,G,B with the proposed scheme. During this phase an Error Diffusion Half toning algorithm is used to halftone the Secret Image. Second, basis shares S1,...,Sn that were yielded by constructions of (n',n')-VCS and the construction set C will be utilized to obtain uncovered I-shares. This work will be carried out by This work will be carried out by the encryptor using Yang's probabilistic vss scheme and the share synthesizer. In the 2nd phase, a stamping algorithm based on LSB replacement in which cover images itself will stamp together produces the resultant secret image. During that phase an Inverse Halftoning algorithm using Neural Network method is used for generating the secret
  • 29. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 29 SJCET image. The proposed methods offer a high quality of secret image compared with the previous schemes. 3.2.1. GAS Solver-General Access Structure Solver: For a set of participants P= {i1,i2,….in} and access structure (ΓQual , ΓForb) the GAS solver is used to finding a construction set C with minimal n1.In this section, we develop an algorithm based on the simulated annealing approach to solve the proposed mathematic optimization formulation for the GAS problem. Inorder to simplify optimization procedures, use penalized energy function in the model. The penalized energy function Ep can be defined as Ep= Nf + |TQual| / (1 + Nq) where Nq denotes the amount of a set that can recover the secret image and Nf represents the amount of an insecure forbidden set in TForb. Our solution approach adopts an iterative improvement framework. The iteration is based on the decision variable n1. The proposed iterative improvement framework is listed in Algorithm 1. The pseudo code for the proposed SAbasedalgorithm, GAS_SA() is in Ref. (a)Algorithm : SA based algorithm for GAS Solver: (b)Algorithm for Share Constructor: The share constructor consists of two modules in Figure 1: the encryptor and share synthesizer. The encryptor adopts Yang’s construction for the (n1,n1) – ProbVSS scheme. In the share constructor, encryptor generates the basis shares by
  • 30. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 30 SJCET employing Yang’s ProbVSS scheme. Then the share synthesizer produces intermediate shares (I- shares) by stacking the basis shares upon the construction set C. The procedure for the share constructor is described in Ref . The share constructor phase is applied on three planes. 3.3. Phase II-Stamping: After generating color shares using Error diffusion halftoning algorithm, those color shares are encrypted using Yang's Prob VSS scheme and synthesized, ie distributes those shares to corresponding P participants. In the 2nd phase,a stamping algorithm is used in which cover images itself will stamp together produces the resultant secret image. If the random looking shares are enveloped into meaningful images using cover images, the interest of hackers can be reduced, thereby providing more security to visual cryptography. Otherwise hackers thought that it might be a critical information. Therefore here used a technique called digital enveloping or stamping or embedding of cover images into shares using LSB replacement. In LSB steganography , the least significant bits of the cover media's digital data are used to conceal the message.LSB replacement steganography flips the last bit of each of the data values to reflect the message that needs to be hidden. Consider an 8-bit grayscale bitmap image where each pixel is stored as a byte representing a grayscale value.It is clear that on average, only half the LSBs need to change.The difference between the cover (i.e. original) image and the stego image will be hardly noticeable to the human eye.Results show a cover image and a stego image with data is embedded, there is no visible difference between the two images.LSB matching randomly increments or decrements the data value by one. LSB matching is also known as ±1 embedding.
  • 31. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 31 SJCET Proposed Stamping Algorithm: 3.4. Proposed Scheme : In the Proposed scheme we used (2, 2) Visual Cryptography Scheme. The whole design is divided into two process 1) Encryption(Creating shares) 2) Decryption(Human Visual System) 3.4.1. Encryption process Encryption process is partitioned into two stages and shown in figure (a)First stage : An original binary image of size 100X100 has been considered in our design where each pixel is either 0 or 1. A (2, 2) Visual Sharing technique is applied on original binary image. From this process two binary share images will be generated. (b)Second stage : In the second stage four share images are generated from the two share images obtained from first stage using (2,2) VCS, this is called chain share of order 2. Further to enhance the security, share encryption is performed on four shares obtained from previous step using 8-bit different LFSR sequence XOR ing the share bit with LFSR bit and it is repeated for whole binary share image. Hence, no two share should generate partial image.
  • 32. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 32 SJCET Fig 3.2 : Encryption of shares 3.4.2. Decryption process : Decryption process is reverse process of encryption. It consists of two stages and pictorial representation of decryption process is given in figure. (a)First Stage : To decrypt the four shares from encrypted shares same LFSR sequence must be used which was used in earlier encryption process and bitwise XOR operation performed between encrypted share and LFSR bit sequence. Otherwise original image will not be recovered in future. From four decrypted share of the previous step, two partial shares were obtained by performing bitwise logical ORing between share 1,2 and share 3,4. (b)Second Stage: Bitwise logical OR operation performed on two obtained share images from previous stage to get back the retrieved image. The obtained image is identical to original image.
  • 33. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 33 SJCET Figure 3.3: Encryption Process with two stages Figure 3.4 : Decryption Process with two stages 3.4.3. Results : Matlab 7.2 Software tool is used to analyze the result. To study the performance of proposed scheme three different binary images of size 100X100 were used and shown in figures. The stage by stage result of proposed scheme is given in table .
  • 34. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 34 SJCET Fig 3.5:secret image1 Fig 3.6:secret image2 Fig 3.7:secret image3 shows the Encryption process of the original binary image. In the table Figure shows three different original binary images, are shares generated in the 1st stage. The result shows no residual information of original image perceptually observed among the two shares. In the second stage four different shares are generated and is given in In this four shares stacking process of any two shares gives residue of original information. So to provide additional security share encryption is performed on all the four shares as discussed is scrambled shares using 8 stage LFSR sequence.
  • 35. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 35 SJCET Table 3.1: Encryption process: Table gives decryption process and it is reverse process of encryption. In the table3 the figure is same scrambled share image. The same LFSR initial sequence or key need to be used to get back the four shares. The obtained shares are shown in the figure. It is observed that no residual information is visually seen. Figure are the shares obtained from BIT ORing the shares shown in Fig 4p and 4q and Fig respectively. Reconstructed image given in figure obtained by BIT ORing the previous shares i.e.,Fig From figure image can be easily identified but contrast is poor. In order to obtain the efficient reconstructed image Bitwise XOR is applied between the shares and obtained image shown in figure.The figure image is identical to original image except the size.
  • 36. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 36 SJCET Table 3.2: Decryption Process: 3.4.4. Conclusion : Using the proposed design original image successfully encoded into 4 share images. In This scheme two stages were used it’s very difficult to access the original information by unauthorized receiver. In this paper we used only order 2(two stages) because if we increase the order even though we can generate many number of shares, but quality of the reconstructed image will be poor (more number of columns) and needs more storage space for shares.Difficulties for image reconstruction by unauthorized receiver 1. Order and orientation of chain share: If the order of the chain share is unknown and orientation is mismatched we will not get the original image 2. LFSR sequence: We have to use same LFSR sequence for encryption as well as decryption to get back the original image
  • 37. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 37 SJCET 3. Number of shares: All the four shares compulsorily necessary to identify the original binary image. The secret image consists of a collection of black and white pixels. To construct shares of an image for participants, we need to prepare two collections, which consist of Boolean matrices. A row in a matrix corresponds to sub-pixels of a pixel, where 0 denotes the white sub-pixel and 1 denotes the black sub-pixel. For a white (or black) pixel in the image, we randomly choose a matrix from (or, respectively) and assign row of to the corresponding position of share.  Each pixel of the original image will be encoded into pixels, each of which consists of sub-pixels on each share. Since a matrix in and constitutes only one pixel for each share. For security, the number of matrices in and must be huge. For succinct description and easier realization of the VC construction, we do not construct and directly. Instead, we construct two basis matrices and then let and be the set of all matrices obtained by permuting columns of and, respectively. Two collections (multi-sets) and of Boolean matrices constitute a –VCS.  Each white pixel in the original image is split into two of the same small blocks that have half black and white pixels. When these two blocks are overlapped, they line up exactly, and the result is a light-colored block (with half black and half white pixels). Each black pixel in the original logo is split into two complementary small blocks. When these two blocks are overlapped, the result is a completely black box.  If each pixel in the original image is split randomly as described above, then each individual share is a totally random collection of blocks. Only when the shares are combined is any information revealed about the original image.
  • 38. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 38 SJCET CHAPTER-4 SYSTEM DESIGN 4.1.Block Diagram Fig 4.1: Block Diagram of VCS 4.2. PLAIN TEXT: The message in its original-human readable-form is called Plain text. In cryptography, plaintext is information a sender wishes to transmit to a receiver. Cleartext is often used as a synonym. Plaintext has reference to the operation of cryptographic algorithms, usually encryption algorithms, and is the input upon which they operate. Cleartext, by contrast, refers to data that is transmitted or stored unencrypted. 4.2.1. Overview of Plain Text: Before the computer era, plaintext most commonly meant message text in the language of the communicating parties. Since computers became commonly available, the definition has expanded to include:
  • 39. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 39 SJCET  messages (for example, email messages)  document content such as word processor and spreadsheet files  audio and video files, digital photographs and any other multimedia  files containing other files such as Zip files or ISO images  ATM, credit card and other banking information  sensor data  any other data that a person wishes to keep private Much of this data is not directly meaningful to humans, being already transformed into computer manipulable forms. While the original definition implied that the message could be read by a human being, the modern definition emphasizes that a person using a computer could easily interpret the data. Any information which the communicating parties wish to conceal from others can now be treated, and referred to, as plaintext. Thus, in a significant sense, plaintext is the 'normal' representation of data before any action has been taken to conceal, compress, or 'digest' it. It need not represent text, and even if it does, the text may not be "plain". Plaintext is used as input to an encryption algorithm the output is usually termed ciphertext particularly when the algorithm is a cipher. Codetext is less often used, and almost always only when the algorithm involved is actually a code. In some systems, however, multiple layers of encryption are used, in which case the output of one encryption algorithm becomes plaintext input for the next. 4.2.2. Secure handling of plaintext : In a cryptosystem, weaknesses can be introduced through insecure handling of plaintext, allowing an attacker to bypass the cryptography altogether. Plaintext is vulnerable in use and in storage, whether in electronic or paper format. Physical security deals with methods of securing information and its storage media from local, physical, attacks. For instance, an attacker might enter a poorly secured building and attempt to open locked desk drawers or safes. An attacker can also engage in dumpster diving, and may be able to reconstruct shredded information if it is sufficiently valuable to be worth the effort. One countermeasure is to burn or thoroughly crosscut shred discarded printed plaintexts or storage media; NSA is infamous for its disposal security precautions.
  • 40. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 40 SJCET If plaintext is stored in a computer file (and the situation of automatically made backup files generated during program execution must be included here, even if invisible to the user), the storage media along with the entire computer and its components must be secure. Sensitive data is sometimes processed on computers whose mass storage is removable, in which case physical security of the removed disk is separately vital. In the case of securing a computer, useful (as opposed to hand waving) security must be physical (e.g., against burglary, brazen removal under cover of supposed repair, installation of covert monitoring devices, etc.), as well as virtual (e.g., operating system modification, illicit network access, Trojan programs, ...). The wide availability of key drives, which can plug into most modern computers and store large quantities of data, poses another severe security headache. A spy (perhaps posing as a cleaning person) could easily conceal one and even swallow it, if necessary. Discarded computers, disk drives and media are also a potential source of plaintexts. Most operating systems do not actually erase anything — they simply mark the disk space occupied by a deleted file as 'available for use', and remove its entry from the file system directory. The information in a file deleted in this way remains fully present until overwritten at some later time when the operating system reuses the disk space. With even low-end computers commonly sold with many gigabytes of disk space and rising monthly, this 'later time' may be months later, or never. Even overwriting the portion of a disk surface occupied by a deleted file is insufficient in many cases. Peter Gutmann of the University of Auckland wrote a celebrated 1996 paper on the recovery of overwritten information from magnetic disks; areal storage densities have gotten much higher since then, so this sort of recovery is likely to be more difficult than it was when Gutmann wrote. Also, independently, modern hard drives automatically remap sectors that are starting to fail; those sectors no longer in use will contain information that is entirely invisible to the file system (and all software which uses it for access to disk data), but is nonetheless still present on the physical drive platter. It may, of course, be sensitive plaintext. Some government agencies (e.g., NSA) require that all disk drives be physically pulverized when they are discarded, and in some cases, chemically treated with corrosives before or after. This practice is not widespread outside of the government, however. For example, Garfinkel and Shelat (2003)
  • 41. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 41 SJCET analyzed 158 second-hand hard drives acquired at garage sales and the like and found that less than 10% had been sufficiently sanitized. A wide variety of personal and confidential information was found readable from the others. See data remanence. Laptop computers are a special problem. The US State Department, the British Secret Service, and the US Department of Defense have all had laptops containing secret information,some perhaps in plaintext form, 'vanish' in recent years. Announcements of similar losses are becoming a common item in news reports. Disk encryption techniques can provide protection against such loss or theft if properly chosen and used. On occasion, even when the data on the host systems is itself encrypted, the media used to transfer data between such systems is nevertheless plaintext due to poorly designed data policy. An incident in October 2007 in which HM Revenue and Customs lost CDs containing no less than the records of 25 million child benefit recipients in the United Kingdom the data apparently being entirely unencrypted is a case in point. Modern cryptographic systems are designed to resist known plaintext or even chosen plaintext attacks and so may not be entirely compromised when plaintext is lost or stolen. Older systems used techniques such as padding and Russian copulation to obscure information in plaintext that could be easily guessed, and to resist the effects of loss of plaintext on the security of the cryptosystem. 4.3. CIPHER TEXT: The message in its coded human unreadable form is called Cipher text. In cryptography, ciphertext (or cyphertext) is the result of encryption performed on plaintext using an algorithm, called a cipher. Ciphertext is also known as encrypted or encoded information because it contains a form of the original plaintext that is unreadable by a human or computer without the proper cipher to decrypt it. Decryption, the inverse of encryption, is the process of turning ciphertext into readable plaintext. Ciphertext is not to be confused with code text because the latter is a result of a code, not a cipher.
  • 42. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 42 SJCET 4.3.1. Types of Ciphers: The history of cryptography began thousands of years ago. Cryptography uses a variety of different types of encryption. Earlier algorithms were performed by hand and are substantially different from modern algorithms, which are generally executed by a machine. (a)Historical ciphers: Historical pen and paper ciphers used in the past are sometimes known as classical ciphers. They include: (b)Substitution cipher: The units of plaintext are replaced with ciphertext (Caesar Cipher and one- time pad).In cryptography, a substitution cipher is a method of encoding by which units of plaintext are replaced with ciphertext, according to a regular system; the "units" may be single letters (the most common), pairs of letters, triplets of letters, mixtures of the above, and so forth. The receiver deciphers the text by performing an inverse substitution. Substitution ciphers can be compared with transposition ciphers. In a transposition cipher, the units of the plaintext are rearranged in a different and usually quite complex order, but the units themselves are left unchanged. By contrast, in a substitution cipher, the units of the plaintext are retained in the same sequence in the ciphertext, but the units themselves are altered. There are a number of different types of substitution cipher. If the cipher operates on single letters, it is termed a simple substitution cipher; a cipher that operates on larger groups of letters is termed polygraphic. A monoalphabetic cipher uses fixed substitution over the entire message, whereas a polyalphabetic cipher uses a number of substitutions at different positions in the message, where a unit from the plaintext is mapped to one of several possibilities in the ciphertext and vice versa.
  • 43. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 43 SJCET (c)Transposition cipher: the ciphertext is a permutation of the plaintext (Rail fence cipher). In cryptography, a transposition cipher is a method of encryption by which the positions held by units of plaintext (which are commonly characters or groups of characters) are shifted according to a regular system, so that the ciphertext constitutes a permutation of the plaintext. That is, the order of the units is changed (the plaintext is reordered). Mathematically a bijective function is used on the characters' positions to encrypt and an inverse function to decrypt. These are two types  Rail Fence cipher  Route cipher (d)Polyalphabetic cipher: A substitution cipher using multiple substitution alphabets (Vigenère cipher and Enigma machine) A polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets. The Vigenère cipher is probably the best-known example of a polyalphabetic cipher, though it is a simplified special case. The Enigma machine is more complex but still fundamentally a polyalphabetic substitution cipher. The Alberti cipher by Leon Battista Alberti around 1467 was believed to be the first polyalphabetic cipher. Alberti used a mixed alphabet to encrypt a message, but whenever he wanted to, he would switch to a different alphabet, indicating that he had done so by including an uppercase letter or a number in the cryptogram. For this encipherment Alberti used a decoder device, his cipher disk, which implemented a polyalphabetic substitution with mixed alphabets. Although Alberti is usually considered the father of polyalphabetic cipher, it has been claimed that polyalphabetic ciphers may have been developed by the Arab cryptologist Al Kindi 600 years before Alberti. Johannes Trithemius in his bookPolygraphiae libri sex (Six books of polygraphia), which was published in 1518 after his death invented a progressive keypolyalphabetic cipher called the Trithemius cipher. Unlike Alberti's cipher, which switched alphabets at random intervals, Trithemius switched alphabets for each letter of the message. He started with a tabula recta, a square with 26 alphabets in it (although Trithemius, writing
  • 44. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 44 SJCET in Latin, used 24 alphabets). Each alphabet was shifted one letter to the left from the one above it, and started again with A after reaching Z (see image). Fig 4.2: Tabula recta Trithemius's idea was to encipher the first letter of the message using the first shifted alphabet, so A became B, B became C, etc. The second letter of the message was enciphered using the second shifted alphabet, etc. Alberti's cipher disk implemented the same scheme. It had two alphabets, one on a fixed outer ring, and the other on the rotating disk. A letter is enciphered by looking for that letter on the outer ring, and encoding it as the letter underneath it on the disk. The disk started with A underneath B, and the user rotated the disk by one letter after encrypting each letter. The cipher was trivial to break, and Alberti's machine implementation not much more difficult. Key progression in both cases was poorly concealed from attackers. Even Alberti's implementation of his polyalphabetic cipher was rather easy to break (the capitalized letter is a major clue to the cryptanalyst). For most of the next several hundred years, the significance of using multiple substitution alphabets was missed by almost everyone. Polyalphabetic substitution cipher
  • 45. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 45 SJCET designers seem to have concentrated on obscuring the choice of a few such alphabets (repeating as needed), not on the increased security possible by using many and never repeating any. The principle (particularly Alberti's unlimited additional substitution alphabets) was a major advance the most significant in the several hundred years since frequency analysis had been developed. A reasonable implementation would have been (and, when finally achieved, was) vastly harder to break. It was not until the mid-19th century (in Babbage's secret work during the Crimean War and Friedrich Kasiski's generally equivalent public disclosure some years later), that cryptanalysis of well-implemented polyalphabetic ciphers got anywhere at all. 4.3.1.1. Permutation cipher: In classical cryptography, a permutation cipher is a transposition cipher in which the key is a permutation. To apply a cipher, a random permutation of size e is generated (the larger the value of e the more secure the cipher). The plaintext is then broken into segments of size e and the letters within that segment are permuted according to this key. In theory, any transposition cipher can be viewed as a permutation cipher where e is equal to the length of the plaintext; this is too cumbersome a generalisation to use in actual practice, however. 4.3.1.2. Identifying the cipher: Because the cipher doesn't change any of the characters, the ciphertext will have exactly the same letter frequencies as the underlying plaintext. This means that the cipher can in many cases be identified as a transposition by the close similarity of its letter statistics with the letter frequencies of the underlying language. 4.3.1.3. Breaking the cipher: Because the cipher operates on blocks of size e, the plaintext and the ciphertext have to have a length which is some multiple of e. This causes two weaknesses in the system: first, the plaintext may have to be padded (if the padding is identifiable then part of the key is revealed ) and second, information relating to the length of the key is revealed by the length of the ciphertext. To see this, note
  • 46. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 46 SJCET that if the ciphertext is of length i then e must be one of the divisors of i. With the different possible key sizes different possible permutations are tried to find the permutation which results in the highest number of frequent bigrams and trigrams as found in the underlying language of the plaintext. Trying to find this permutation is essentially the same problem encountered when analysing a columnar transposition cipher: multiple anagramming. 4.4. ENCRYPTION: The process of converting plain text into cipher text is called Encryption Encryption involves creating “shares” of the image which in a sense will be a piece of the image. In cryptography, encryption is the process of encoding messages or information in such a way that only authorized parties can read it. Encryption does not of itself prevent interception, but denies the message content to the interceptor. In an encryption scheme, the message or information, referred to as plaintext, is encrypted using an encryption algorithm, generating ciphertext that can only be read if decrypted. For technical reasons, an encryption scheme usually uses a pseudo-random encryption key generated by an algorithm. It is in principle possible to decrypt the message without possessing the key, but, for a well-designed encryption scheme, large computational resources and skill are required. An authorized recipient can easily decrypt the message with the key provided by the originator to recipients, but not to unauthorised interceptors. They are two encryption keys 1. Symmetric key 2.public key encryptions But we are not using keys where we are using shares. Share generation 2 out of 2 scheme(4sub pixels) • Each pixel encoded as • a 2x2 cell • in two shares • Each share has 2 black, 2 white sub pixels • When stacked, shares combine to • Solid black Half black (seen as gray)
  • 47. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 47 SJCET 4.4.1. IMPLEMENTATION: Fig 4.3:Implementation of 2 out of 2 scheme 4.4.1.1. Uses of Encryption: Encryption has long been used by militaries and governments to facilitate secret communication. It is now commonly used in protecting information within many kinds of civilian systems. For example, the Computer Security Institute reported that in 2007, 71% of companies surveyed utilized encryption for some of their data in transit, and 53% utilized encryption for some of their data in storage. Encryption can be used to protect data "at rest", such as files on computers and storage devices (e.g. USB flash drives). In recent years there have been numerous reports of confidential data such as customers' personal records being exposed through loss or theft of laptops or backup drives. Encrypting such files at rest helps protect them should physical security measures fail. Digital rights management systems, which prevent unauthorized use or reproduction of copyrighted material and protect software against reverse engineering (see also copy protection), is another somewhat different example of using encryption on data at rest. Encryption is also used to protect data in transit, for example data being transferred via networks (e.g. the Internet, e-commerce), mobile telephones, wireless microphones, wireless intercom systems, Bluetooth devices
  • 48. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 48 SJCET and bank automatic teller machines. There have been numerous reports of data in transit being intercepted in recent years. Encrypting data in transit also helps to secure it as it is often difficult to physically secure all access to networks. 4.4.1.2. Message verification: Encryption, by itself, can protect the confidentiality of messages, but other techniques are still needed to protect the integrity and authenticity of a message; for example, verification of a message authentication code (MAC) or a digital signature. Standards for cryptographic software and hardware to perform encryption are widely available, but successfully using encryption to ensure security may be a challenging problem. A single error in system design or execution can allow successful attacks. Sometimes an adversary can obtain unencrypted information without directly undoing the encryption. See, e.g., traffic analysis, TEMPEST, or Trojan horse. Digital signature and encryption must be applied to the ciphertext when it is created (typically on the same device used to compose the message) to avoid tampering; otherwise any node between the sender and the encryption agent could potentially tamper with it. Encrypting at the time of creation is only secure if the encryption device itself has not been tampered with. 4.5. DECRYPTION: The process of converting cipher text into plain text is called Decryption. Decryption involving bringing together an appropriate combination and the human visual system. Decryption is the process of taking encoded or encrypted text or other data and converting it back into text that you or the computer can read and understand. This term could be used to describe a method of un-encrypting the data manually or with un-encrypting the data using the proper codes or keys. Data may be encrypted to make it difficult for someone to steal the information. Some companies also encrypt data for general protection of company data and trade secrets. If this data needs to be viewable, it may require decryption. If a decryption passcode or key is not available, special software may be needed to decrypt the data using algorithms to crack the decryption and make the data readable.
  • 49. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 49 SJCET Derived from the name of the mathematician Muhammed ibn-Musa Al- Khowarizmi, an algorithm is a list of instructions, procedures, or formulas used to solve a problem. Today, algorithms are used millions of times every day for a variety of tasks. For example, an algorithm could look at an incoming e-mail to determine if it is spam or a legitimate e-mail and discard only spam messages. Ada Lovelace is credited as being the first person to develop an algorithm for a machine. Decryption is the process of transforming data that has been rendered unreadable through encryption back to its unencrypted form. In decryption, the system extracts and converts the garbled data and transforms it to texts and images that are easily understandable not only by the reader but also by the system. Decryption may be accomplished manually or automatically. It may also be performed with a set of keys or passwords. One of the foremost reasons for implementing an encryption-decryption system is privacy. As information travels over the World Wide Web, it becomes subject to scrutiny and access from unauthorized individuals or organizations. As a result, data is encrypted to reduce data loss and theft. Some of the common items that are encrypted include email messages, text files, images, user data and directories. The person in charge of decryption receives a prompt or window in which a password may be entered to access encrypted information. Decryption is the reverse process to Encryption. Frequently, the same Cipher is used for both Encryption and Decryption. While Encryption creates a Ciphertext from a Plaintext, Decryption creates a Plaintext from a Ciphertext. Sender :The main function of the sender is it encrypts the plain text to cipher text,that is in the human readable form.The examples of plain text is a text document,an executable file or an image. Receiver :The function of receiver is it decrypts the cipher text to plain text,that is is the scrambled version of plain text and it is not understandable form.
  • 50. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 50 SJCET CHAPTER-5 TOOL OUTLINE 5.1 Introduction to 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  Math and computation Algorithm development  Data acquisition  Modeling, simulation, and prototyping  Data analysis, exploration, and visualization  Scientific and engineering graphics  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 vecto 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 (Mfiles) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal
  • 51. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 51 SJCET processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others. The tutorials are independent of the rest of the document. The primarily objective is to help you learn quickly the ¯rst steps. The emphasis here is “learning by doing". Therefore, the best way to learn is by trying it yourself. Working through the examples will give you a feel for the way that MATLAB operates. In this introduction we will describe how MATLAB handles simple numerical expressions and mathematical formulas. The name MATLAB stands for MATrix LABoratory. MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. MATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming environment. Furthermore, MATLAB is a modern programming language environment: it has sophisticated data structures, contains built-in editing and debugging tools, and supports object-oriented programming. These factors make MATLAB an excellent tool for teaching and research. MATLAB has many advantages compared to conventional computer languages (e.g., C, FORTRAN) for solving technical problems. MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. The software package has been commercially available since 1984 and is now considered as a standard tool at most universities and industries worldwide. It has powerful built-in routines that enable a very wide variety of computations. It also has easy to use graphics commands that make the visualization of results immediately available. Specific applications are collected in packages referred to as toolbox. There are toolboxes for signal processing, symbolic computation, control theory, simulation, optimiza-tion, and several other fields of applied science and engineering. 5.1.1. Basic features As we mentioned earlier, the following tutorial lessons are designed to get you started quickly in MATLAB. The lessons are intended to make you familiar with the basics of MATLAB. We urge you to complete the exercises given at the end of each lesson.
  • 52. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 52 SJCET 5.1.2. Starting MATLAB After logging into your account, you can enter MATLAB by double-clicking on the MATLAB shortcut icon (MATLAB 7.0.4) on your Windows desktop. When you start MATLAB, a special window called the MATLAB desktop appears. The desktop is a window that contains other windows. The major tools within or accessible from the desktop are:  The Command Window  The Command History  The Workspace  The Current Directory  The Help Browser  The Start button 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 Library-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 eigenvalues, Bessel functions, and fast Fourier transforms. The MATLAB Language- This is a highlevel 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 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
  • 53. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 53 SJCET 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 Fortran programs 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. 5.2 Language Description 5.2.1 The MATLAB System The MATLAB system consists of five main parts: 5.2.2 Development Environment. Development Environment Include the set of tools and facilities that help us use MATLAB functions and files. Many of these tools are graphical user interfaces. Mat lab by itself can be used as a calculator, where all the calculations are done at the command prompt. Mat lab 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.
  • 54. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 54 SJCET Figure 5.1: Basic view of Mat lab. Mat lab is a copyright of Math Works Incorporation. The Math Works is committed to making MATLAB as fast as 3GL programming languages, like C and FORTRAN. The basic windows that help the user use Mat lab are five. These five windows are to enable ease access and interaction with Mat lab. These windows include,  The Command Window  Command history  Workspace Browser  Current Directory  Launch Pad Apart from these windows, the main Matlab window is called The Matlab desktop. If all the above shown windows are closed, then what we see is the Matlab desktop. This window is the main window and opens when Matlab starts and closes only when Matlab exists. In other words, exiting Matlab means closing or quitting this Matlab desktop. The figure below shows how this Matlab desktop looks.
  • 55. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 55 SJCET Fig 5.2 Matlab Desktop This window is the main window but do not provide any access to Matlab commands or functions. To interact with Matlab we need the first window ofthe above listed windows, The Command window. Shown in figure3, is The Command window. In the command window, we have the command prompt .This command prompt is just like the dos prompt where we type all the commands so that Matlab can understand the commands and give us the desired output. This is the point of interaction between the user and Matlab. We type different commands at the command prompt in the command window to execute our programs and achieve the desired tasks. Let us assume that we have a variable ‘a’, which has to hold the value ‘115’. So declare this variable, as we do in any other language, we say, >> a=115 this statement declares the variable, a and assigns it the value 115. Now declaring some more variables, >> b=2 ; >> c=10;
  • 56. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 56 SJCET Figure5.3: The Command Window >> myvar=1001 >> var1=2001; See the figure4 below and observe the difference between declaring the variables using a semicolon (‘;’) at the end of the declaration. Figure5.4: Variables
  • 57. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 57 SJCET From the figure we can observe that, for the declarations made using the ‘;’, there is no display of the variable and the value. And for those variables declared without ‘;’, the variable and its corresponding value is displayed immediately after the execution of the command (Any command is executed just by pressing the return key.). To clear the command window, we use the command, >> clc this command clears the command window. This is a basic command in Matlab. Matlab is case-sensitive hence the command typed >> a=115 is far different from the command >> A=115 these two commands creates two variables, ‘a’ and assigns 115 and ‘A’ and assigns the value 115. The next window in the above listed sequence is The Command History. By its name we can say that it is nothing but the history of the commands typed at the command prompt. See figure5 for the Command History. Statements you enter in the Command Window are logged in the Command History. All the statements we can see in the command history are the commands typed at the command prompt. There is a time stamp at the beginning of the window, which denotes the start of each session of Matlab. Figure5.5: The Command History The command history not only stores the Matlab commands but it also stores everything what ever is typed at the command prompt. E.g.: the ‘abcdef’ in the
  • 58. ENHANCED VISUAL CRYPTOGRAPHY USINGMATLAB Dept of ECE 58 SJCET command history. This ‘abcdef’ is not a valid Matlab command but still is store in the command history since it is typed at the command prompt. The next window is The Workspace Browser. The MATLAB workspace consists of the set of variables (named arrays) built up during a MATLAB session and stored in memory. You add variables to the workspace by using functions, running M-files, and loading saved workspaces. To view the workspace and information about each variable, use the Workspace browser. Figure5.6: Workspace Browser 5.3 Image Processing schemes Image processing is referred to processing of a 2D picture by a computer. Basic definitions: An image defined in the “real world” is considered to be a function of two real variables, for example, a(x,y) with a as the amplitude (e.g. brightness) of the image at the real coordinate position (x,y). Modern digital technology has made it possible to manipulate multidimensional signals with systems that range from simple digital circuits to advanced parallel computers. The goal of this manipulation can be divided into three categories:  Image Processing (image in -> image out)  Image Analysis (image in -> measurements out)  Image Understanding (image in -> high-level description out)