You are on page 1of 5

Visual Cryptographic Algorithm with Shared Data

Gazal Sahai

T.S.Lamba
Software Engineer Professor, E& ECE Dept.
Samsung India Software Operations, Indian Institute of Technology
Bangalore 560052 Kharagpur 721302
gazal.sahai@samsung.com tsl@ieee.org

Previously with E & ECE Dept., IIT Kharagpur.


ABSTRACT
We propose a visual (k,n) threshold secret
sharing scheme using Lagranges Polynomial
Interpolating Scheme wherein the secret is
divided into n shares but can be totally
recovered from any k (k < n) shares. Each
cover image with each user partially contains
some secret information. Now if any k of these
users gets together and reveals their cover
images, the proposed method allows us to
know the hidden secret image. Since a
polynomial of degree k-1 cannot be
reconstructed with less than k values,
retrieving the secret image with less than k
shares becomes extremely difficult.
Suggestions for enhancing security are also
discussed.
1. INTRODUCTION
A secret sharing scheme is a method via which
a secret is divided into multiple parts called
shadows or shares and distributed to a
collection of individuals. When the allowed
coalition of participants pool in their shares
the secret is revealed. Various Secret Sharing
Schemes for Visual Cryptography have been
proposed.

In 1994, Naor and Shamir [1] described a new
(k,n) visual cryptographic scheme using black
and white images, where the dealer encodes a
secret into n participants. The secret is visible
only if k or more participants stack in their
shares together. The concept of arcs to
construct colored visual cryptographic scheme
has been proposed by Verheul and Van
Tilborg [2] where colored secret images could

be shared. The resolution of the revealed
image was determined by the number of colors
and number of sub pixels and thus if the
number of colors was large, then coloring the
sub pixels and stacking the shares precisely
becomes a difficult task. In [3], a new visual
cryptographic scheme to improve the visual
effect of the shares was proposed by Hwang.
This scheme was useful when the number of
shares was large and could be implemented
only for black and white images. Subsequently
Chang, Tsai and Chen [4] modified and
extended this scheme to color images using
Color Index Tables. In [5], Chang proposed a
scheme wherein the size of the shares is fixed
and independent of the number of colors
appearing in the secret image. Further, the
pixel expansion was only 9, which was the
least amongst the previously proposed
methods. But this algorithm is only applicable
for (n,n) schemes.

There is often a need to be able to see a secret
image when several k out of every n users get
together. It is also desired that the material
containing the image is available to everybody
but it is not obvious that the visible data
contains the desired image. To achieve this:
(1) A secret sharing scheme is used
(2) We use steganographic methods to hide the
image in other images.

In this paper, we propose a novel algorithm for
implementing (k,n) secret sharing for images
(0-255 gray levels) using Lagranges
Interpolating Polynomial Scheme retaining all
the advantages of Changs scheme. Further,
we propose modifications for enhancing the
clarity of the secret shares.

The paper is organized in sections. We first
describe the methods for secret sharing and
image hiding. Then we propose the image
recovery algorithm. We show the improvement
using the proposed scheme followed by
security analysis. Finally we conclude the
paper.
2. THE SECRET SHARING ALGORITHM
The (k,n) scheme has been implemented
using Lagranges interpolating polynomial
scheme. The method relies on the fact that to
reconstruct a polynomial of degree n, one must
know n+1 points that lie on it. Thus, when
presented with the problem of dividing a secret
image into n shares such that k are required to
recover it, the algorithm proceeds by creating a
polynomial of degree k-1,

S(x) = C+S
1
X+S
2
X
2
+.+S
k-1
X
k-1
.

The coefficients, S
i
, used in the polynomial are
of little significance and are randomly
generated. Once the polynomial has been
created the n shares are returned as
coordinates (x, y=S(x)) on the polynomial.
Typically, the points (1, S(1)), (2,S(2)), . (N,
S(N)) are used, but any n values of x could be
chosen randomly for generating shares as long
as one of them is not 0. Using these shares and
cover images, the n secret images are created
as described below.

