SlideShare a Scribd company logo
IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03
______________________________________________________________________________________


                    Image Encryption Using Block-Based
                         Transformation Algorithm

                                           Mohammad Ali Bani Younes and Aman Jantan



    Abstract—Encryption is used to securely transmit data in               The variable secret key of the transformation process
 open networks. Each type of data has its own features, therefore          determines the seed, which is used to build the secret
 different techniques should be used to protect confidential               transformation table with a variable number of blocks. If the
 image data from unauthorized access. Most of the available
 encryption algorithms are mainly used for textual data and may            key is changed, another seed will be generated, and then a
 not be suitable for multimedia data such as images. In this               different secret transformation table is obtained.
 paper, we introduce a block-based transformation algorithm                   The variable secret key of the Blowfish algorithm is used
 based on the combination of image transformation and a well               to encrypt the transformed image. This encryption process
 known encryption and decryption algorithm called Blowfish.                decreases the mutual information among the encrypted image
 The original image was divided into blocks, which were                    variables (i.e. high contrast) and thus increasing the entropy
 rearranged into a transformed image using a transformation
 algorithm presented here, and then the transformed image was
                                                                           value. In this paper we propose a block-based transformation
 encrypted using the Blowfish algorithm. The results showed                algorithm in order to increase the security level of the
 that the correlation between image elements was significantly             encrypted images. The rest of this paper is organized as
 decreased by using the proposed technique. The results also               follows. Section II gives a background about the current
 show that increasing the number of blocks by using smaller                image encryption schemes. In Section III, the description of
 block sizes resulted in a lower correlation and higher entropy.           the proposed block-based transformation algorithm is
                                                                           presented. Section IV and V present the experimental results
   Index Terms—Image correlation, Image encryption, Image
 entropy, Permutation.                                                     and discussion, while section VI presents a comparison
                                                                           between the proposed algorithm and those of other systems.
                                                                           Finally, section VII concludes the paper.
                         I. INTRODUCTION
 The rapid growth of computer networks allowed large files,
                                                                                              II. BACKGROUND
 such as digital images, to be easily transmitted over the
 internet [1]. Data encryption is widely used to ensure security              Encryption is the process of transforming the information
 however, most of the available encryption algorithms are                  to insure its security. With the huge growth of computer
 used for text data. Due to large data size and real time                  networks and the latest advances in digital technologies, a
 constrains, algorithms that are good for textual data may not             huge amount of digital data is being exchanged over various
 be suitable for multimedia data [2]-[4].                                  types of networks. It is often true that a large part of this
    In most of the natural images, the values of the                       information is either confidential or private. As a result,
 neighboring pixels are strongly correlated (i.e. the value of             different security techniques have been used to provide the
 any given pixel can be reasonably predicted from the values               required protection [8].
 of its neighbors) [5]-[7]. In order to dissipate the high                    The security of digital images has become more and more
 correlation among pixels and increase the entropy value, we               important due to the rapid evolution of the Internet in the
 propose a transformation algorithm that divides the image                 digital world today. The security of digital images has
 into blocks and then shuffles their positions before it passes            attracted more attention recently, and many different image
 them to the Blowfish encryption algorithm. By using the                   encryption methods have been proposed to enhance the
 correlation and entropy as a measure of security, this process            security of these images [9].
 results in a lower correlation and a higher entropy value when               Image encryption techniques try to convert an image to
 compared to using the Blowfish algorithm alone, and thus                  another one that is hard to understand [9]. On the other hand,
 improving the security level of the encrypted images. There               image decryption retrieves the original image from the
 are two main keys to increase the entropy; the variable secret            encrypted one. There are various image encryption systems
 key of the transformation process and the variable secret key             to encrypt and decrypt data, and there is no single encryption
 of the Blowfish algorithm.                                                algorithm satisfies the different image types.
                                                                              Most of the algorithms specifically designed to encrypt
                                                                           digital images are proposed in the mid-1990s. There are two
    Manuscript received 25 Jul 2007. Mohammad Ali Moh'd Bani Younes
                                                                           major groups of image encryption algorithms: (a) non-chaos
 and Aman Jantan are with the Department of Computer Science, Universiti   selective methods and (b) Chaos-based selective or
 Sains   Malaysia,      and     E-mail:     mali.cod04@student.usm.my,     non-selective methods. Most of these algorithms are
 aman@cs.usm.my.


                                      (Advance online publication: 19 February 2008)
IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03
______________________________________________________________________________________
 designed for a specific image format compressed or                information can be reduced by decreasing the correlation
 uncompressed, and some of them are even format compliant.         among the image elements using certain transformation
 There are methods that offer light encryption (degradation),      techniques.
 while others offer strong form of encryption. Some of the            The secret key of this approach is used to determine the
 algorithms are scalable and have different modes ranging          seed. The seed plays a main role in building the
 from degradation to strong encryption [10].                       transformation table, which is then used to generate the
    Mitra A et al. [11] have proposed a random combinational       transformed image with different random number of block
 image encryption approach with bit, pixel and block               sizes. The transformation process refers to the operation of
 permutations.                                                     dividing and replacing an arrangement of the original image.
    Zhi-Hong Guan et al. [12] have presented a new image              The image can be decomposed into blocks; each one
 encryption scheme, in which shuffling the positions and           contains a specific number of pixels. The blocks are
 changing the grey values of image pixels are combined to          transformed into new locations. For better transformation
 confuse the relationship between the cipher image and the         the block size should be small, because fewer pixels keep
 plain image.                                                      their neighbors. In this case, the correlation will be
    Sinha A. and Singh K. [13] proposed an image encryption        decreased and thus it becomes difficult to predict the value
 by using Fractional Fourier Transform (FRFT) and JigSaw           of any given pixel from the values of its neighbors. At the
 Transform (JST) in image bit planes.                              receiver side, the original image can be obtained by the
    Shujun Li et al. [14] have pointed out that all                inverse transformation of the blocks. A general block
 permutation-only image ciphers were insecure against              diagram of the transformation method is shown in Fig. 1.
 known/chosen-plaintext attacks. In conclusion, they
 suggested that secret permutations have to be combined with
 other encryption techniques to design highly secured images.
    Maniccam S.S. and Bourbakis N G. [10] proposed image                                Original
                                                                                         Image
 and video encryption using SCAN patterns. The image
 encryption is performed by SCAN-based permutation of
 pixels and a substitution rule which together form an iterated
                                                                                     Transformation
 product cipher.                                                                        process              Key
    Ozturk I. and Sogukpinar I. [15] proposed new schemes
 which add compression capability to the mirror-like image
 encryption MIE and Visual Cryptography VC algorithms to
                                                                                      Encryption
 improve these algorithms.                                                             Process
    Sinha A. and Singh K. [16] proposed a technique to
 encrypt an image for secure transmission using the digital
 signature of the image. Digital signatures enable the recipient                       Ciphered
 of a message to authenticate the sender of a message and                               Image
 verify that the message is intact.
    Droogenbroeck M.V. and Benedett R. [2] have proposed           Fig. 1. General block diagram of the transformation
 two methods for the encryption of an image; selective             algorithm
 encryption and multiple selective encryption.
    Maniccam S.S., Nikolaos G. and Bourbakis. [17] have            The transformation algorithm is presented below. It generates
 presented a new methodology, which performs both lossless         a transformation table that will be used to build a newly
 compression and encryption of binary and gray-scale images.       transformed image.
 The compression and encryption schemes are based on
                                                                   ALGORITHM CREATE_TRANSFORMATION_TABLE
 SCAN patterns generated by the SCAN methodology.
                                                                   1: Load Image
    The proposed algorithm divides the image into random
                                                                   2: Input key
 number of blocks with predefined maximum and minimum
                                                                   3: Get ImageWidth and ImageHeight
 number of pixels, resulting in a stronger encryption and a
                                                                   4:
 decreased correlation.
                                                                      4.1: LowerHorizontalNoBlocks = Int(ImageWidth /10)
                                                                      4.2: LowerVerticalNoBlocks = Int(ImageHeight /10)
                                                                   5: Randomize ()
            III. THE PROPOSED TECHNIQUE
                                                                   6:
 A. Description of the Transformation Algorithm                     6.1: HorizontalNoBlocks = RandomNum between
    The transformation technique works as follows: the                     (LowerHorizontalNoBlocks and ImageWidth)
 original image is divided into a random number of blocks          6.2: VerticalNoBlocks = RandomNum between
 that are then shuffled within the image. The generated (or                (LowerVerticalNoBlocks and ImageHeight)
 transformed) image is then fed to the Blowfish encryption         7: NoBlocks = HorizontalNoBlocks * VerticalNoBlocks
 algorithm. The main idea is that an image can be viewed as an     8: Seed = | Hash value (Key) |
 arrangement of blocks. The intelligible information present       9: HashValue1 = |Hash value (first half of the Key)|
 in an image is due to the correlation among the image                HashValue2 = |Hash value (second half of the Key)|
 elements in a given arrangement. This perceivable                 10: Randomize using seed
                                                                      11: If HashValue1 > HashValue2 Then

                                  (Advance online publication: 19 February 2008)
IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03
______________________________________________________________________________________
            SEEDALTERNATE = 1                                   by reducing the correlation among image elements and
          Else                                                  increasing its entropy value.
             SEEDALTERNATE = 2                                     Image measurements (correlation and entropy) will be
       End If                                                   carried out on the original image and the encrypted images
 12: I = 0                                                      with and without transformation algorithm the results are
       Number-of-seed-changes (N) = 1                           then analyzed. The overview model of the proposed
 13: While I < NoBlocks                                         technique is shown in Fig.2.
   R = RandomNum between (zero and NoBlocks -1)
   If R is not selected Then
                                                                                             Original
     Assign location R to the block I                                                         Image
          I +=1
     Else                                                            Transformation
     If SEEDALTERNATE = 1 Then                                          process
        seed = seed + (HashValue1 Mod I) +1
        SEEDALTERNATE = 2
        Else                                                           Encryption                          Encryption
                                                                        Process               Key
        seed = seed + (HashValue2 Mod I) + 1                                                                Process
        SEEDALTERNATE = 1
   Randomize (seed)                                                     Ciphered                            Ciphered
                                                                         Image                               Image
   End If
   Else
        Number-of-seed-changes += 1                                    Statistical                          Statistical
                                                                        analysis                             analysis
   If Number-of-seed-changes > 500,000 then
       For K = 0 to NoBlocks -1
       If K not selected then                                         Measuremen           Comparison      Measuremen
          Assign location K to Block I                                 t results             Process        t results
             I=I+1                                                     Proposed
       End if                                                          Technique
                                                                                           Comparison        Blowfish
          Next K                                                                             results
   End if
 End if                                                           Fig. 2. An overview diagram of the proposed technique
 End While
 END CREATE_TRANSFORMATION_TABLE
                                                                                       IV. EXPERIMENTS
 Input: BMP image file, a string Key                               The method used to evaluate the present technique is
 Output: Transformation table                                   described in Fig. 2. The algorithm was applied on a bit
                                                                mapped (bmp) image that has the size of 300 pixels x 300
 ALGORITHM PERFORM_TRANSFORMATION                               pixels with 256 colors. In order to evaluate the impact of the
 1: For I = 0 to NoBlocks -1                                    number of blocks on the correlation and entropy, three
    1.1: Get the new location of block I from the               different cases were tested. The number of blocks and the
    transformation table                                        block sizes for each case are shown in Table I.
    1.2: Set block I in its new location
    END PERFORM_TRANSFORMATION
                                                                Table I Different Cases to Test the Impact of the Number of
                                                                Blocks on the Correlation and Entropy
   Input: Original Image (BMP image file) and
   Transformation table                                          Case Number          Number of blocks        Block size
   Output: Transformed Image.                                         1                   30×30          10 pixels × 10 pixels
                                                                      2                   60×60           5 pixels × 5 pixels
 B. Description of the combination technique                          3                  100×100          3 pixels × 3 pixels
    The block-based transformation algorithm is based on the
                                                                   Each case produces three output images; (a) a ciphered
 combination of image transformation followed by
                                                                image using the Blowfish algorithm, (b) a transformed image
 encryption (i.e. transformation algorithm followed by the
                                                                using the proposed algorithm, and (c) a ciphered image using
 Blowfish algorithm). The transformation algorithm and the
                                                                the proposed algorithm followed by the Blowfish algorithm.
 Blowfish algorithm use the original image to produce three
                                                                For the rest of this paper, we use image A, image B, image C,
 output images; (a) a ciphered image using Blowfish, (b) a
                                                                and image D to denote the original image, the ciphered image
 transformed image using a transformation process and (c) a
                                                                using the Blowfish algorithm, the transformed image, and the
 transformed image encrypted using Blowfish.
                                                                ciphered image using the proposed algorithm followed by the
    The correlation and entropy of the three images are
                                                                Blowfish algorithm respectively.
 computed and compared with each other. This technique
                                                                   Correlation and entropy are computed for each case
 aims at enhancing the security level of the encrypted images
                                                                according to equation (1) and equation (2).


                                (Advance online publication: 19 February 2008)
IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03
______________________________________________________________________________________
            n∑(xy) − ∑x∑y
 r=
                                                   1.1

          2
                   [
      n∑(x ) − (∑x) n∑( y ) − (∑y)
                   2     2        2
                                        (1)
                                           ][      0.9                 ]
 Where                                                                                                     0.7




                                                                                     Correlation
 r: correlation value
                                                                                                           0.5
 n: the number of pairs of data
 ∑xy: sum of the products of paired data                                                                   0.3
 ∑x: sum of x data
                                                                                                           0.1
 ∑y: sum of y data
 ∑x2: sum of squared x data                                                                                -0.1
 ∑y2: sum of squared y data                                                                                       Horizontal   Vertical              Diagonal       Opposite
                                                                                                                                                                    Diagonal

 Entropy defined as follows [18]-[19].                                                                                             A         B        C     D
                        G −1
 H             e   = − ∑ P ( k ) log            2   ( P ( k ))              ( 2)                                                       (a)
                        k =0
                                                                                                           1.1                                                          5.5
 Where:
 He: entropy.                                                                                                                                                           5
                                                                                                           0.9
 G: gray value of input image (0... 255).
 P(k): is the probability of the occurrence of symbol k.                                                                                                                4.5



                                                                                     Average correlation
                                                                                                           0.7
                                                                                                                                                                        4




                                                                                                                                                                               Entropy
 Case 1: The image is decomposed into 10 pixels × 10 pixels                                                0.5
 blocks. Fig.3. shows the resulted images.                                                                                                                              3.5
                                                                                                           0.3
                                                                                                                                                                        3

                                                                                                           0.1                                                          2.5

                                                                                                           -0.1                                                         2
                                                                                                                     A         B                 C              D


                                                                                                               (b)
                                (a)                              (b)               Fig. 4. Correlation and entropy values of Case 1. (a)
                                                                                   Correlation between directions. (b) Average correlation and
                                                                                   entropy.
                                                                                   Case 2: The image is decomposed into 5 pixels × 5 pixels
                                                                                   blocks. Fig. 5 shows the resulted images.


                  (c)                    (d)
 Fig. 3. Results of encryption by using 10 pixels × 10 pixels
 blocks. (a) Original image. (b) Encrypted image using
 Blowfish. (c) Transformed image. (d) Encrypted image
 using transformed followed by the Blowfish algorithm.
                                                                                                                         (a)                              (b)
 The correlation and entropy results of this case are
 summarized in Table II and Fig. 4

 Table II Results of Correlation and Entropy values of Case 1.

     Measurement                       A              B            C        D
                   Horizontal         0.933         0.035        0.843     0.034                    (c)                   (d)
                   Vertical           0.936         0.107        0.844     0.038   Fig. 5. Results of encryption by using 5 pixels × 5 pixels
 Correlation




                                                                                   blocks. (a) Original image. (b) Encrypted image using
                   Diagonal           0.919         0.032        0.748     0.013   Blowfish. (c) Transformed image. (d) Encrypted image
                   Opposite                                                        using transformed followed by the Blowfish algorithm.
                                      0.916         0.034        0.745     0.009
                   Diagonal
                   Average            0.926         0.052        0.795     0.023   The correlation and entropy results of this case are
                                                                                   summarized in Table III and Fig. 6.
    Entropy value                     2.431         4.799        2.431     5.231



                                                     (Advance online publication: 19 February 2008)
IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03
______________________________________________________________________________________
 Table III Results of Correlation and Entropy values of Case 2.                                                              Fig. 7. Results of encryption by using 3 pixels × 3 pixels
                                                                                                                             blocks. (a) Original image. (b) Encrypted image using
     Measurement                                                   A                 B              C                D       Blowfish. (c) Transformed image. (d) Encrypted image
                                           Horizontal         0.9325            0.0346            0.7469         0.0245      using transformed followed by the Blowfish algorithm.
                                                                                                                             The results of this case are summarized in Table IV and Fig. 8.
                                           Vertical           0.9362            0.1073            0.7497         0.0067
 Correlation




                                                                                                                             Table IV Results of Correlation and Entropy values of Case 3.
                                           Diagonal           0.9186            0.0321            0.5881              0
                                           Opposite                                                                              Measurement                                                  A            B                  C          D
                                                              0.9156            0.0337            0.5877         0.0056
                                           Diagonal
                                                                                                                                                                        Horizontal         0.9325       0.0346             0.6289     0.0129
                                           Average            0.9257            0.0519            0.6681         0.0092
    Entropy value                                                                                                                                                                          0.9362       0.1073             0.6265     0.0034
                                                                  2.431         2.4305            4.799          2.4305                                                 Vertical




                                                                                                                             Correlation
                                                                                                                                                                        Diagonal           0.9186       0.0321             0.4145     0.0014
                                           1.1

                                           0.9                                                                                                                          Opposite           0.9156       0.0337             0.4146     0.0049
                                                                                                                                                                        Diagonal
                                           0.7
                                                                                                                                                                                           0.9257       0.0519             0.5211     0.0056
               Correlation




                                                                                                                                                                        Average
                                           0.5
                                                                                                                                Entropy value                                              2.4305       4.799            2.4305       5.5281
                                           0.3

                                           0.1
                                                                                                                                                                        1.1
                                      -0.1
                                                     Horizontal        Vertical              Diagonal       Opposite                                                    0.9
                                                                                                            Diagonal                                                    0.7
                                                                                                                                           Correlation




                                                                           A         B        C         D                                                               0.5

                                                                               (a)                                                                                      0.3

                                                                                                                                                                        0.1
                                                 1                                                           5
                                            0.9                                                                                                                  -0.1
                     Average correlation




                                                                                                             4.5                                                                  Horizontal    Vertical              Diagonal       Opposite
                                            0.8
                                            0.7                                                                                                                                                                                      Diagonal
                                                                                                             4
                                                                                                                   Entropy




                                            0.6
                                            0.5                                                              3.5                                                                                    A         B        C         D
                                            0.4
                                            0.3
                                                                                                             3                                                                                          (a)
                                            0.2
                                                                                                             2.5
                                            0.1                                                                                                                               1                                                        6
                                             0                                                               2                                                           0.9                                                           5.5
                                                                                                                                                  Average correlation




                                                        A              B                 C          D                                                                    0.8
                                                                                                                                                                                                                                       5
                                                                                                                                                                         0.7
                                                                                                                                                                                                                                       4.5

                                                                                                                                                                                                                                             Entropy
                                                                                                                                                                         0.6
                            (b)                                                                                                                                          0.5                                                           4
 Fig. 6. Correlation and entropy values of Case 2. (a)                                                                                                                   0.4
                                                                                                                                                                                                                                       3.5
 Correlation between directions. (b) Average correlation and                                                                                                             0.3
                                                                                                                                                                                                                                       3
 entropy.                                                                                                                                                                0.2
                                                                                                                                                                          0.1                                                          2.5
 Case 3: The image is decomposed into 3 pixels × 3 pixels                                                                                                                     0                                                        2
 blocks. Fig. 7 shows the resulted images.                                                                                                                                           A         B                  C              D


                                                                                                                                                         (b)
                                                                                                                             Fig. 8. Correlation and entropy values of Case 3. (a)
                                                                                                                             Correlations between directions. (b) Average correlation and
                                                                                                                             entropy.


                                                            (a)                                   (b)




                                                            (c)                                   (d)

                                                                                     (Advance online publication: 19 February 2008)
IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03
______________________________________________________________________________________

                      0.06                                                                          1.1

                      0.05                                                                         0.9
         Percentage

                      0.04                                                                         0.7
                      0.03                                                                         0.5
                      0.02                                                                         0.3
                      0.01                                                                         0.1
                         0                                                                         -0.1
                                 30 × 30            60 × 60            100 ×100                            30 × 30         60 × 60           100 ×100
                                             Number of blocks                                                         Number of blocks
                                                       B          D                                                  A       B       C        D

                                                                                                                           (a)
                                              (a)
                                                                                               6
                      6                                                                        5
                      5
     Percentage




                                                                                               4
                      4
                                                                                               3
                      3
                      2                                                                        2
                      1                                                                        1
                      0                                                                                   30 × 30        60 × 60            100 ×100
                              30 × 30          60 × 60                1 00 ×1 00
                                                                                                                     Number of blocks
                                           Number of blocks
                                                                                                                     A       B          C      D
                                                   B          D

                              (b)                                                                                          (b)
 Fig. 9 Average correlation and entropy for image B and                                     Fig. 10. Correlation and entropy values versus the number of
 image D. (a) Correlation. (b) Entropy                                                      blocks. (a) Correlation. (b) Entropy.


    As shown in Fig. 9 above, the three different cases showed                                 VI. COMPARISON BETWEEN THE PROPOSED
 that the proposed algorithm resulted in lower correlation and                                   ALGORITHM AND OTHER ALGORITHMS
 higher entropy than the Blowfish algorithm alone. The best
 performance occurs for the smallest image block size.                                         In this section, two experiments were carried out using
                                                                                            the image of Fig. 11. In the first experiment, the image was
                                                                                            divided into different blocks that are shuffled according to
                                                                                            the proposed algorithm and then followed by one of four
                             V. RESULTS AND DISCUSSION
                                                                                            commonly used encryption algorithms; Blowfish, Twofish,
    The above cases show that using the proposed algorithm                                  RijnDael, or RC4. These algorithms are commercially
 followed by the Blowfish algorithm resulted in a lower                                     available, so we applied them on the ciphered image that
 correlation and a higher entropy compared to using the                                     resulted from applying the proposed algorithm on the
 Blowfish alone. Dividing the image into a larger number of                                 different block sizes of the original image. The correlation
 blocks made the performance even better. The results                                       and entropy of each one was compared with applying the
 showed that the correlation was reduced even further and the                               corresponding algorithm alone. The results of this
 entropy was increased as the number of blocks is increased.                                experiment are shown in Table VI and Fig. 12.
                                                                                            Fig. 12 shows that using the proposed algorithm along with
 Table V summarizes the results of the different cases, while                               the other algorithms resulted in a better performance
 Fig. 10 shows the effect of block size on the correlation and                              compared to using the other algorithms alone.
 entropy value.                                                                                In the second experiment, commonly used algorithms in
                                                                                            literature were used to compare with the proposed
 Table V Results of Correlation and Entropy values of image                                 algorithm. Since those algorithms are not available for us,
 (a) in Fig. 3.                                                                             we compared the ciphered images generated by applying
                                                                                            these algorithms with the ciphered images generated by
                                Number                                                      applying the proposed algorithm on the original image. The
 Measurement                                   A             B           C           D
                               of blocks                                                    correlation and entropy of the ciphered images were
                               30 × 30                                0.7952       0.0234   recorded for each algorithm. The results of this application
 Average
                               60 × 60      0.9257         0.0519     0.6681       0.0092   are shown in Table VII and plotted in Fig. 13.
 correlation
                               100 ×100                               0.5211       0.0056
                               30 × 30                                             5.2305
 Entropy                       60 × 60      2.4305         4.799      2.4305       5.4737
                               100 ×100                                            5.5281




                                                    (Advance online publication: 19 February 2008)
IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03
______________________________________________________________________________________




       Fig. 11. Image used to compare the proposed algorithm with the commonly used ones in industry and literature

 Table VI Correlation and Entropy when Appling. (a) Commercially available algorithms alone. (b) Commercially available
 algorithms preceded by the proposed algorithm when applied to the image of Fig. 11

                                                          Commercially available algorithms alone
                                                     System                         Correlation                                                                                                                                            Entropy
                                      BLOWFISH(448)                                   0.0189                                                                                                                                               5.2703
                                      TWOFISH (256)                                   0.0054                                                                                                                                               5.5437
                                      RijnDael (AES256)                               0.0051                                                                                                                                               5.5436
                                      RC4(2048)                                       0.0038                                                                                                                                               5.5437
                                                                           (a)

                                                               Commercially available algorithms preceded by the proposed algorithm
                                                        System                                                Number of blocks                                      Correlation                                                           Entropy
                                                                                                                30×30                                                0.0063                                                               5.4402
                                                                                                                60×60                                                0.0049                                                               5.5286
                                         BLOWFISH(448)
                                                                                                                100×100                                              0.0044                                                               5.5407
                                                                                                                300×300                                              0.0028                                                               5.5438
                                                                                                                30×30                                                0.0026                                                               5.5437
                                           TWOFISH (256)                                                        60×60                                                0.0040                                                               5.5439
                                                                                                                100×100                                              0.0041                                                               5.5438
                                                                                                                300×300                                              0.0029                                                               5.5438
                                                                                                                30×30                                                0.0034                                                               5.5440
                                                                                                                60×60                                                0.0024                                                               5.5439
                                      RijnDael (AES256)
                                                                                                                100×100                                              0.0049                                                               5.5438
                                                                                                                300×300                                              0.0016                                                               5.5439
                                                                                                                30×30                                                0.0024                                                               5.5438
                                                                                                                60×60                                                0.0026                                                               5.5437
                                                   RC4(2048)
                                                                                                                100×100                                              0.0034                                                               5.5439
                                                                                                                300×300                                              0.0034                                                               5.5438
                                                                                                                                                            (b)



    0.04                                                                                                                                                          5.6
   0.035                                                                                                                                                          5.5
    0.03
   0.025                                                                                                                                                          5.4
    0.02                                                                                                                                                          5.3
   0.015
                                                                                                                                                                  5.2
    0.01
   0.005                                                                                                                                                          5.1
       0                                                                                                                                                           5
           30×30
                   60×60
                           100×100
                                     300×300
                                               30×30
                                                       60×60
                                                               100×100
                                                                         300×300
                                                                                   30×30
                                                                                            60×60
                                                                                                    100×100
                                                                                                              300×300
                                                                                                                        30×30
                                                                                                                                60×60
                                                                                                                                        100×100
                                                                                                                                                  300×300




                                                                                                                                                                        30×30
                                                                                                                                                                                60×60
                                                                                                                                                                                        100×100
                                                                                                                                                                                                  300×300
                                                                                                                                                                                                            30×30
                                                                                                                                                                                                                    60×60
                                                                                                                                                                                                                            100×100
                                                                                                                                                                                                                                      300×300
                                                                                                                                                                                                                                                30×30
                                                                                                                                                                                                                                                         60×60
                                                                                                                                                                                                                                                                 100×100
                                                                                                                                                                                                                                                                           300×300
                                                                                                                                                                                                                                                                                     30×30
                                                                                                                                                                                                                                                                                             60×60
                                                                                                                                                                                                                                                                                                     100×100
                                                                                                                                                                                                                                                                                                               300×300




             BLOWFISH                           TWOFISH                                    RijnDael                              RC4                                       BLOWFISH                          TWOFISH                                    RijnDael                               RC4

                              Other systems                                            Proposed technique                                                                                          Other systems                                        Proposed technique

                                (a)                                                            (b)
            Fig. 12. Correlation and entropy values of the algorithms shown in Table VI. (a) Correlation. (b) Entropy.




                                                                                   (Advance online publication: 19 February 2008)
IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03
______________________________________________________________________________________
 Table VII Correlation and Entropy values of commonly used Encryption Algorithms in Literature when applied to the image of
 Fig. 11.
                                                                                                       Measurement
         Number                          Image encryption algorithm
                                                                                         Correlation                   Entropy
               1       Proposed technique 30 × 30                                         0.0063                       5.4402
               2       Proposed technique 60 × 60                                         0.0049                       5.5286
               3       Proposed technique 100 × 100                                       0.0044                       5.5407
               4       Block Permutation 8×8                                              0.7977                       1.9216
               5       Pixel Permutation                                                  0.7418                       1.9017
               6       Bit Permutation                                                    0.0479                       1.9769
               7       [Block, bit, pixel] Combination                                    0.0812                       2.0631
               8       3D Jigsaw transform                                                0.6096                       2.3735
               9       Arnold cat map                                                     0.2882                       1.9208
              10       Chen’s chaotic system                                              0.2569                       2.3440
              11       A naive selective encryption (3 bits encrypted)                    0.8078                       2.0635
              12       A naive selective encryption (7 bits encrypted)                    0.1037                       2.0182


       0.9                                                                      6
       0.8
                                                                                5
       0.7
       0.6                                                                      4
       0.5
       0.4                                                                      3
       0.3
                                                                                2
       0.2
       0.1                                                                      1
       0.0
       -0.1                                                                     0
               1   2   3    4    5   6     7   8   9   10 11 12                      1    2   3   4    5   6   7   8    9 10 11 12


                                  (a)                                                              (b)
               Fig. 13. Correlation and entropy values of the algorithms shown in Table VII. (a) Correlation. (b) Entropy.


 Fig. 12 and Fig. 13 show that the proposed algorithm resulted              Journal of Information and Technology. Vol. 2,
 in lower correlation and higher entropy and thus in a better               no. 2, 2003, pp. 191-200. http://www.ansinet.org/
 encrypted image than all other algorithms tested in this paper.      [2]   M. V. Droogenbroech, R. Benedett, "Techniques for a
                                                                            selective encryption of uncompressed and compressed
                                                                            images," In ACIVS’02, Ghent, Belgium. Proceedings
                           VII. CONCLUSION                                  of Advanced Concepts for Intelligent Vision Systems,
                                                                            2002.
    In this paper a simple and strong method has been                 [3]   S. Changgui, B. Bharat, "An efficient MPEG video
 proposed for image security using a combination of block-                  encryption a l g o r i t h m, " P r o c e e d i n g s o f t h e
 based image transformation and encryption techniques. The                  symposium on reliable distributed systems, IEEE
 cases showed that the correlation was decreased when the                   computer society Press, 1998, pp. 381-386.
 proposed algorithm was applied to them before the Blowfish           [4]   S. Fong, P.B. Ray, and S. Singh, "Improving the
 algorithm. Experimental results of the proposed technique                  lightweight video encryption algorithm," proceeding
 showed that an inverse relationship exists between number                  of iasted international conference, single processing,
 of blocks and correlation, and a direct relationship between               pattern recognition and application, 2002, pp. 25-
 number of blocks and entropy. When compared to many                        28.
 commonly used algorithms, the proposed algorithm resulted            [5]   S. P. Nana'vati., P. K. panigrahi. "Wavelets:applications to
 in the best performance; the lowest correlation and the                    image compression- I,". joined of the scientific and
 highest entropy.                                                           engineering computing, vol. 9, no. 3, 2004, pp. 4- 10.
                                                                      [6]   c. Ratael, gonzales, e. Richard, and woods, "Digital
                                                                            image processing," 2nd ed, Prentice hall, 2002.
                                REFERENCES                            [7]   AL. Vitali, A. Borneo, M. Fumagalli and R. Rinaldo,
                                                                            "Video over IP using standard-compatible multiple
 [1]    W. Lee, T. Chen and C. Chieh Lee, "Improvement of an                description coding," Journal of                       Zhejiang
        encryption scheme for binary images," Pakistan


                                         (Advance online publication: 19 February 2008)
IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03
______________________________________________________________________________________
        University- Science A, vol. 7, no. 5 ,2006, pp. 668-            technology in 1986 and 2003 respectively and currently enrolled in the PhD
                                                                        program in computer science in the Universiti Sains Malaysia.
        676.
 [8]    H. El-din. H. Ahmed, H. M. Kalash, and O. S. Farag              Dr. Aman Jantan received BSc in computer science, Master in AI, PhD in
        Allah, "Encryption quality analysis of the RC5 block            Software Engineering from Universiti Sains Malaysia, penang in 1993, 1996
        cipher algorithm for digital images," Menoufia                  and 2002 respectively and currently Lecturer in School of Computer
                                                                        Sciences in Universiti Sains Malaysia, penang.
        University, Department of Computer Science and
        Engineering, Faculty of Electronic Engineering,
        Menouf-32952, Egypt, 2006.
 [9]    Li. Shujun, X. Zheng "Cryptanalysis of a chaotic image
        encryption method," Inst. of Image Process. Xi'an
        Jiaotong Univ., Shaanxi, This paper appears in: Circuits
        and Systems, ISCAS 2002. IEEE International
        Symposium on Publication Date: 2002, Vol. 2,
        2002, page(s):708,711.
 [10]   S.S. Maniccam, N.G. Bourbakis, "Image and video
        encryption using SCAN patterns," Journal of
        Pattern Recognition Society, vol. 37, no. 4, pp.725–
        737, 2004.
 [11]   A. Mitra, , Y V. Subba Rao, and S. R. M. Prasnna, "A
        new image encryption approach using combinational
        permutation techniques," Journal of computer Science,
        vol.       1,   no.    1,     p.127,    2006,   Available:
        http://www.enformatika.org
 [12]   G. Zhi-Hong, H. Fangjun, and G . W e n j i e ,
        " C h a o s - based image encryption algorithm,"
        Department of Electrical and computer Engineering,
        University of Waterloo,           ON N2L 3G1, Canada.
        Published by: Elsevier, 2005, pp. 153-157.
 [13]   A. Sinha, K. Singh, "Image en c r yp t i o n b y
        using fractional Fourier transform and
        J i g s a w t r ansfo r m in image b it p lanes,"
        Source: optical engineering, spie-int society optical
        engineering, vol. 44, no. 5 , 2005, pp.15-18.
 [14]   Li. Shujun, Li. Chengqing, C. Guanrong,            Fellow.,
        IEEE., Dan Zhang., and Nikolaos,G., Bourbakis
        Fellow., IEEE. "A general cryptanalysis of
        permutation-only multimedia encryption algorithms," 2004,
        http://eprint.iacr. Org/2004/374.pdf
 [15]   I.      Ozturk,     I.Sogukpinar,         "Analysis and
        comparison of image encryption algorithm,"
        Journal of transactions on engineering, computing
        and technology December, vol. 3, 2004, p.38.
            http: //www.enformatika.org/
 [16]   A . S i n h a , K . S i n g h , " A technique for image
        encryption using d igital signatur e," So ur ce:
        Op tics Communications, vol.218, no. 4, 2003,
        pp.229-234.http://www.elsevier.com/
 [17]   S.S.          Maniccam.,          G.Nikolaos,         and
        Bourbakis, "Lossless image compression and
        encryption using SCAN," Journal of: Pattern Recognition,
        vol. 34, no. 6: , 2001, pp.1229– 1245.
 [18]   M. Sonka, V. Hlavac. and R. Boyle, "Digital image
        processing," in: image Processing, Analysis, and
        Machine Vision, 1998, 2nd ed. http://www.pws.com
 [19]   D. Feldman, "A brief introduction to: information
        theory, excess entropy and computational mechanics,"
        college of the atlantic 105 eden street, bar harbor, me
        04609, 2002, http://hornacek.coa.edu/




 Mohammad. A. B. Younes received BSc in computer science from Yarmouk
 University in Irbid Jordan, MSc from Sudan University of science and



                                    (Advance online publication: 19 February 2008)

