• No results found

Journal of Environmental Science, Computer Science and Engineering & Technology

N/A
N/A
Protected

Academic year: 2022

Share "Journal of Environmental Science, Computer Science and Engineering & Technology"

Copied!
13
0
0

Loading.... (view fulltext now)

Full text

(1)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153.

Journal of Environmental Science, Computer Science and Engineering & Technology

An International Peer Review E-3 Journal of Sciences and Technology

Available online at www.jecet.org Computer Science

Research Article

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1141

An Implementation of Algorithms of Visual Cryptography in binary and Gray Scale Images

Archana B. Dhole and Nitin J. Janwe

Department of Computer Science & Engg, Rajiv Gandhi College of Engineering Research & Technology, Chandrapur, Maharashtra

Received: 5 October 2013; Revised: 15 October 2013; Accepted: 19 October 2013

Abstract: Visual Cryptography is a new Cryptography technique which is used to secure the images. In Visual Cryptography the Image is divided into parts called shares and then they are distributed to the participants. The Decryption side just stacking the share images gets the image. The initial model developed only for the bi-level or binary images or monochrome images. Later it was advanced to suit for the Color Images means Gray Images and RGB/CMY Images. This paper presents a study of implementation of algorithm of visual cryptography, Implementation of security level in Visual Cryptography Sharing Algorithm for Gray Level Images and Comparison with previous approaches show the superior performance of the new method. Experimentation are conducted with standard synthetic and real data set images, which shows better performance of proposed color image visual cryptic scheme measured in terms of PSNR value and time with existing binary method.. The results showed that the PSNR values for proposed scheme is better than the existing scheme and maintains security.

Keywords: This paper presents a (2, 2)-VSS scheme for binary as well as gray scale.

INTRODUCTION

Visual cryptography is a cryptographic technique which allows visual information (e.g. printed text, handwritten notes and pictures) to be encrypted in such a way that the decryption can be performed by the human visual system, without the aid of computers. Naor and Shamir 1, in 1994 proposed a new

(2)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1142 security technique named visual cryptography scheme2-4. In this technique, a secret image of type binary is encoded in a cryptographically manner into random binary patterns which contains n shares in a k-out-of-n scheme. With the rapid advancement of network technology, multimedia information is transmitted over the Internet conveniently. Various confidential data such as military maps and commercial identifications are transmitted over the Internet5-8. While using secret images, security issues should be taken into consideration because hackers may utilize weak link over communication network to steal information that they want. To deal with the security problems of secret images, various image secret sharing schemes have been developed. Visual cryptography is introduced by first in 1994 Noar and Shamir.Visual cryptography is a cryptographic technique which allows visual information(e.g. printed text, handwritten notes and pictures) to be encrypted in such a way that the decryption can be performed by the human visual system, without the aid of computers. Naor and Shamir in 1994 proposed a new security technique named visual cryptography scheme. In this technique, a secret image of type binary is encoded in a cryptographical manner into random binary patterns which contains n shares in a k-out-of-n scheme. The n shares are distributed among n participants in such a way the each participants share is not known to another participant. The secret image can be visually revealed by k or more participants by joining all the shares available. Even if computational power decoding is available, cannot be done on the secret image by k-1 or fewer participants9.

Fig. 1.1(A): Construction of (2, 2) VC scheme: a secret pixel is encoded intofoursubpixels in each of two shares. The decrypted pixel is obtained by superimposing the blocks in shares one and two.

Fig. 1.2(B): Example of 2-outof-2 scheme. The secret image is encoded into two shares showing random patterns. The decoded image shows the secret image with 50% contrast loss. (a)Binary secret image. (b) Encrypted share 1. (c) Encrypted share 2. (d) Decrypted secret message.

Even with the remarkable advance of computer technology, using a computer to decrypt secrets is infeasible in some situations. For example, a security guard checks the badge of an employee or a secret agent recovers an urgent secret at some place where no electronic devices are applied. In these situations the human visual system is one of the most convenient and reliable tools to do checking and secret recovery. Visual cryptography (VC), proposed by Naor and Shamir1, is a method for protecting image-based secrets that has a computation-free decryption process. In the (2, 2) VC scheme each secret image is divided into two shares such that no information can be reconstructed from any single share.

