4
POSTER PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 2, May 2009 1 Performance Analysis of Blowfish and its Modified Version using Encryption quality, Key sensitivity, Histogram and Correlation coefficient analysis Krishnamurthy G N and Dr. V Ramaswamy Department of Information Science & Engineering, Bapuji Institute of Engineering & Technology, Davangere, Karnataka, India. Email: [email protected] Email: [email protected] AbstractIn our paper [4] we have suggested improvement to Blowfish by modification to its function. Now in this paper we want show some results of performance analysis Blowfish and compare it with its modified version to prove that the modification does not violate security requirements. For this, we have considered different aspects of security namely, Encryption quality, Key sensitivity test and Statistical Analysis. Index Terms—Encryption, Decryption, Key sensitivity, Histogram, Correlation. I. INTRODUCTION To evaluate the quality of encryption[6], [12] of modified Blowfish cipher with that of original Blowfish[1], [2], [3], [11] the ciphers are applied to several digital images. Before encryption/decryption, we must first extract the image header for the image to be encrypted / decrypted. So, we must study the file format for image to determine all parts of the file header and to determine the beginning of the data stream to be encrypted. Then, the ciphers are applied to the image. We have used the grey scale (0-255) bitmap image Butterfly as the original image (plainimage) of size 512x512. Figures 1A, 1B and 1C show the results of encryption and decryption for this image. The visual inspection of the figure shows the possibility of applying Blowfish cipher to digital images successfully in both encryption/decryption. Also, it reveals its effectiveness in hiding the information contained in them. In all experiments in this chapter, we use the two grey-scale bitmap images Butterfly and Mandrill each of size 512x512 with grey-scale value for each pixel ranging from 0-255 as the original images (plainimages). Let F and Fdenote the original image (plainimage) and the encrypted image (cipherimage) respectively each of size M*N pixels with L grey levels. F(x, y), F(x, y) ε {0,.., L 1} are the grey levels of the images F and Fat position (x, y) (0 x M 1, 0 y N 1). Let H L (F) denote the number of occurrences of each grey level L in the original image (plainimage) F. Similarly, H L (F’) denotes the number of occurrences of each grey level L in the encrypted image (cipherimage) F. The encryption quality represents the average number of changes to each grey level L and is expressed mathematically as The effect of number of rounds r on the encryption quality for Blowfish and modified Blowfish is investigated. The block size and secret key length are both constants. The encryption quality (EQ) is computed as a function of number of rounds (r) and the results obtained for the two images mentioned above are shown in tables 1 and 2. Fig. 1A Original Image (Butterfly.bmp) Fig. 1B Encrypted Image using Blowfish Algorithm Fig. 1C The Image after Decryption using Blowfish Algorithm TABLE II. COMPARISON OF ENCRYPTION QUALITIES FOR THE IMAGE “BUTTERFLY.BMPFOR DIFFERENT ROUNDS. Number of Rounds r Algorithm type Blowfish Modified Blowfish 2 928.679688 1165.000000 4 1100.304688 1091.242188 6 1059.843750 1103.382812 8 1142.984375 1147.445312 10 1151.953125 1133.757812 12 1130.921875 1148.203125 14 1148.937500 1153.531250 16 1154.117188 1154.148438 © 2009 ACADEMY PUBLISHER

Performance Analysis of Blowfish and its Modified Version ... · Cipherimage of Butterfly.bmp Encrypted using Modified Blowfish Algorithm. CONCLUSIONS The results of all the tests

  • Upload
    hadang

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

POSTER PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 2, May 2009

1

Performance Analysis of Blowfish and its Modified Version using Encryption quality, Key sensitivity,

Histogram and Correlation coefficient analysis Krishnamurthy G N and Dr. V Ramaswamy

Department of Information Science & Engineering, Bapuji Institute of Engineering & Technology, Davangere, Karnataka, India.

Email: [email protected] Email: [email protected]

Abstract— In our paper [4] we have suggested improvement to Blowfish by modification to its function. Now in this paper we want show some results of performance analysis Blowfish and compare it with its modified version to prove that the modification does not violate security requirements. For this, we have considered different aspects of security namely, Encryption quality, Key sensitivity test and Statistical Analysis. Index Terms—Encryption, Decryption, Key sensitivity, Histogram, Correlation.