More Related Content

PDF
Lecture 4 Relationship between pixels
PPTX
Predicting Diabetes Using Machine Learning
PDF
Steganography final report
PPTX
Image encryption and decryption
PDF
Image encryption and decryption using aes algorithm
PDF
Steganography and Its Applications in Security
PPTX
Graphical Password Authentication
PPTX
gray level transformation unit 3(image processing))
Lecture 4 Relationship between pixels
Predicting Diabetes Using Machine Learning
Steganography final report
Image encryption and decryption
Image encryption and decryption using aes algorithm
Steganography and Its Applications in Security
Graphical Password Authentication
gray level transformation unit 3(image processing))

What's hot (20)

PPT
Diabetes prediciton model ppt.ppt
PPTX
Image encryption using aes key expansion
PPTX
Unit 2. Image Enhancement in Spatial Domain.pptx
PPTX
Audio steganography project presentation
PPT
Interpixel redundancy
PDF
DIP Using Image Encryption and XOR Operation Affine Transform
PPTX
Cryptography - Block cipher & stream cipher
PPTX
Face Mask Detection PPT.pptx
PPTX
Image Steganography using LSB
PPTX
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
PDF
Machine Learning - Object Detection and Classification
PDF
DIP - Image Restoration
PPTX
face mask detection ppt66 (2).pptx
DOCX
Image encryption using aes key expansion
PPT
block ciphers
PDF
Digital image processing
PPTX
Lossless predictive coding in Digital Image Processing
PPTX
digital image processing
PPTX
Histogram Equalization
Diabetes prediciton model ppt.ppt
Image encryption using aes key expansion
Unit 2. Image Enhancement in Spatial Domain.pptx
Audio steganography project presentation
Interpixel redundancy
DIP Using Image Encryption and XOR Operation Affine Transform
Cryptography - Block cipher & stream cipher
Face Mask Detection PPT.pptx
Image Steganography using LSB
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
Machine Learning - Object Detection and Classification
DIP - Image Restoration
face mask detection ppt66 (2).pptx
Image encryption using aes key expansion
block ciphers
Digital image processing
Lossless predictive coding in Digital Image Processing
digital image processing
Histogram Equalization
Ad

Similar to Image encryption (20)

PDF
Survey on Different Image Encryption Techniques with Tabular Form
PDF
DESIGN AND ANALYSIS OF A NOVEL DIGITAL IMAGE ENCRYPTION SCHEME
PDF
Image Encryption Using Differential Evolution Approach in Frequency Domain
PDF
Secure Image Encryption Using Filter Bank and Addition Modulo 28 with Exclusi...
PDF
Unified Approach With Neural Network for Authentication, Security and Compres...
PDF
Hf2513081311
PDF
Hf2513081311
PDF
Encryption-Decryption RGB Color Image Using Matrix Multiplication
PDF
An improved color image encryption algorithm with pixel permutation and bit s...
PDF
An improved color image encryption algorithm with
PDF
OPTIMIZED HYBRID SECURITY MECHANISM FOR IMAGE AUTHENTICATION AND SECRECY USIN...
PDF
OPTIMIZED HYBRID SECURITY MECHANISM FOR IMAGE AUTHENTICATION AND SECRECY USIN...
PDF
A Joint Encryption/Watermarking Algorithm for Secure Image Transfer
PDF
Image Encryption Based on Pixel Permutation and Text Based Pixel Substitution
PDF
Video Encryption and Decryption with Authentication using Artificial Neural N...
PDF
Video Encryption and Decryption with Authentication using Artificial Neural N...
PDF
A PLAIN- IMAGE DEPENDENT IMAGE ENCRYPTION SCHEME USING HALF-PIXEL-LEVEL INTER...
PDF
Fast and Secure Transmission of Image by using Byte Rotation Algorithm in Net...
PDF
Visually Image Encryption and Compression using a CNN-Based Autoencoder
PDF
Visually Image Encryption and Compression using a CNN-Based Autoencoder
Survey on Different Image Encryption Techniques with Tabular Form
DESIGN AND ANALYSIS OF A NOVEL DIGITAL IMAGE ENCRYPTION SCHEME
Image Encryption Using Differential Evolution Approach in Frequency Domain
Secure Image Encryption Using Filter Bank and Addition Modulo 28 with Exclusi...
Unified Approach With Neural Network for Authentication, Security and Compres...
Hf2513081311
Hf2513081311
Encryption-Decryption RGB Color Image Using Matrix Multiplication
An improved color image encryption algorithm with pixel permutation and bit s...
An improved color image encryption algorithm with
OPTIMIZED HYBRID SECURITY MECHANISM FOR IMAGE AUTHENTICATION AND SECRECY USIN...
OPTIMIZED HYBRID SECURITY MECHANISM FOR IMAGE AUTHENTICATION AND SECRECY USIN...
A Joint Encryption/Watermarking Algorithm for Secure Image Transfer
Image Encryption Based on Pixel Permutation and Text Based Pixel Substitution
Video Encryption and Decryption with Authentication using Artificial Neural N...
Video Encryption and Decryption with Authentication using Artificial Neural N...
A PLAIN- IMAGE DEPENDENT IMAGE ENCRYPTION SCHEME USING HALF-PIXEL-LEVEL INTER...
Fast and Secure Transmission of Image by using Byte Rotation Algorithm in Net...
Visually Image Encryption and Compression using a CNN-Based Autoencoder
Visually Image Encryption and Compression using a CNN-Based Autoencoder
Ad