Each share is printed in transparencies. The decryption process is performed by stacking the two shares and the secret image can be visualized by naked eye without any complex cryptographic

(3)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1143 computations. In the above basic VC scheme each pixel ‘p’ of the secret image is encrypted into a pair of sub pixels in each of the two shares. If ‘p’ is white, one of the two columns under the white pixel in Fig. 1 is selected. If p is black, one of the two columns under the black pixel is selected. In each case, the selection is performed randomly such that each column has 50% probability to be chosen. Then, the first two pairs of sub pixels in the selected column are assigned to share 1 and share 2, respectively. Since, in each share, p is encrypted into a black–white or white–black pair of sub pixels, an individual share gives no clue about the secret image. By stacking the two shares as shown in the last row of Fig. 1, if ‘p’ is white it always outputs one black and one white sub pixel, irrespective of which column of the sub pixel pairs is chosen during encryption. If ‘p’ is black, it outputs two black sub pixels. Fig. 1- Construction of (2, 2) VC Scheme Hence there is a contrast loss in the reconstructed image. However the decrypted image is visible to naked eye since human visual system averages their individual black–white combinations.

Applications of Visual Cryptography: Today the growth in the information technology, especially in computer networks such as Internet, Mobile communication, and Digital Multimedia applications such as Digital camera; handset video etc. has opened new opportunities in scientific and commercial applications. But this progress has also led to many serious problems such as hacking, duplications and malevolent usage of digital information. Being a type of secret sharing scheme, visual cryptography can be used in a number of applications including access control. For instance, a bank vault must be opened every day by three tellers, but for security purposes, it is desirable not to entrust any single individual with the combination. The rest of this paper is organized as follows: in Section 2 introduces our proposed encryption method including bit plane coding and shares. Section 3 gives experimental results having PSNR values to show the effectiveness of our scheme and we will finalize this paper in Section 4.

II Proposed Encryption method:

1st Module: Study of Implementation of Visual Cryptography algorithm.

2nd Module:

• Implementation of security level in Visual Cryptography Sharing Algorithm for Gray Level Images.

• Decryption Process

3rd Module: Comparison to existing scheme.

Ist Module:

Implementation of Visual Cryptography Sharing Algorithm for Binary Images.

In this module of (2:2) scheme the secret image which is to be converted into gray level then into binary level images.

The image is to be divided in to 2 no. of shares by using visual cryptography algorithm.

White Pixel processing and black pixel processing is done here.

Definition: Two matrices are called basis matrices, if the two collections and in Definition 2.1 are obtained by permuting the columns of in all possible ways, respectively, and satisfy the following two conditions.

1) Contrast condition: if, the row vectors and, obtained by performing OR operation on rows of, respectively and satisfy.

(4)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1144 2) Security Condition: if, one of the two matrices, formed, respectively, by extracting rows from and , equals to a column permutation of the other. The construction of the basis matrices is a topic of study in conventional VC. Several design procedures, such as the method using cumulative arrays, are readily available 10. An example of , and is given next to illustrate the above-mentioned concepts.

Example: The basis matrices and the collections of the encoding matrices in the conventional two- out-of-two scheme (shown in Fig.1.1) can be written as

S0= 0 1 S1 = 0 1 0 1 1 0

C0 = 0 1 . 1 0 0 1 1 0

C1 = 0 1 . 1 0 1 0 0 1

Fig.2: Encryption (Share Formation) and Decryption for Binary Images

• In Visual Cryptography the secret image is to be divided into 2 no. of shares and pixel is subdivided into 4 subpixel. Sij is the resulting or basis matrix constructed by Co and C1.

• Sij = 1 if jth pixel in ith share is white.

• Sij=0 if jth pixel in ith share is black.

• A pixel P is split into two subpixels.

• If P is white, then a coin toss is used to randomly choose one of the first two rows in the figure above.

• If P is black, then a coin toss is used to randomly choose one of the last two rows in the figure above.