The following notation is used while
describing the algorithm:
n total number of participants.
K least number of participants required to
recover the secret image
c pixel value of the secret image.
p A prime number greater than n and c
Here p is chosen to be 257. For every pixel in
the secret image, perform the following steps:

Step 1: Construct a polynomial in which the
constant part of the polynomial that is, C gives
the secret pixel value.
For example, in the (3,5) scheme k=3, n=5,
the coefficients are randomly generated for
every pixel. Suppose the pixel value of the
secret image is 68.The polynomial constructed
is of the form

h(x) = (2x
2
+ 10x + 68) mod 257.

Step 2: Calculate the value of shares for the n
participants using h(x) by putting the values of
x from 1, 2 to n.

For the first user,
K1 = h(1) = (2+10+68) mod 257
=80 mod 257 = 80.
Step 3: If (number of ones in binary
representation) < 4.Then
{
(i) Invert all the bits
(ii) Insert 1at a pre-defined location to make it
a 9-bit number
}
else
{
Insert 0 at the pre-defined location
}
The position of this bit can be changed but
would require an additional cost of storing the
random locations along with the share.
80
10
= 0 1 0 1 0 0 0 0
2.

We invert these 8 bits and add a redundant bit
at a predefined location (e.g. the first position).
Thus we get 1 1 0 1 0 1 1 1 1.
3. IMAGE HIDING ALGORITHM
In the 9 bit number of each share, wherever
1s appear, overwrite it with the
corresponding pixel value of the Cover image
for the each user. Convert each pixel in the
secret image into a 3*3 binary matrix for each
user.

If c=128, then the 3*3 matrix would be

128 128 0
128 0 128
128 128 128


This 3*3 matrix is an expanded version of the
secret image pixel and occupies the
corresponding position in the shares. We get
the shares (images) which are 3 times the
linear size of the original secret image. Fig. 1
shows the encrypted output of the (3,4)
threshold scheme.
















Fig 1: Encrypted Output for (3,4) Scheme. Note
that the size of the shares is 3 times (per side) of the
original cover images (size reduced due to lack of
space)
4. IMAGE RECOVERY ALGORITHM
In order to recover the image, at least k
participants are required to reveal the secret
image. The pixel values of the secret image,
as contained in the constant of the polynomial,
needs to be retrieved.

Apply the following algorithm for each 3*3
matrix of the k shares.

Step 1: Pick the 3*3 matrix from each of the k-
encrypted images, and change its non-zero
vales back to 1.

Step 2: if (redundant bit ==1)
{
Then invert all the bits
}
Get the value of the 8 bit number (share)

Step 3: calculate the value of the pixel using
the below formulae

= =

=
k
s j j
j s
j
k
s
s
x x
x
K
C
, 1 1
mod p














Fig 2: Decrypted Output for (3,4) Scheme.