I. INTRODUCTION

To evaluate the quality of encryption[6], [12] of modified Blowfish cipher with that of original Blowfish[1], [2], [3], [11] the ciphers are applied to several digital images. Before encryption/decryption, we must first extract the image header for the image to be encrypted / decrypted. So, we must study the file format for image to determine all parts of the file header and to determine the beginning of the data stream to be encrypted. Then, the ciphers are applied to the image. We have used the grey scale (0-255) bitmap image Butterfly as the original image (plainimage) of size 512x512. Figures 1A, 1B and 1C show the results of encryption and decryption for this image. The visual inspection of the figure shows the possibility of applying Blowfish cipher to digital images successfully in both encryption/decryption. Also, it reveals its effectiveness in hiding the information contained in them. In all experiments in this chapter, we use the two grey-scale bitmap images Butterfly and Mandrill each of size 512x512 with grey-scale value for each pixel ranging from 0-255 as the original images (plainimages). Let F and F′ denote the original image (plainimage) and the encrypted image (cipherimage) respectively each of size M*N pixels with L grey levels. F(x, y), F′(x, y) ε {0,.., L −1} are the grey levels of the images F and F′ at position (x, y) (0 ≤ x ≤ M −1, 0 ≤ y ≤ N −1). Let HL(F) denote the number of occurrences of each grey level L in the original image (plainimage) F. Similarly, HL(F’) denotes the number of occurrences of each grey level L in the encrypted image (cipherimage) F′. The encryption quality represents the average number of changes to each grey level L and is expressed mathematically as

The effect of number of rounds r on the encryption quality for Blowfish and modified Blowfish is investigated. The block size and secret key length are both constants. The encryption quality (EQ) is computed as a function of number of rounds (r) and the results obtained for the two images mentioned above are shown in tables 1 and 2.

Fig. 1A Original Image (Butterfly.bmp) Fig. 1B Encrypted Image using Blowfish Algorithm

Fig. 1C The Image after Decryption using Blowfish Algorithm

TABLE II. COMPARISON OF ENCRYPTION QUALITIES FOR THE IMAGE

“BUTTERFLY.BMP” FOR DIFFERENT ROUNDS.

Number of

Rounds r

Algorithm type

Blowfish Modified Blowfish2 928.679688 1165.000000 4 1100.304688 1091.242188 6 1059.843750 1103.382812 8 1142.984375 1147.445312

10 1151.953125 1133.757812 12 1130.921875 1148.203125 14 1148.937500 1153.531250 16 1154.117188 1154.148438

© 2009 ACADEMY PUBLISHER

POSTER PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 2, May 2009

2

II. KEY SENSITIVITY TEST

Assume that a 16-character ciphering key is used. This means that the key consists of 128 bits. A typical key sensitivity test[6], [12] has been performed according to the following steps:

1. An image (Mandrill.bmp) is encrypted by using the test key ADF278565E262AD1F5DEC94A0BF25B27 (Hex).

2. Then one bit of the key which is selected randomly is changed .We have changed the key to ADF278565E262AD1F5DEC94A0BB25B27. The same image is encrypted with the modified key. The character which is changed as a result of changing an arbitrary bit is shown in bold in test key and the modified key.

3. Finally, the above two ciphered images, encrypted by the two slightly different keys, are compared.

The result is that the encrypted image (figure

2B) using Blowfish by the key K1 = ADF278565E262AD1F5DEC94A0BF25B27 has 99.565292% of pixels differ from the encrypted image (figure 2C) by the key K2 = ADF278565E262AD1F5DEC94A0BB25B27 in terms of pixel grey scale values although there is only one bit difference in the two keys. Figure 2D shows the test result. Moreover, when a 16-character key is used to encrypt an image while another slightly trivially modified key is used to decrypt the ciphered image, the decryption also completely fails. From figure 2E we observe that the image encrypted using the key K1 is not correctly decrypted using the key K2. Similar results can be observed if we try to decrypt an image encrypted using key K2 but decrypted key K1(figure 2F).