Image encryption

  • 1. IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03 ______________________________________________________________________________________ Image Encryption Using Block-Based Transformation Algorithm Mohammad Ali Bani Younes and Aman Jantan Abstract—Encryption is used to securely transmit data in The variable secret key of the transformation process open networks. Each type of data has its own features, therefore determines the seed, which is used to build the secret different techniques should be used to protect confidential transformation table with a variable number of blocks. If the image data from unauthorized access. Most of the available encryption algorithms are mainly used for textual data and may key is changed, another seed will be generated, and then a not be suitable for multimedia data such as images. In this different secret transformation table is obtained. paper, we introduce a block-based transformation algorithm The variable secret key of the Blowfish algorithm is used based on the combination of image transformation and a well to encrypt the transformed image. This encryption process known encryption and decryption algorithm called Blowfish. decreases the mutual information among the encrypted image The original image was divided into blocks, which were variables (i.e. high contrast) and thus increasing the entropy rearranged into a transformed image using a transformation algorithm presented here, and then the transformed image was value. In this paper we propose a block-based transformation encrypted using the Blowfish algorithm. The results showed algorithm in order to increase the security level of the that the correlation between image elements was significantly encrypted images. The rest of this paper is organized as decreased by using the proposed technique. The results also follows. Section II gives a background about the current show that increasing the number of blocks by using smaller image encryption schemes. In Section III, the description of block sizes resulted in a lower correlation and higher entropy. the proposed block-based transformation algorithm is presented. Section IV and V present the experimental results Index Terms—Image correlation, Image encryption, Image entropy, Permutation. and discussion, while section VI presents a comparison between the proposed algorithm and those of other systems. Finally, section VII concludes the paper. I. INTRODUCTION The rapid growth of computer networks allowed large files, II. BACKGROUND such as digital images, to be easily transmitted over the internet [1]. Data encryption is widely used to ensure security Encryption is the process of transforming the information however, most of the available encryption algorithms are to insure its security. With the huge growth of computer used for text data. Due to large data size and real time networks and the latest advances in digital technologies, a constrains, algorithms that are good for textual data may not huge amount of digital data is being exchanged over various be suitable for multimedia data [2]-[4]. types of networks. It is often true that a large part of this In most of the natural images, the values of the information is either confidential or private. As a result, neighboring pixels are strongly correlated (i.e. the value of different security techniques have been used to provide the any given pixel can be reasonably predicted from the values required protection [8]. of its neighbors) [5]-[7]. In order to dissipate the high The security of digital images has become more and more correlation among pixels and increase the entropy value, we important due to the rapid evolution of the Internet in the propose a transformation algorithm that divides the image digital world today. The security of digital images has into blocks and then shuffles their positions before it passes attracted more attention recently, and many different image them to the Blowfish encryption algorithm. By using the encryption methods have been proposed to enhance the correlation and entropy as a measure of security, this process security of these images [9]. results in a lower correlation and a higher entropy value when Image encryption techniques try to convert an image to compared to using the Blowfish algorithm alone, and thus another one that is hard to understand [9]. On the other hand, improving the security level of the encrypted images. There image decryption retrieves the original image from the are two main keys to increase the entropy; the variable secret encrypted one. There are various image encryption systems key of the transformation process and the variable secret key to encrypt and decrypt data, and there is no single encryption of the Blowfish algorithm. algorithm satisfies the different image types. Most of the algorithms specifically designed to encrypt digital images are proposed in the mid-1990s. There are two Manuscript received 25 Jul 2007. Mohammad Ali Moh'd Bani Younes major groups of image encryption algorithms: (a) non-chaos and Aman Jantan are with the Department of Computer Science, Universiti selective methods and (b) Chaos-based selective or Sains Malaysia, and E-mail: mali.cod04@student.usm.my, non-selective methods. Most of these algorithms are aman@cs.usm.my. (Advance online publication: 19 February 2008)
  • 2. IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03 ______________________________________________________________________________________ designed for a specific image format compressed or information can be reduced by decreasing the correlation uncompressed, and some of them are even format compliant. among the image elements using certain transformation There are methods that offer light encryption (degradation), techniques. while others offer strong form of encryption. Some of the The secret key of this approach is used to determine the algorithms are scalable and have different modes ranging seed. The seed plays a main role in building the from degradation to strong encryption [10]. transformation table, which is then used to generate the Mitra A et al. [11] have proposed a random combinational transformed image with different random number of block image encryption approach with bit, pixel and block sizes. The transformation process refers to the operation of permutations. dividing and replacing an arrangement of the original image. Zhi-Hong Guan et al. [12] have presented a new image The image can be decomposed into blocks; each one encryption scheme, in which shuffling the positions and contains a specific number of pixels. The blocks are changing the grey values of image pixels are combined to transformed into new locations. For better transformation confuse the relationship between the cipher image and the the block size should be small, because fewer pixels keep plain image. their neighbors. In this case, the correlation will be Sinha A. and Singh K. [13] proposed an image encryption decreased and thus it becomes difficult to predict the value by using Fractional Fourier Transform (FRFT) and JigSaw of any given pixel from the values of its neighbors. At the Transform (JST) in image bit planes. receiver side, the original image can be obtained by the Shujun Li et al. [14] have pointed out that all inverse transformation of the blocks. A general block permutation-only image ciphers were insecure against diagram of the transformation method is shown in Fig. 1. known/chosen-plaintext attacks. In conclusion, they suggested that secret permutations have to be combined with other encryption techniques to design highly secured images. Maniccam S.S. and Bourbakis N G. [10] proposed image Original Image and video encryption using SCAN patterns. The image encryption is performed by SCAN-based permutation of pixels and a substitution rule which together form an iterated Transformation product cipher. process Key Ozturk I. and Sogukpinar I. [15] proposed new schemes which add compression capability to the mirror-like image encryption MIE and Visual Cryptography VC algorithms to Encryption improve these algorithms. Process Sinha A. and Singh K. [16] proposed a technique to encrypt an image for secure transmission using the digital signature of the image. Digital signatures enable the recipient Ciphered of a message to authenticate the sender of a message and Image verify that the message is intact. Droogenbroeck M.V. and Benedett R. [2] have proposed Fig. 1. General block diagram of the transformation two methods for the encryption of an image; selective algorithm encryption and multiple selective encryption. Maniccam S.S., Nikolaos G. and Bourbakis. [17] have The transformation algorithm is presented below. It generates presented a new methodology, which performs both lossless a transformation table that will be used to build a newly compression and encryption of binary and gray-scale images. transformed image. The compression and encryption schemes are based on ALGORITHM CREATE_TRANSFORMATION_TABLE SCAN patterns generated by the SCAN methodology. 1: Load Image The proposed algorithm divides the image into random 2: Input key number of blocks with predefined maximum and minimum 3: Get ImageWidth and ImageHeight number of pixels, resulting in a stronger encryption and a 4: decreased correlation. 4.1: LowerHorizontalNoBlocks = Int(ImageWidth /10) 4.2: LowerVerticalNoBlocks = Int(ImageHeight /10) 5: Randomize () III. THE PROPOSED TECHNIQUE 6: A. Description of the Transformation Algorithm 6.1: HorizontalNoBlocks = RandomNum between The transformation technique works as follows: the (LowerHorizontalNoBlocks and ImageWidth) original image is divided into a random number of blocks 6.2: VerticalNoBlocks = RandomNum between that are then shuffled within the image. The generated (or (LowerVerticalNoBlocks and ImageHeight) transformed) image is then fed to the Blowfish encryption 7: NoBlocks = HorizontalNoBlocks * VerticalNoBlocks algorithm. The main idea is that an image can be viewed as an 8: Seed = | Hash value (Key) | arrangement of blocks. The intelligible information present 9: HashValue1 = |Hash value (first half of the Key)| in an image is due to the correlation among the image HashValue2 = |Hash value (second half of the Key)| elements in a given arrangement. This perceivable 10: Randomize using seed 11: If HashValue1 > HashValue2 Then (Advance online publication: 19 February 2008)
  • 3. IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03 ______________________________________________________________________________________ SEEDALTERNATE = 1 by reducing the correlation among image elements and Else increasing its entropy value. SEEDALTERNATE = 2 Image measurements (correlation and entropy) will be End If carried out on the original image and the encrypted images 12: I = 0 with and without transformation algorithm the results are Number-of-seed-changes (N) = 1 then analyzed. The overview model of the proposed 13: While I < NoBlocks technique is shown in Fig.2. R = RandomNum between (zero and NoBlocks -1) If R is not selected Then Original Assign location R to the block I Image I +=1 Else Transformation If SEEDALTERNATE = 1 Then process seed = seed + (HashValue1 Mod I) +1 SEEDALTERNATE = 2 Else Encryption Encryption Process Key seed = seed + (HashValue2 Mod I) + 1 Process SEEDALTERNATE = 1 Randomize (seed) Ciphered Ciphered Image Image End If Else Number-of-seed-changes += 1 Statistical Statistical analysis analysis If Number-of-seed-changes > 500,000 then For K = 0 to NoBlocks -1 If K not selected then Measuremen Comparison Measuremen Assign location K to Block I t results Process t results I=I+1 Proposed End if Technique Comparison Blowfish Next K results End if End if Fig. 2. An overview diagram of the proposed technique End While END CREATE_TRANSFORMATION_TABLE IV. EXPERIMENTS Input: BMP image file, a string Key The method used to evaluate the present technique is Output: Transformation table described in Fig. 2. The algorithm was applied on a bit mapped (bmp) image that has the size of 300 pixels x 300 ALGORITHM PERFORM_TRANSFORMATION pixels with 256 colors. In order to evaluate the impact of the 1: For I = 0 to NoBlocks -1 number of blocks on the correlation and entropy, three 1.1: Get the new location of block I from the different cases were tested. The number of blocks and the transformation table block sizes for each case are shown in Table I. 1.2: Set block I in its new location END PERFORM_TRANSFORMATION Table I Different Cases to Test the Impact of the Number of Blocks on the Correlation and Entropy Input: Original Image (BMP image file) and Transformation table Case Number Number of blocks Block size Output: Transformed Image. 1 30×30 10 pixels × 10 pixels 2 60×60 5 pixels × 5 pixels B. Description of the combination technique 3 100×100 3 pixels × 3 pixels The block-based transformation algorithm is based on the Each case produces three output images; (a) a ciphered combination of image transformation followed by image using the Blowfish algorithm, (b) a transformed image encryption (i.e. transformation algorithm followed by the using the proposed algorithm, and (c) a ciphered image using Blowfish algorithm). The transformation algorithm and the the proposed algorithm followed by the Blowfish algorithm. Blowfish algorithm use the original image to produce three For the rest of this paper, we use image A, image B, image C, output images; (a) a ciphered image using Blowfish, (b) a and image D to denote the original image, the ciphered image transformed image using a transformation process and (c) a using the Blowfish algorithm, the transformed image, and the transformed image encrypted using Blowfish. ciphered image using the proposed algorithm followed by the The correlation and entropy of the three images are Blowfish algorithm respectively. computed and compared with each other. This technique Correlation and entropy are computed for each case aims at enhancing the security level of the encrypted images according to equation (1) and equation (2). (Advance online publication: 19 February 2008)
  • 4. IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03 ______________________________________________________________________________________ n∑(xy) − ∑x∑y r= 1.1 2 [ n∑(x ) − (∑x) n∑( y ) − (∑y) 2 2 2 (1) ][ 0.9 ] Where 0.7 Correlation r: correlation value 0.5 n: the number of pairs of data ∑xy: sum of the products of paired data 0.3 ∑x: sum of x data 0.1 ∑y: sum of y data ∑x2: sum of squared x data -0.1 ∑y2: sum of squared y data Horizontal Vertical Diagonal Opposite Diagonal Entropy defined as follows [18]-[19]. A B C D G −1 H e = − ∑ P ( k ) log 2 ( P ( k )) ( 2) (a) k =0 1.1 5.5 Where: He: entropy. 5 0.9 G: gray value of input image (0... 255). P(k): is the probability of the occurrence of symbol k. 4.5 Average correlation 0.7 4 Entropy Case 1: The image is decomposed into 10 pixels × 10 pixels 0.5 blocks. Fig.3. shows the resulted images. 3.5 0.3 3 0.1 2.5 -0.1 2 A B C D (b) (a) (b) Fig. 4. Correlation and entropy values of Case 1. (a) Correlation between directions. (b) Average correlation and entropy. Case 2: The image is decomposed into 5 pixels × 5 pixels blocks. Fig. 5 shows the resulted images. (c) (d) Fig. 3. Results of encryption by using 10 pixels × 10 pixels blocks. (a) Original image. (b) Encrypted image using Blowfish. (c) Transformed image. (d) Encrypted image using transformed followed by the Blowfish algorithm. (a) (b) The correlation and entropy results of this case are summarized in Table II and Fig. 4 Table II Results of Correlation and Entropy values of Case 1. Measurement A B C D Horizontal 0.933 0.035 0.843 0.034 (c) (d) Vertical 0.936 0.107 0.844 0.038 Fig. 5. Results of encryption by using 5 pixels × 5 pixels Correlation blocks. (a) Original image. (b) Encrypted image using Diagonal 0.919 0.032 0.748 0.013 Blowfish. (c) Transformed image. (d) Encrypted image Opposite using transformed followed by the Blowfish algorithm. 0.916 0.034 0.745 0.009 Diagonal Average 0.926 0.052 0.795 0.023 The correlation and entropy results of this case are summarized in Table III and Fig. 6. Entropy value 2.431 4.799 2.431 5.231 (Advance online publication: 19 February 2008)
  • 5. IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03 ______________________________________________________________________________________ Table III Results of Correlation and Entropy values of Case 2. Fig. 7. Results of encryption by using 3 pixels × 3 pixels blocks. (a) Original image. (b) Encrypted image using Measurement A B C D Blowfish. (c) Transformed image. (d) Encrypted image Horizontal 0.9325 0.0346 0.7469 0.0245 using transformed followed by the Blowfish algorithm. The results of this case are summarized in Table IV and Fig. 8. Vertical 0.9362 0.1073 0.7497 0.0067 Correlation Table IV Results of Correlation and Entropy values of Case 3. Diagonal 0.9186 0.0321 0.5881 0 Opposite Measurement A B C D 0.9156 0.0337 0.5877 0.0056 Diagonal Horizontal 0.9325 0.0346 0.6289 0.0129 Average 0.9257 0.0519 0.6681 0.0092 Entropy value 0.9362 0.1073 0.6265 0.0034 2.431 2.4305 4.799 2.4305 Vertical Correlation Diagonal 0.9186 0.0321 0.4145 0.0014 1.1 0.9 Opposite 0.9156 0.0337 0.4146 0.0049 Diagonal 0.7 0.9257 0.0519 0.5211 0.0056 Correlation Average 0.5 Entropy value 2.4305 4.799 2.4305 5.5281 0.3 0.1 1.1 -0.1 Horizontal Vertical Diagonal Opposite 0.9 Diagonal 0.7 Correlation A B C D 0.5 (a) 0.3 0.1 1 5 0.9 -0.1 Average correlation 4.5 Horizontal Vertical Diagonal Opposite 0.8 0.7 Diagonal 4 Entropy 0.6 0.5 3.5 A B C D 0.4 0.3 3 (a) 0.2 2.5 0.1 1 6 0 2 0.9 5.5 Average correlation A B C D 0.8 5 0.7 4.5 Entropy 0.6 (b) 0.5 4 Fig. 6. Correlation and entropy values of Case 2. (a) 0.4 3.5 Correlation between directions. (b) Average correlation and 0.3 3 entropy. 0.2 0.1 2.5 Case 3: The image is decomposed into 3 pixels × 3 pixels 0 2 blocks. Fig. 7 shows the resulted images. A B C D (b) Fig. 8. Correlation and entropy values of Case 3. (a) Correlations between directions. (b) Average correlation and entropy. (a) (b) (c) (d) (Advance online publication: 19 February 2008)
  • 6. IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03 ______________________________________________________________________________________ 0.06 1.1 0.05 0.9 Percentage 0.04 0.7 0.03 0.5 0.02 0.3 0.01 0.1 0 -0.1 30 × 30 60 × 60 100 ×100 30 × 30 60 × 60 100 ×100 Number of blocks Number of blocks B D A B C D (a) (a) 6 6 5 5 Percentage 4 4 3 3 2 2 1 1 0 30 × 30 60 × 60 100 ×100 30 × 30 60 × 60 1 00 ×1 00 Number of blocks Number of blocks A B C D B D (b) (b) Fig. 9 Average correlation and entropy for image B and Fig. 10. Correlation and entropy values versus the number of image D. (a) Correlation. (b) Entropy blocks. (a) Correlation. (b) Entropy. As shown in Fig. 9 above, the three different cases showed VI. COMPARISON BETWEEN THE PROPOSED that the proposed algorithm resulted in lower correlation and ALGORITHM AND OTHER ALGORITHMS higher entropy than the Blowfish algorithm alone. The best performance occurs for the smallest image block size. In this section, two experiments were carried out using the image of Fig. 11. In the first experiment, the image was divided into different blocks that are shuffled according to the proposed algorithm and then followed by one of four V. RESULTS AND DISCUSSION commonly used encryption algorithms; Blowfish, Twofish, The above cases show that using the proposed algorithm RijnDael, or RC4. These algorithms are commercially followed by the Blowfish algorithm resulted in a lower available, so we applied them on the ciphered image that correlation and a higher entropy compared to using the resulted from applying the proposed algorithm on the Blowfish alone. Dividing the image into a larger number of different block sizes of the original image. The correlation blocks made the performance even better. The results and entropy of each one was compared with applying the showed that the correlation was reduced even further and the corresponding algorithm alone. The results of this entropy was increased as the number of blocks is increased. experiment are shown in Table VI and Fig. 12. Fig. 12 shows that using the proposed algorithm along with Table V summarizes the results of the different cases, while the other algorithms resulted in a better performance Fig. 10 shows the effect of block size on the correlation and compared to using the other algorithms alone. entropy value. In the second experiment, commonly used algorithms in literature were used to compare with the proposed Table V Results of Correlation and Entropy values of image algorithm. Since those algorithms are not available for us, (a) in Fig. 3. we compared the ciphered images generated by applying these algorithms with the ciphered images generated by Number applying the proposed algorithm on the original image. The Measurement A B C D of blocks correlation and entropy of the ciphered images were 30 × 30 0.7952 0.0234 recorded for each algorithm. The results of this application Average 60 × 60 0.9257 0.0519 0.6681 0.0092 are shown in Table VII and plotted in Fig. 13. correlation 100 ×100 0.5211 0.0056 30 × 30 5.2305 Entropy 60 × 60 2.4305 4.799 2.4305 5.4737 100 ×100 5.5281 (Advance online publication: 19 February 2008)
  • 7. IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03 ______________________________________________________________________________________ Fig. 11. Image used to compare the proposed algorithm with the commonly used ones in industry and literature Table VI Correlation and Entropy when Appling. (a) Commercially available algorithms alone. (b) Commercially available algorithms preceded by the proposed algorithm when applied to the image of Fig. 11 Commercially available algorithms alone System Correlation Entropy BLOWFISH(448) 0.0189 5.2703 TWOFISH (256) 0.0054 5.5437 RijnDael (AES256) 0.0051 5.5436 RC4(2048) 0.0038 5.5437 (a) Commercially available algorithms preceded by the proposed algorithm System Number of blocks Correlation Entropy 30×30 0.0063 5.4402 60×60 0.0049 5.5286 BLOWFISH(448) 100×100 0.0044 5.5407 300×300 0.0028 5.5438 30×30 0.0026 5.5437 TWOFISH (256) 60×60 0.0040 5.5439 100×100 0.0041 5.5438 300×300 0.0029 5.5438 30×30 0.0034 5.5440 60×60 0.0024 5.5439 RijnDael (AES256) 100×100 0.0049 5.5438 300×300 0.0016 5.5439 30×30 0.0024 5.5438 60×60 0.0026 5.5437 RC4(2048) 100×100 0.0034 5.5439 300×300 0.0034 5.5438 (b) 0.04 5.6 0.035 5.5 0.03 0.025 5.4 0.02 5.3 0.015 5.2 0.01 0.005 5.1 0 5 30×30 60×60 100×100 300×300 30×30 60×60 100×100 300×300 30×30 60×60 100×100 300×300 30×30 60×60 100×100 300×300 30×30 60×60 100×100 300×300 30×30 60×60 100×100 300×300 30×30 60×60 100×100 300×300 30×30 60×60 100×100 300×300 BLOWFISH TWOFISH RijnDael RC4 BLOWFISH TWOFISH RijnDael RC4 Other systems Proposed technique Other systems Proposed technique (a) (b) Fig. 12. Correlation and entropy values of the algorithms shown in Table VI. (a) Correlation. (b) Entropy. (Advance online publication: 19 February 2008)
  • 8. IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03 ______________________________________________________________________________________ Table VII Correlation and Entropy values of commonly used Encryption Algorithms in Literature when applied to the image of Fig. 11. Measurement Number Image encryption algorithm Correlation Entropy 1 Proposed technique 30 × 30 0.0063 5.4402 2 Proposed technique 60 × 60 0.0049 5.5286 3 Proposed technique 100 × 100 0.0044 5.5407 4 Block Permutation 8×8 0.7977 1.9216 5 Pixel Permutation 0.7418 1.9017 6 Bit Permutation 0.0479 1.9769 7 [Block, bit, pixel] Combination 0.0812 2.0631 8 3D Jigsaw transform 0.6096 2.3735 9 Arnold cat map 0.2882 1.9208 10 Chen’s chaotic system 0.2569 2.3440 11 A naive selective encryption (3 bits encrypted) 0.8078 2.0635 12 A naive selective encryption (7 bits encrypted) 0.1037 2.0182 0.9 6 0.8 5 0.7 0.6 4 0.5 0.4 3 0.3 2 0.2 0.1 1 0.0 -0.1 0 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 (a) (b) Fig. 13. Correlation and entropy values of the algorithms shown in Table VII. (a) Correlation. (b) Entropy. Fig. 12 and Fig. 13 show that the proposed algorithm resulted Journal of Information and Technology. Vol. 2, in lower correlation and higher entropy and thus in a better no. 2, 2003, pp. 191-200. http://www.ansinet.org/ encrypted image than all other algorithms tested in this paper. [2] M. V. Droogenbroech, R. Benedett, "Techniques for a selective encryption of uncompressed and compressed images," In ACIVS’02, Ghent, Belgium. Proceedings VII. CONCLUSION of Advanced Concepts for Intelligent Vision Systems, 2002. In this paper a simple and strong method has been [3] S. Changgui, B. Bharat, "An efficient MPEG video proposed for image security using a combination of block- encryption a l g o r i t h m, " P r o c e e d i n g s o f t h e based image transformation and encryption techniques. The symposium on reliable distributed systems, IEEE cases showed that the correlation was decreased when the computer society Press, 1998, pp. 381-386. proposed algorithm was applied to them before the Blowfish [4] S. Fong, P.B. Ray, and S. Singh, "Improving the algorithm. Experimental results of the proposed technique lightweight video encryption algorithm," proceeding showed that an inverse relationship exists between number of iasted international conference, single processing, of blocks and correlation, and a direct relationship between pattern recognition and application, 2002, pp. 25- number of blocks and entropy. When compared to many 28. commonly used algorithms, the proposed algorithm resulted [5] S. P. Nana'vati., P. K. panigrahi. "Wavelets:applications to in the best performance; the lowest correlation and the image compression- I,". joined of the scientific and highest entropy. engineering computing, vol. 9, no. 3, 2004, pp. 4- 10. [6] c. Ratael, gonzales, e. Richard, and woods, "Digital image processing," 2nd ed, Prentice hall, 2002. REFERENCES [7] AL. Vitali, A. Borneo, M. Fumagalli and R. Rinaldo, "Video over IP using standard-compatible multiple [1] W. Lee, T. Chen and C. Chieh Lee, "Improvement of an description coding," Journal of Zhejiang encryption scheme for binary images," Pakistan (Advance online publication: 19 February 2008)
  • 9. IAENG International Journal of Computer Science, 35:1, IJCS_35_1_03 ______________________________________________________________________________________ University- Science A, vol. 7, no. 5 ,2006, pp. 668- technology in 1986 and 2003 respectively and currently enrolled in the PhD program in computer science in the Universiti Sains Malaysia. 676. [8] H. El-din. H. Ahmed, H. M. Kalash, and O. S. Farag Dr. Aman Jantan received BSc in computer science, Master in AI, PhD in Allah, "Encryption quality analysis of the RC5 block Software Engineering from Universiti Sains Malaysia, penang in 1993, 1996 cipher algorithm for digital images," Menoufia and 2002 respectively and currently Lecturer in School of Computer Sciences in Universiti Sains Malaysia, penang. University, Department of Computer Science and Engineering, Faculty of Electronic Engineering, Menouf-32952, Egypt, 2006. [9] Li. Shujun, X. Zheng "Cryptanalysis of a chaotic image encryption method," Inst. of Image Process. Xi'an Jiaotong Univ., Shaanxi, This paper appears in: Circuits and Systems, ISCAS 2002. IEEE International Symposium on Publication Date: 2002, Vol. 2, 2002, page(s):708,711. [10] S.S. Maniccam, N.G. Bourbakis, "Image and video encryption using SCAN patterns," Journal of Pattern Recognition Society, vol. 37, no. 4, pp.725– 737, 2004. [11] A. Mitra, , Y V. Subba Rao, and S. R. M. Prasnna, "A new image encryption approach using combinational permutation techniques," Journal of computer Science, vol. 1, no. 1, p.127, 2006, Available: http://www.enformatika.org [12] G. Zhi-Hong, H. Fangjun, and G . W e n j i e , " C h a o s - based image encryption algorithm," Department of Electrical and computer Engineering, University of Waterloo, ON N2L 3G1, Canada. Published by: Elsevier, 2005, pp. 153-157. [13] A. Sinha, K. Singh, "Image en c r yp t i o n b y using fractional Fourier transform and J i g s a w t r ansfo r m in image b it p lanes," Source: optical engineering, spie-int society optical engineering, vol. 44, no. 5 , 2005, pp.15-18. [14] Li. Shujun, Li. Chengqing, C. Guanrong, Fellow., IEEE., Dan Zhang., and Nikolaos,G., Bourbakis Fellow., IEEE. "A general cryptanalysis of permutation-only multimedia encryption algorithms," 2004, http://eprint.iacr. Org/2004/374.pdf [15] I. Ozturk, I.Sogukpinar, "Analysis and comparison of image encryption algorithm," Journal of transactions on engineering, computing and technology December, vol. 3, 2004, p.38. http: //www.enformatika.org/ [16] A . S i n h a , K . S i n g h , " A technique for image encryption using d igital signatur e," So ur ce: Op tics Communications, vol.218, no. 4, 2003, pp.229-234.http://www.elsevier.com/ [17] S.S. Maniccam., G.Nikolaos, and Bourbakis, "Lossless image compression and encryption using SCAN," Journal of: Pattern Recognition, vol. 34, no. 6: , 2001, pp.1229– 1245. [18] M. Sonka, V. Hlavac. and R. Boyle, "Digital image processing," in: image Processing, Analysis, and Machine Vision, 1998, 2nd ed. http://www.pws.com [19] D. Feldman, "A brief introduction to: information theory, excess entropy and computational mechanics," college of the atlantic 105 eden street, bar harbor, me 04609, 2002, http://hornacek.coa.edu/ Mohammad. A. B. Younes received BSc in computer science from Yarmouk University in Irbid Jordan, MSc from Sudan University of science and (Advance online publication: 19 February 2008)