Fig 2 shows the retrieved c using the encrypted
images, as in (3,4) example, of user 2, user 4,
and user 5 as


) )( (
) )( (
5
) )( (
) )( (
4
) )( (
) )( (
2
2 3 1 3
2 1
3 2 1 2
3 1
3 1 2 1
3 2
x x x x
x x
K
x x x x
x x
K
x x x x
x x
K C


+


+


=


Where K
i
is the i-th user share value
x
i
= i for i-th user
The secret image can thus be reconstructed by
following the decryption algorithm for all the
3*3 blocks in the encrypted images.

5. IMPROVEMENT

One of the limitations of using this scheme is
that the share is not an exact reproduction of
the cover image. It is an expansion of the
original, with extra black pixels, resulting in a
loss of contrast to the entire image and giving
rise to a suspicion of hidden information. To
mitigate this graying effect an improvement is
suggested in the subsequent section. After
implementing this, Fig 3, we see that blurring
is considerably reduced and does not indicate
hiding of data. The clarity of the secret images
obtained can be increased by doing the
following at the time of encryption.






Fig 3: (a) Original Cover Image














Fig 3: (b) Encrypted image before improvement












Fig 3: (c) Encrypted image after improvement

After Step 2, Insert 1 to the binary value of the
share calculated at a pre-defined location to
make it a binary number.
Form the 3*3 matrix by replacing all 1s with
the pixel value,c, of the cover image and 0s
with c-1. This matrix is now an expanded
version of the secret image pixel and occupies
the corresponding position.
6. SECURITY ANALYSIS

Since a polynomial of degree k-1 cannot be
reconstructed with less than k values,
retrieving the secret image with less than k
shares would become extremely difficult. In
the algorithm, for every pixel in the secret
image, a new polynomial with randomly
generated coefficients needs to be
constructed. This further enhances the
secrecy.

Another mechanism would be to guess the
value of share. The share values lie between 1
and 255. The probability of guessing the
correct value of the share for one pixel would
be 1/255. Hence the probability for only k-1
users to retrieve the secret image would be
(1/255)
s
, where s is the size of the secret
image. For the stated problem the probability
of guessing further reduces to (1/10)*(1/255)
s
.
In either way, it can be observed that the
probability for illegal users less than k to
retrieve the secret image is very low.

To improve secrecy we can have many images
in a catalogue of which only a few hold
meaningful data. Now, if any unauthorized
person attempts to attack the system, he has to
first identify the k correct cover images. Thus
this guarantees enhanced security. The secrecy
can be further increased by changing the
position of the redundant bit for every pixel of
the secret image. But, this would require extra
memory for storing the redundant bit
positions.
7. EXPERIMENTAL RESULTS

After implementing the proposed secret
sharing scheme with the improvement
suggested, n corresponding cover images are
generated. On Decryption, the secret image is
revealed without any distortion. The size of
the Encrypted images is 3 times the original
cover images irrespective of the number of
gray levels. The Encrypted images formed
closely resemble the original cover images and
the slight distortion observed is due to the
pixel expansion. Besides, when we use n
identical cover images to hide different share
values, it becomes difficult for the human
visual system to distinguish the minute
difference between these images, thus making
all the n encrypted images look alike (Fig. 4).

8. CONCLUSION

In this paper, we proposed a new scheme
which provides an efficient way to share a
gray image among n different users using
Lagranges Interpolating Polynomial Scheme.
The shares of the image are hidden in a cover
image so that it is not obvious that there is
secret information inside them. The proposed
scheme has advantage of low computation and
avoids the drawbacks mentioned in the
previous approaches. This scheme can be
further extended to cover images by
implementing the algorithm individually for
R,G and B gray levels.




REFERENCES

[1]M. Naor and A. Shamir. Visual cryptography.
Advances in Cryptology-EUROCRYPT 94, Lecture
Notes in Computer Science, (950):112, 1995.
[2] E. Verheul and H. V. Tilborg. Constructions and
properties of k out of n visual secret sharing schemes.
Designs,Codes and Cryptography, 11(2):179196,1997.
[3] R. Hwang and C. Chang. Some secret sharing
schemes and their applications. Ph.D. dissertation of the
Department of Computer Science and Information
Engineering, National Chung Cheng University, Chiayi,
Taiwan, 1998.
[4] C. Chang, C. Tsai, and T. Chen. A new scheme for
sharing secret color images in computer network.
Proceedings of International Conference on Parallel and
Distributed Systems, pages 2127, July 2000.
[5] Chen-Chen Chang Sharing a Secret Gray Image in
Multiple Images National Chung Cheng University,
Taiwan.2002.


















































Fig 4: Encrypted & recovered images for (3,4) scheme after improvement

Secret Image
Original Cover
images
Encrypted
Cover
images
Recovered secret
image

You might also like