The above experiment is repeated for modified

Blowfish. Figure 3D shows that 99.623383% of pixels differ when we compare the image encrypted image (figure 3B, encrypted with key K1) with that of key K2 (figure 3C) in terms of pixel grey scale values. Result of decryption of image encrypted with key K1 by key K2 is shown in figure 3E which shows that even if there is small difference in the keys, not even a fraction of original information will be revealed. Above observation reveals that modified algorithm is at least as strong as original one.

Fig.2A Plainimage Mandrill.bmp Fig. 2B Encrypted with Key K1

Fig. 2C Encrypted with Key K2 Fig. 2D Difference of Images in 2B & 2C

Fig. 2E Encrypted with Key K1 but Decrypted with K2 Fig. 2F Encrypted with Key K2 but Decrypted with K1

Fig. 2 Results of Key Sensitivity Analysis for Original Blowfish Algorithm

Fig.3A Plainimage Mandrill.bmp Fig. 3B Encrypted with Key K1

TABLE I. COMPARISON OF ENCRYPTION QUALITIES FOR THE IMAGE

“MANDRILL.BMP” FOR DIFFERENT ROUNDS.

Number of

Rounds r

Algorithm type Blowfish Modified Blowfish

2 1569.625000 1834.171875

4 1778.742188 1835.609375

6 1723.000000 1747.398438

8 1802.851562 1813.117188

10 1811.867188 1813.031250

12 1794.539062 1820.132812

14 1810.109375 1813.929688

16 1818.929688 1816.437500

© 2009 ACADEMY PUBLISHER

POSTER PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 2, May 2009

3

Fig. 3C Encrypted with Key K2 Fig. 23 Difference of Images in 2B & 2C

Fig. 3E Encrypted with Key K1 but Decrypted with K2 Fig. 3F Encrypted with Key K2 but Decrypted with K1

Fig. 3 Results of Key Sensitivity Analysis for Modified Blowfish Algorithm

II. Statistical Analysis Statistical analysis[6], [12] is conducted using images mentioned above by a test on the histograms of the enciphered images and on the correlations of adjacent pixels in the ciphered image.

A. Histograms of Encrypted Images

We have selected the 256 grey-level bit map image Butterfly and its encrypted image and obtained their histograms. Figure 4 shows histograms[6], [12] for this image and corresponding encrypted image encrypted using original Blowfish algorithm. From the figure, one can see that the histogram of the encrypted image (cipherimage) is fairly uniform and is significantly different from that of the original image (plainimage).

Similarly we have obtained histogram for the encrypted image of Butterfly.bmp encrypted using modified Blowfish algorithm. From the observation it is evident that the histogram of cipherimage is also fairly uniform and different from that of the plainimage and is shown in figure 5.

Fig. 4A Original Image Fig. 4B Histogram for original image (Butterfly.bmp)

Fig. 4C Encrypted Image Fig. 4D Histogram for Encrypted (Butterfly.bmp) image

Fig. 4 Results of Histogram for Plainimage and Cipherimage of Original

Blowfish Algorithm

Fig. 5A Encrypted Image Fig. 5B Histogram for Encrypted (Butterfly.bmp) image

Fig. 5 Results of Histogram for Cipherimage of Modified Blowfish

Algorithm

Also see the percentage of number of pixels with acertain grey scale values in the histogram of plainimage. It is ranging from 0 to 3%, whereas for the two cipherimages this value is almost constant at around 0.4%.

B. Correlation of Two Adjacent Pixels

To determine the correlation between horizontally adjacent pixels[6], [11] in an image, the procedure is as follows:

First, randomly select N pairs of horizontally adjacent pixels from an image. Compute their correlation coefficient using the following formulae

© 2009 ACADEMY PUBLISHER

POSTER PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 2, May 2009

4

where x and y represent grey-scale values of horizontally adjacent pixels in the image. E(x) represents the mean of x values, D(x) represents the variance of x values, cov(x,y) represents covariance of x and y and rxy represents correlation coefficient. To test the correlation between two horizontally adjacent pixels we have randomly selected 1200 pixels and pixels adjacent to them from original (Butterfly.bmp) and their encrypted images. Then we have calculated their correlation coefficient using the above equations.