• The pixel P is encrypted as two subpixels in each of the two shares, as determined by the choosen row in the figure.

(5)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1145

• Every pixel is encrypted using a new coin toss.

• When superimpose the two shares, consider one pixel P.

• If P is black, we get two black subpixel.

• If P is white, we get one black and one white subpixel and original image reveals back.

2ndModule: Implementation of security level in Visual Cryptography Sharing Algorithm for Gray Level Images.

• In Gray scale image the value of each pixel carries only intensity information. Images are known as black and white composed of gray.

• It is also known as monocrome.

• It has many shades of gray. Each pixel has 8 bit of information. Intensity of pixel is the range between minimum and maximum.

• The gray scale image is first decomposed into 8 bit binary codes by using bit planes that are equivalent to 8 binary images.

• It gives better approximation.

• If a bit on the nth bit plane on an m bit the dataset is set to 1, it contributes a value of 2(m-n), otherwise it contributes nothing.

• 8 bit value of bitplane.

Table-1: Binary representation of a no. 181.

Applied the VCS to each bit plane in order to get n random looking binary images.

By stacking the corresponding binary images in bit level, the gray-scale noisy shares can be generated.

S( , ) = 1 ( , ).2 −1+ 2( , ) .2 −2+⋯……...+ ( −1) , .2 + 8( , )

For gray scale image the first part is just initialization phase. For White Pixel take 1:127 and 128:255. For Black take 1:127 and 255-1:128.

Then application of visual cryptography to all image bits.

Then combining all the bits to form the actual image and Finally display the image

Bit plane coding: In our proposed scheme use the following algorithm for visual cryptography. As in the binary images use 0 and 1 for black and white pixel, in gray scale for White Pixel take 1:127 and

Bit Plane Value Contribution Running Total

1st 1 1*2 ^7=128 128

2nd 0 0*2 ^ 6=0 128

3rd 1 1*2 ^ 5 =32 160

4th 1 1*2 ^4=16 176

5th 0 0*2 ^ 3=0 176

6th 1 1*2 ^ 2=4 180

7th 0 0*2 ^ 1=0 180

8th 1 1*2 ^ 0=1 181

(6)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1146 128 :255. For Black take 1:127 and 255-128:1.. It makes critical the original algorithm. Firstly, 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.

Fig.3: The 8 bit-planes of a gray-scale image (the one on left) there are eight because the original images uses eight bits pixel.

clc;

clear all;

[file path] = uigetfile ('*.jpg','JPEG Files');

img = imread ([path file]);

try

img = rgb 2 gray(img);

end tic;

img = imresize (img,[256 256]);

img_bkp = img;

img = img + 1;

%Get the bits of the image Disp ('Extracting image bits');

bit_planes = extractBitPlanes(img);

disp('Image Bits Extracted');

% Now get perform bitwise seperation of the planes share1 = zeros ([8 size(img,1) 2*size(img,2)]);

share2 = share1;

for count=1:8

fprintf('Processing share:%d\n',count);

[share1(count,:,:)share2(count,:,:)] = generateVisual Cryptography Gray (reshape (bit_planes (count,:,:), size (img,1), size (img,2)));

End

% Combine the parts

out_img1 = zeros ([size (img, 1) size (img, 2)]);

(7)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1147 out_img2 = out_img1;

for r=1: size (share1, 2) For c=1: size (share1, 3)

out_img1(r,c) = share1(8,r,c)*128 + share1(7,r,c)*64 + share1(6,r,c)*32 + share1(5,r,c)*16 + share1(4,r,c)*8+ share1(3,r,c)*4+ share1(2,r,c)*2+ share1(1,r,c);

out_img2(r,c) = share2(8,r,c)*128 + share2(7,r,c)*64 + share2(6,r,c)*32 + share2(5,r,c)*16 + share2(4,r,c)*8+ share2(3,r,c)*4+ share2(2,r,c)*2+ share2(1,r,c); end

End time = toc;

psnr = findPSNR(double(out_img2),double(out_img1));

printf ('Time:%0.02fs,PSNR:%0.02fdB\n',time,psnr*100);

subplot(3,1,1);

