0% found this document useful (0 votes)
15 views6 pages

3 10 1 PB

Uploaded by

Stephanie Imelda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views6 pages

3 10 1 PB

Uploaded by

Stephanie Imelda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Jurnal Media Elektro , Vol. 1, No.

1, April 2012 ISSN 9772252- 669007

IMPLEMENTATION OF VISUAL CRYPTOGRAPHY TECHNIQUE ON


SQUARE BW SECRET IMAGES
1 2
Stephanie I. Pella , M. J. Pella

1. Electrical Engineering Department, Faculty of Science and Engineering, University of Nusa Cendana, Jl Adisucito,
Penfui, Kupang, 85000, Indonesia
2. Mathematics Department, Faculty of Science and Engineering, University of Nusa Cendana, Jl Adisucito, Penfui,
Kupang, 85000, Indonesia

E-mail : [email protected], [email protected]

Abstract

The advance of computer security technology has led to the invention of many cryptography
algorithms. Visual Cryptography is a cryptography technique that needs no cryptographic
computation in decoding. To encode a secret image, the image is encrypted to several transparent
shares. In order to retrieve the secret image shares are stacked on top of each other. This paper
describes a technical implementation of this algorithm on a square black and white image for VC2,2
Scheme and VC3,3 Scheme. The result shows that the model works well with an image that contains
text.

Keywords : Visual Cryptography, Computer Security, Secret Sharing, BW Image.

1. Introduction In visual cryptography, each shared image can act as either


the encrypted information (chipper) or the key, hence the
Most currently implemented cryptography technique relies length of the key equal to the length of the cipher. So other
on the availability of computer for the encryption and than reduce the complexity of description process, this
description processes. The use of complex mathematics cryptography technique also provides a better resistance to
function makes it nearly impossible to do the calculation the brute-force method. By having a key that have the
by hand. Both encryption and description processes need a same length with the chipper (n bits), an intruder have to
quite expensive calculation resulting in additional tries at most 2n to reveal the message. Since n is much
processing time when the cryptography method is longer than k, visual cryptography provides much better
implemented in data security schemes. security to the brute force technique, given the same n,
than other symmetric cryptography schemes.
Cryptography technique usually uses a secret key in
concealing the secret information, so only the ones that Many paper has discussed this technique in mathematical
have the key can decrypt the message. The strength of level [2][3][4][5]. This paper will address the technical
encryption relies on the strength of the key, generally implementation of the visual cryptography technique on a
proportional to the length of the key. Traditionally the key square BW image, using MATLAB 7.
used on encryption process is much smaller than the
information itself. So in theory, by trying at most 2 k times, 2. Methods
where k is the length of the key in bits, an intruder can
break every cryptography technique. This method of trying The development of this implementation contains three
every possible combination of a key is generally known as phases. In the first phase we investigate the mathematical
brute force [1]. models of visual cryptography and adjust some properties
to meet the need of our implementation. Here we inspect
In [2][3], Visual Cryptography, a cryptography technique the models for encoding the secret images into two special
relying only on human visual sight in the description cases VC2,2 and VC3,3 as described in [2][3][4]. The
process, is proposed. This technique focused on the second phase deals with the software development base on
encryption of a written material such as printed text, the model in phase 1. In phase three, we test our
picture, handwritten notes or map. The original image is implementation by running security check to ensure that
encrypted into several new images, called shared image, stacking less than n shares cannot reveal the secret image.
by adding a random noise. The principle is, from any
individual new images, one cannot determine the original 2.1 Mathematics Model
image due to the additional random noise. When a set of
shared images is printed on transparence sheets and In the basic model every pixel in the original image is
stacked together, the original will be revealed. encrypted into n shares. Each shares contains m black and

7
Jurnal Media Elektro , Vol. 1, No. 1, April 2012 ISSN 9772252- 669007