To figure axis labels, use words rather than symbols.

Fig. 6 Correlation Distribution of Two Horizontally Adjacent Pixels for

Plainimage Butterfly.bmp

Fig. 7 Correlation Distribution of two Horizontally Adjacent Pixels for Cipherimage of Butterfly.bmp Encrypted using Original Blowfish Algorithm.

Figure 6, 7 and 8 show the correlation distribution of two horizontally adjacent pixels in the plainimage(Butterfly.bmp) and cipherimages of original Blowfish and modified Blowfish block ciphers. The correlation coefficient for plainimage is 0.951021. It is 0.034859 for cipherimage encrypted using original Blowfish and is 0.013478 for cipherimage encrypted using modified Blowfish. In cases of both original and modified algorithm the correlation coefficients for plain image with that of cipherimages are far apart. Summary of results for both original and modified Blowfish is shown in table 3.

Do not label axes only with units. Do not label axes

Fig. 8 Correlation Distribution of two Horizontally Adjacent Pixels for Cipherimage of Butterfly.bmp Encrypted using Modified Blowfish

Algorithm.

CONCLUSIONS

The results of all the tests conducted above lead to common conclusion that the security of the modified algorithm is atleast as good as that of original Blowfish algorithm.

REFERENCES

[1] B. Schneier, "Applied Cryptography – Protocols, algorithms, and source code in C", John Wiley & Sons, Inc., New York, second edition, 1996. [2] B. Schneier, “Description of a New Variable-Length Key, 64-Bit Block Cipher (Blowfish)”, Fast Software Encryption, Cambridge Security Workshop proceedings (December 1993), Springer-Verlag, 1994, pp. 191-204. [3] William Stallings, “Cryptography and Network Security”, Third Edition, Pearson Education, 2003. [4] Krishnamurthy G.N, Dr. V Ramaswamy, “Performance Enhancement of Blowfish algorithm by modifying its function”, Proceedings of International Conference in CISSE 2006, University of Bridgeport, Bridgeport, CT, USA, pp 244-249. [5] Harley R. Myler and Arthur R. Weeks, "The Pocket Handbook of Image Processing Algorithms in C", Prentice-Hall, New Jersey, 1993. [6] Hossam El-din H. Ahmed, Hamdy M. Kalash, and Osama S. Farag Allah, “Encryption Quality Analysis of RC5 Block Cipher Algorithm for Digital Images”, Journal of Optical Engineering, vol. 45, 2006. [7] Krishnamurthy G N, Dr. V Ramaswamy “Blow-CAST-Fish, a New 64-bit Block Cipher”, IJCSNS, ISSN: 1738-7906, Vol. 8, No.4, pp 282-290, April -2008, Korea. [8] Kishnamurthy G.N, Dr. V Ramaswamy, “Performance Enhancement of CAST-128 algorithm by modifying its function”, Proceedings of International Conference in CISSE 2007, University of Bridgeport, Bridgeport, CT, USA. [9] Krishnamurthy G N, Dr. V Ramaswamy “Encryption quality analysis and Security Evaluation of Blow-CAST-Fish using digital images”, Communicated to International Journal of Computational Science 2008. [10] Krishnamurthy G N, Dr. V Ramaswamy, “ Encryption Quality Analysis and Security Evaluation of CAST-128 Algorithm using digital images”, communicated to IAENG International Journal of Computer Science, 2008. [11] B.Schneier, “The Blowfish Encryption Algorithm”, In Dr Dobb’s Journal, pp. 38-40, April 1994. [12] Hossam El-din H. Ahmed, Hamdy M. Kalash. And Osama S. Farang Allah, “Encryption Effeciency Analysis and Security Evaluation of RC6 Block Cipher for Digital Images”, International Journal Of Computer, Information , and System Science, and Engineering volume 1 number 1 2007 ISSN 1307-2331. pp 33-38.

© 2009 ACADEMY PUBLISHER