imshow(img_bkp);

title('Original Image');

subplot(3,1,2);

imshow(out_img1,[]);

title('Separated Image 1');

subplot(3,1,3);

imshow(out_img2,[]); title('Separated Image 2');

save('visual_crypt_','out_img1','out_img2','img');

DECRYPTION

In the decryption process the shares are stacked together to form the original images.

Bit planes are extracted first.

In bit plane decoding XOR operation is used.

Fig.4: Encryption

(8)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1148 Fig.5: Decryption

Fig.5: Decryption

3rd Module-Comparison to existing scheme: The secret image of size 256× 256 pixels shows the picture respectively. Original images of ‘Flower’ of size 256 × 256 in natural colors are provided for the share generation. We use the peak noise-to-signal ratio (PSNR) distortion measure for the visual quality comparison between the original images and the encrypted images using following method.

Use PSNR Values to compare the output in between the existing scheme and proposed scheme.

Peak signal to noise ratio is the ratio between maximum value of a power of a signal and the power of corrupting noise.

Higher the PSNR value better is the quality of image.

Normally it is between 30 to 50db. Where higher is better.

We compare the quality of image by using PSNR value.

The essential parameter indicates the superiority of the renovation is the Peak Signal-To-Noise Ratio (PSNR). PSNR is the ratio between the maximum possible power of the signal and the power of corrupted noise that is articulated in decibels.

Mean Square Error = Error/Size of the image Where

PSNR=20 x log10 max2--- (1) MSE

max is 1 or 255. For binary take 1 and for gray level take 255.

MSE- Mean Square Error=Σ Σ [img1-img2]2 --(2) MxN

Where img1 – Original image Img2- encrypted image

(9)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1149 MxN – Size of image

During the experiment, uncompressed image is taken as input image. Here used (2, 2) VCS scheme and consider the color image of size 256 X 256 for experimental results shown in fig. We take here 25 input images and calculate the PSNR values for binary as well as gray level images. Images in Fig.of PSNR shows a result of grayscale in applied to gray color shares. It shows relatively high contrast of the image of PSNR in dB. The methods in may work well in a black and white grayscale VC scheme, however, they do not produce satisfactory results in binary level.. Color contrast is improved compared with that of existing scheme. So we recognize an outline of the share with PSNR dB; however, details are still not clear and overall color particles are rough.

Following table shows the PSNR Values for images.

Image 1 Image 2 Image 3

Image 4 Image 5 Image 6

(10)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1150

Image 13 Image 14 Image 15

Image 16 Image 17 Image 18

Following table shows the PSNR Values and time for images:

Table-2: Time and PSNR values for existing scheme and proposed scheme

S. No. Images Existing scheme Proposed scheme

Time PSNR IN DB Time PSNR IN DB

1 Image 1 143.33 62.82 200.55 -54.79

13.69 98.69

2 Image 2 14.423 98.44 218.14 3.83

-2.20 29.63

3 Image 3 292.12 -58.53 198.75 -29.64

12.79 99.80

4 Image 4 225.95 -14.06 219.28 -12.42

15.38 99.71

5 Image 5 73.22 -32.00 219.63 -32.64

(11)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1151

14.07 97.17

6 Image 6 78.62 -32.21 224.53 26.17

14.70 99.74

7 Image 7 113.73 -45.73 222.11 -37.38

14.16 94.09

8 Image 8 65.56 76.91 222.78 55.78

14.62 99.36

9 Image 9 129.63 31.85 220.90 24.06

9.73 99.80

10 Image 10 86.96 -30.21 217.07 -26.58

13.57 99.80

11 Image 11 71.85 -46.54 218.03 -30.91

12.79 99.73

12 Image 12 138.22 -65.54 218.23 -61.10

15.25 98.11

13 Image 13 80.73 -10.94 217.34 -9.78

14.74 99.86

14 Image 14 55.22 -53.46 218.04 -44.52

13.72 99.74

15 Image 15 62.36 -65.71 220.50 -63.34

13.04 92.56

16 Image 16 124.03 -7.92 215.72 -4.61

15.52 99.47