white sub-pixels, with Thus, if for a given white pixel from the original image
every share is picked up from C0, condition (1) ensures
m = 2n-1 (1) that the pixel will be greater than the threshold d and
recognized as white once k shares stacked. For black pixel
A matrix S (size n x m) is used to describe the structure opposite condition holds if for every share S is chosen
using the rule described in equation (2) from C1. Those properties are called contrast, whereas
property (3) is called security, because it is not possible to
{ (2) decide whether the pixel is black or white when less that n
shares are available.

The solution of this model is stored in two matrices (C 0, In a VC2,2 case, the secret image is encrypted into two
C1). To construct C0 and C1 in this implementation, we shared image and both shares are required in decryption
simplify the rules in [2], such that: process. While according to equation (1), using 2 subpixels
1. For any matrix S in C0 the “or” all required per pixel in the original image is enough, in this
shares will satisfy H(V)<m implementation, each pixels in the original image will be
2. For any S in C1 the “or” V of any k of then rows encrypted into 4 subpixels to maintain the aspect ratio of
of S will satisfy H(V) = m the image. C0 and C1 are generated by randomly picking
3. For any subset of required shares, the “or(s)” of the shares in Figure 1. When the pixel in the original
some or all the subset will contain same image is white the same subpixels from the same shares
matrices with same frequency. will be used for C0 and C1. Opposite condition is applied
for a black pixel.

horizontal shares vertical shares diagonal shares

Figure 1 Shares of VC2,2 [2]

Figure 2 Model for VC2,2

8
Jurnal Media Elektro , Vol. 1, No. 1, April 2012 ISSN 9772252- 669007

The more detailed explanation of the model can be


viewed in Figure 2, where we described the example of
Binarization
2x2 image, with the possible subpixel in share 1 and share
2. Here we can see that where the pixel in original image
Grayscale Image
Im(i,,j) is white, we have the same subpixels for share 1 Grayscale Image
and share 2. On the other hand, when pixel in original Subpixel Construction
image is black, the subpixel in share1 is the negation of
the subpixel in share2. To map the subpixel into the
shared images S1 and S2 we use the rule described in
Subpixels Mapping
equation 3.

( )
( ) { (3)
( ) Image Creation
Share
Share11 Share
Share22
In the description process, human eyes will interpret the
gray area (H(v) <m ) as white pixel and the black area as Encrypted Images
Encrypled images
black pixel.
Extending the model of VC2,2 we can generate C0 and C1
matrices for VC3,3 where the secret images is encrypted Figure 3 Encryption Process
into 3 shares. Each pixel will be encrypted into m =23-1=4.

Start
[ ]

For i,j=0:m
[ ] (4)
Gray Scale Image
Read Pixels
GS
The or-ed of the three rows in C1 will have H(v) = 4 GS(i,j)
which is equal to m, while in C0 will have H(v) = 3 which
is less than m. These properties satisfy condition (1) and
(2). Furthermore the or-ed of less than three rows in C0
and C1 will have same H(v) which satisfy condition (3). GS(i,j)>128 Y BW(I,j)=1

2.2 Software Design N

Software design in this implementation is divided into BW(I,j) =0


four stages, namely binarization, subpixel construction,
subpixel mapping and shared image creation as described
in Figure3. Output BW Black White Image
Image BW
The binarization process convert the 8 bit grayscale image
(256 level intensity) into 1 bit black and white (BW)
End
image using 128 as the threshold as shown in the
flowchart in Figure 4.

In constructing the subpixel for each pixel in the original


Figure 4 Binarization
image, a set of share subpixel is randomly selected from
figure 1 for VC2,2 case and equation (4) for VC3,3 case. After mapping the all set subpixel into share Sn the next
C0 matrix is used for a white pixel abd C1 matrix for the stage is to create an image to be printed in a transparent
white one. sheet. The image is created by using the data in matrix Sn,
where n is equal to 1 and 2 for the VC2,2 case and 1, 2
The subpixels is mapped into the shared images Sn
and 3 for the VC3,3.
(where n=1,2,3) using the formula in equation (3). It is
important to be noted that the formula is only applicable For decoding process, in real execution, to reveal the
for 4 subpixels per pixel mapping as the case in VC2,2 original image all the transparent sheets are aligned
and VC3,3. When more shares are used, the formula together. In this report, the aligned process is done
needs to be alterd to meet the condition. mathematically using software by using “or” to all
matrices that contain the subpixels from original images

9
Jurnal Media Elektro , Vol. 1, No. 1, April 2012 ISSN 9772252- 669007

pixel in the original image) have same frequency of black


3. Result and white dots. The decrypted image is quite clear so that
a human user can distinguish the original image from the
We implement the model discussed in section 2 in decrypted image.
MATLAB 7 environment. The encryption and decryption
result of VC2,2 for an image containing text can be Figure 6 shows the result of the same model when deals
shown in Figure 5. Here we can see that share 1 and share with a non-text image. The result shows that even though
2 reveal nothing of the original image. The share images the decrypted image is still recognizable, the clarity of the
contain the black and white pixels that appear random to image is not as good as the text image from human sight
the bare eyes. Both the areas that contain the message point of view.
(black pixel in the original image) and the space (white

Original Image Share 1

Share 2 Depcrypted image

Figure 5 VC2,2 of Text Image

Original Image Share 1

Share 2 Depcrypted image

Figure 6 VC2,2 of Non-Text Image

Figure 7 and figure 8 shows the result of encryption and 3 in Figure 7 look random for human sight and by having
decryption in VC3,3 schemes. Share 1, share 2 and share only one share, one can not reveal the original image.

10
Jurnal Media Elektro , Vol. 1, No. 1, April 2012 ISSN 9772252- 669007

stacking only 2 shares in any combination still have the


In Figure 8, it is shown that only by stacking 3 shares same H(v) for the white and black area.
together, one can reveal the original image. The result of
Original Image Share 1

Share 2 Share 3

Figure 7 Encryption of VC3,3

Stack of s1 and s2 Stack of s2 and s3

Stack of s1 and s3 Stack of s1, s2, s3

Figure 8 Descryption of VC3,3

11
Jurnal Media Elektro , Vol. 1, No. 1, April 2012 ISSN 9772252- 669007

4. Discussion 5. Summary

The result shows that the model works perfectly in images In this paper we have discussed the implementation of
that contain text. The contrast between the white pixel and Visual Cryptography technique in a BW image. We
black pixel in the decrypted image is easily construct two implementations for VC2,2 and VC3,3
distinguishable by human eyes. In non-text images, the schemes.
contrast between black and white pixels in the decrypted
is not very clear for human sight. The model works properly for images that contain text.
For non-text images, the contrast of black and white
The low quality of the original BW image is the main pixels is not very obvious for human sight due to the low
factor of the problem in non-text images. Converting a quality of BW image.
grayscale pixel into a BW image decreases the quality of
the image to 1/28 of the original image. Adding noise to
the white pixel is damage the quality even more. REFERENCES
The result shown in section 3 also confirms that brute [1] William Stalling. 2011 Network Security Essential:
force attack for visual cryptography cost more than doing Application and Standards, Prentice Hall.
so in other cryptography technique. Most technique uses [2] M. Naor and A. Shamir. 1994. Visual Cryptography.
the key that much smaller than the message. Here the in Proc. Advances in Cryptology. vol. 950, LNCS,
attackers have to deal with the key that actually bigger pp. 1-12.
than the original message. [3] G. Ateniese, C. Blundo, A. De Santis, and D.R.
Stinson. 1996. Visual Cryptography for General
Figure 5 and Figure 6 shows that the 250x250 pixel Access Structures. Inf. Comput. vol. 129, no. 2, pp.
original image is encrypted into two 500x500 pixel 86-106.
shares. When an attacker only have one share, to revealed [4] C.-N. Yang and C.-S. Laih. 1999. Some New Types
the original image he need 2(500)(500) tries, or have the key of Visual Secret Sharing Schemes. in Proc. Nat.
strength of 250000 bit key. Moreover for general k x k Computer Symp. vol. 3, pp. 260-268.
pixel secret image in VC2,2 scheme the attacker need [5] W.-G. Tzeng and C.-M. Hu. 2002. A New Approach
24(k)(k) tries. The number will expand exponentially when for Visual Cryptography. Design, Codes and
we add more shares and or use larger image. Cryptography. 27,207-227.

Here we can see that brute-forcing a visual cryptography


schemes cost more expensive than try guessing the pixel
original image. So it is safe to say that this scheme is
secure from brute force attack.

12

You might also like