17 Image 17 75.48 -50.29 -218.10 -45.08

14.70 98.89

18 Image 18 79.45 -10.10 224.38 -5.93

13.65 99.88

19 Image 154 163.59 -71.81 182.06 -62.94

10.79 99.83

20 Image G1BB4 57.70 -34.27 162.21 -31.89

10.96 86.72

21 Image G2B17 52.56 -69.34 179.96 66.37

11.74 98.91

22 Image G2B56 56.31 -55.34 195.51 -63.72

13.39 40.03

23 Image G3B00 111.78 1.24 189.05 18.51

13.24 98.53

24 Picture 1 182.45 -28.42 197.37 -24.16

14.52 99.90

25 Picture 2 69.82 -39.94 197.20 28.35

15.04 99.84

(12)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1152 Fig.6: Graph for PSNR in existing and proposed scheme.

Fig.7: PSNR in encyption and decryption for proposed scheme

Fig.8: For time and PSNR values in existing scheme

(13)

JECET; September 2013 – November 2013; Vol.2.No.4, 1141-1153. 1153 CONCLUSIONS

This paper presents an improved bit plane coding algorithm for gray scale image for applying visual cryptography scheme. A bit plane of an image is a binary image that carries visual information of original images so as to retain the original pixel values the same before and after encryption. The PSNR value for gray scale image is greater than binary images. In visual cryptography if a person gets sufficient k number of shares; the image can be easily decrypted. This paper develops an encryption and decryption method to construct grayscale VC scheme with using bit plane encoding.

Compared with the existing methods, our method achieves better image quality and security.

REFERENCES

1. M. Noar and A. Shamir, "Visual cryptography," Advances in Cryptology - EUROCRYPT'94, 1995.

2. Mizuho Nakajima and Yasushi Yamaguchi, “Extended Visual Cryptography for Natural Images”

3. Young-Chang Hou, "Visual cryptography for color images," Pattern Recognition, 2003, 36, 7, 1619- 1629.

4. Z. Zhou, G.R. Arce and G. Crescenzo, "Halftone visual cryptography," IEEE Transactions on Image Processing, 2006, 15, 8, 2441-2453.

5. Inkookang, G.R. Arce, and H.K. Lee, "Color Extended Visual Cryptography using Error Diffusion,"

2009.

6. S.Chandramati, R. Ramesh Kumar, R.Suresh and S.Harish, “An overview of visual cryptography”

issue 2010.

7. Sandeep Katta,“Visual Secret Sharing Scheme using Grayscale Images”, 2012.

8. Ram Krishna Jha & Abhijit Mustafi, “Boolean XOR Based (K,N) Threshold Visual Cryptography for Grayscale Images,” 2012.

9. Talal Mousa Alkharobi, “New Algorithm For Halftone Image Visual Cryptography,” 2012.

10. T.Rajitha, Prof P.Pradeep Kumar, V.Laxmi in August 2012,”Construction of Extended Visual Cryptography Scheme for Secret Sharing.”

*Corresponding Author: Archana B. Dhole; Department of Computer Science & Engg, Rajiv Gandhi College of Engineering

Research & Technology, Chandrapur, Maharashtra

; .

References

Related documents

The dependence of science on sharing ideas via text also means that individuals with poor reading comprehension are also limited in their ability to gain science

A plethora of research exists for youth rugby league players (i.e. anthropometry, 12 studies; linear speed, change-of-direction speed, power and aerobic capacity, 11 studies;

Key policy drivers (IOM Health Professions Education: A Bridge to Quality (2003); Lancet Commission (Frenk et al., 2010), Framework for Action on Interprofessional Education

increasing popularity also run the risk of incorrect implementation of the program leading to no noticeable gains in student learning.Using the technique of a summative-based

For random requests that access the same object (table or index) but for different queries, they are assigned the highest of all priorities, each of which is determined by Rule 3

It will examine the following options: no protection, overhead shield wire, protector tubes and the application of metal-oxide surge arresters.. The purpose of protection methods is

Keywords Acoustic Doppler · Suspended sediment concentration · Streams and rivers · Aegean · Particle size · Multivariate