Abstract

Nowadays, increasingly, it seems that the use of rule sets of the most popular games, particularly in new images’ encryption algorithms designing branch, leads to the crystallization of a new paradigm in the field of cryptography. Thus, motivated by this, the present paper aims to study a newly designed digital image scrambler (as part of the two fundamental techniques used to encrypt a block of pixels, i.e., the permutation stage) that uses knight’s moving rules (i.e., from the game of chess), in conjunction with a chaos-based pseudorandom bit generator, abbreviated PRBG, in order to transpose original image’s pixels between RGB channels. Theoretical and practical arguments, rounded by good numerical results on scrambler’s performances analysis (i.e., under various investigation methods, including visual inspection, adjacent pixels’ correlation coefficients’ computation, key’s space and sensitivity assessment, etc.) confirm viability of the proposed method (i.e., it ensures the coveted confusion factor) recommending its usage within cryptographic applications.

1. Introduction

It is well known that, clearly, images are considered to contain a huge amount of information (e.g., a family photos might tell not only who are its members but also their rough ages or physical features, etc.) and thus, as an essential and integrated part of the advanced data protection techniques (i.e., image encryption [15] and watermarking [612]), digital image scramblers are designed to transform clear images into unintelligible ones (i.e., whose inherent information is protected from any unauthorized use).

In recent years, besides classical approaches in the designing of bidimensional bijection based digital image scramblers (e.g., chaos-based [1317], cellular automata based [18, 19], interpixel displacement or image-blocks transposition based [2022], spatial transform based [23, 24], and matrix decomposition based [25] scramblers), few new designs based on rule sets of the most popular games (e.g., Sudoku puzzle based [2628], Chinese chess knight’s tour based [29, 30], Rubik’s cube principle based [31, 32], and Poker shuffling rules based [33]) found their rightful place.

This paper aims to contribute to the crystallization of reminded paradigm by presenting a new model of digital image scrambler, based on transposition of pixels between RGB channels using knight’s moving rules (i.e., from the game of chess) in conjunction with a chaos-based PRBG.

The rest of this paper is organized as follows. Section 2 presents, as comprehensively possible, the design of proposed digital image scrambler. Section 3 showcases scrambler’s performance analysis. Finally, Section 4 concludes the work carried out.

2. Algorithm Description/Methodology

This section deals with the presentation, as comprehensively possible, of the designing stages of the proposed digital image scrambler (i.e., use of knight’s moving rules, use of digital chaotic map, and description of the main procedures and algorithms).

2.1. Use of Knight’s Moving Rules in Scrambler’s Design

Knight’s moving rules, unlike those of all other pieces, follow an “elbowed” nonlinear shape (i.e., in form of letter , in other words, a horizontal displacement of two squares, followed by a vertical displacement of one square, or a vertical displacement of two squares, followed by a horizontal displacement of one square, in either direction). Thus, as shown in Figure 1(a), one can define a set of eight possible moves, each of which can be labeled as suggested in Figure 1(b).

Considering any 24-bit color bitmap , of the size , where represents image’s color channel, as a chessboard with fixed orientation and any pixel within this image as knight’s initial position, each moving rule (i.e., pixel’s new destination) can be mathematically expressed, in relative coordinates, as shown in Figure 1(c).

Since a digital image scrambler aims, among others, to minimize adjacent pixels’ correlation we have considered the following slightly different approaches:(i)in order to ensure the fact that moved pixels’ values will be less correlated with those of their new neighboring pixels, any pixel will not be moved once but times, using the same moving rule ;(ii)reduced susceptibility of correlation between moved pixel’s value and of new neighboring pixels’ (i.e., achieved by applying previous approach) will be strengthened by the fact that once pixel’s new coordinates (i.e., and ) have been determined, according to a binary random variable , its value will be simultaneously transposed between color channels.

Obviously a series of further questions arises, for example, “which are ’s limits of variations?” and “what happens if pixel’s new destination’s coordinates exceed image’s limits?” or “in what way the random binary variable influences pixels’ transposition between image’s color channels?”

The answers to these questions (without any restriction, i.e., one can think of other solutions) are as follows:(i)from a theoretical perspective, can accommodate any positive integer value; however, in practical terms (related to PRBG’s use, as it will be discussed further within this section), its value will be restricted to an 8-bit maximum value (i.e., );(ii)indeed, there is an imminent possibility that pixels’ new destination’s coordinates exceed image’s limits (especially when pixels to be moved are situated at image’s extreme limits or when ’s value is close to maximum) and therefore, considering the image as being virtually cyclic, and coordinates are to be kept within interval (i.e., in a relatively plastic but more proper expression, “exiting” through one side of the image, the pixel will “return” within the image on the other side, completing “in a natural way” motion’s specific shape);(iii)when it comes to transpose pixels’ values between image’s color channels, the basic idea is to ensure that all pixels are removed from their initial color plan (e.g., considering any pixel , i.e., belonging to the red plan, its destination color plane will be forced to green or blue; i.e., ). This criterion is satisfied by applying, for example (i.e., notwithstanding the fact that other rules may be proposed), transposing rules presented in Figure 2.

2.2. Use of the Chaotic Map in Scrambler’s Design

Although any PRBG can be used, for example, [3440], due to its good cryptographic properties and suitability for cryptographic application, that is, large key space and good randomness features, as proven in [41], PRNG model (1) was used, within designing and testing stages of this work. On PRNG’s output sequence of real numbers the multilevel discretization method [42] (e.g., with four thresholds, i.e., 2-bit encoding of each interval) was applied, resulted dibits being spread into two different files (i.e., “Bits_A.txt,” containing dibit’s first bit, and, resp., “Bits_B.txt,” containing dibit’s second bit).

Using random sequences of real numbers generated by the orbits of (1), designed based on a binary composition (2) of two identical one-dimensional chaotic discrete dynamical systems of form (2.2), in conjunction with the method of discretization previously referenced, dibit pairs have been generated (i.e., 6.291.456 bits were written in each file), this number being, as seen, directly proportional to the image dimensions. Consider where , are the initial conditions, , are the control parameters, and , are the two orbits obtained by recurrences and , for any . Consider

In our scrambler’s design and during subsequent tests ’s initial seeding points, respectively, control parameters’ values were chosen as follows: and , respectively, and .

Under the previous circumstances, two matrices were computed, hereafter referred to as KMR and RNS (i.e., the one associated with knight’s moving rules and, respectively, the one associated with the number of steps to be applied on each rule). Procedure 1 describes how KMR and RNS are computed.

Require: m, k  % image’s dimensions
Ensure:         % a temporary counter, initially set to 0
      % a matrix of the size , initially set to 0 (i.e., )
         % a matrix of the size , initially set to 0 (i.e., )
for 1 : k
for 1 : m
for   1 : n
     (Bits_A.txt ,    % takes 8 bits from file Bits_A
     (Bits_B.txt ,     % takes 8 bits from file Bits_B
           % update matrix
           % update matrix
                     % update the temporary counter
   end
    end
end

KMR and RNS matrices are used to establish values of , , and , as Figure 3 suggests. It can be noticed that we are dealing with a two-step algorithm. Thus, according to ’s value, during the first step, pixel is moved times using knight’s rule and then transposed to other color planes, while, during the second step, with its new coordinates, the pixel is moved times using knight’s rule and then into the another color plane.

Procedure 2 shows how , , , , and are computed, for each image’s pixel.

Require:     % current pixel’s (i.e., the one to be moved) coordinates
( )
(1 : 3);        % compute Knight’s rule
(5 : 7);        % compute Knight’s rule
;           % compute binary variable, used to establish transposition rule
               % number of steps to be applied using rule
              % number of steps to be applied using rule

2.3. Practical Example

In order to facilitate understanding of those previously described, the example shown in Figure 4 comes into aid of the reader. For this example, a color bitmap of the size , a starting pixel , , as first stage rule, as second stage rule, usage of three times, and usage of five times are considered.

2.4. Other Useful Procedures

Before starting with the description of Algorithms 1 and 2 two more procedures must be properly described, namely, the one which deals with computation of pixels’ new coordinates, both for scrambling and descrambling algorithms.

Thus, with representing the pixels’ values matrix of a 24-bit color bitmap of the size and representing number of steps to be applied with rule , during scrambling process, pixels’ new coordinates can be computed using Procedure 3.

Require:   % are current pixel’s coordinates, regardless of the color channel in which it lies
Require:   % represents the moving rule to be applied, where
Require:   % represents the number of steps (i.e., how many times the rule is applied)
switch  
  case  
    ;
  case  
    ;
  case  
    ;
  case  
    ;
  case  
    ;
  case  
    ;
  case  
    ;
  otherwise
    ;
end
Remark:    % represent pixel’s new coordinates
Ensure:   
switch  
  case  
   
  otherwise
      % ensures
end
switch  
  case  
   
  otherwise
      % ensures
end

On the basis that moving rules are symmetric (e.g., effects of rule are reversed by applying rule ), during descrambling process, pixels’ new coordinates can be computed using the same procedure but after modifying one of the function call’s parameters, as Procedure 4 suggests.

Require:     % represents the moving rule applied on scrambling procedure
Remark:     % represents the symmetric moving rule, which is to be applied on descrambling procedure
Compute_limits_on_scrambling  

2.5. Scrambling and Descrambling Algorithms’ Description

Depending on random binary variable value, pixels’ color values are transposed between RGB channels using Procedure 5 (i.e., during image’s scrambling process) and, respectively, Procedure 6 (i.e., during image’s descrambling process).

Require:       % the random binary value which establish the transposing rule
           % current working color channel
Ensure:         % Temporary variable
switch  
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
end

Require:       % the random binary value which establish the transposing rule
           % current working color channel
Ensure:         % Temporary variable
switch  
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
case  
   
end

Require:   Bits_A.txt and  Bits_B.txt         % files containing bitstreams generated by ’s trajectories
Compute_KMR_and_RNS  (Bits_A, Bits_B, m, k)    % compute KMR and RNS matrices
for   1 : k
for   1 : m
for   1 : m
    Extract_features  
     =  Compute_limits_on_scrambling  
     =  Compute_limits_on_scrambling  
    Transpose_pixel_color_values_on_scrambling  
  end
end
end

Require:   Bits_A.txt and  Bits_B.txt         % files containing bitstreams generated by ’s trajectories
Compute_KMR_and_RNS  (Bits_A, Bits_B, m, k)    % compute KMR and RNS matrices
for   k : −1 : 1
for   m : −1 : 1
for   m : −1 : 1
    Extract_features  
     =  Compute_limits_on_descrambling  
     =  Compute_limits_on_descrambling  
    Transpose_pixel_color_values_on_descrambling  
  end
end
end

3. Analysis and Comparison Results

As a general requirement, for any digital image scrambler, the output image should be greatly different in comparison with its plain version (i.e., from statistical point of view). To quantify this requirement, in addition to visual assessment, few statistical estimators can be used, the most commonly ones being presented in the following subsections and according to an already widely used conventional methodology [43, 44].

3.1. Visual Analysis

The purpose of visual testing is to highlight presence of similarities between plain image and its scrambled version (i.e., if the scrambled image does or does not contain any features of the plain image). For the proposed scrambler, same as for all digital image scramblers, expectations are to rearrange plain image’s pixels in a deterministic way but with a random-like appearance.

Visual testing was performed on the pixels, 24-bit, Lena, Peppers, and Baboon color bitmaps, from the USC-SIPI miscellaneous image dataset [45]. Figure 5 depicts these test plain images, whereas their scrambled versions are showcased in Figure 6. By comparing them, one can say that there is no perceptual similarity (i.e., no visual information can be observed in the processed versions of plain images).

3.2. Adjacent Pixels’ Correlation Coefficients’ Analysis

It is well known the fact that, generally in plain images, any arbitrarily chosen pixels are strongly correlated with their adjacent ones (either they are diagonally, vertically, or horizontally oriented) [5, 17, 31]. With respect to this idea, an efficient digital image scrambling scheme must minimize this correlation as much as possible.

Whilst Figure 7 showcases the correlation distributions of horizontally (a), vertically (b), and diagonally (c) adjacent pixels for the Baboon plain image, Figure 8 showcases the correlation distributions (i.e., for the same pixels’ adjacency cases) for the Baboon scrambled image.

At the same time, all APCCs (computed over 10.000 pairs of adjacent pixels, randomly selected, for each of the testing directions and for each of the color channels) are summarized in Table 1, for each of the test images.

It can be easily noticed that neighboring pixels in the plain images are highly correlated; that is, APCCs’ values are too high, very close to one. On the contrary, in cases of scrambled images, those values are close to zero, meaning that all neighboring pixels considered in tests are weakly correlated, which is the expected result [5, 46, 47].

3.3. Other Qualitative Measurements’ Analysis

Whereas through the visual assessment and APCCs’ analysis good scrambling effects are highlighted, based on MSE (mean squared error), NPCR (number of pixel change rate), and UACI (unified average changing intensity) measures, a better and more objective assessment of the proposed scrambler can be accomplished.

MSE is used to evaluate the amount of differences between plain image and its corresponding scrambled one [48]. MSE can be numerically evaluated using (4), with the expected result being a value as high as possible thus denoting nonidentical images (i.e., the higher the value of the MSE is, the greater the differences between the two images are). Consider where represents plain image’s associated matrix, represents scrambled image’s associated matrix, and represent the image dimensions (i.e., width and height), and is the color channel (i.e., ).

First shown in [49] and [50] and afterwards extensively studied [51] and presented in transposed fashion (more suitable for usage within scrambled images’ assessment) [17], NPCR and UACI measures are designed to estimate the mean number of distinct pixels having the same position in the plain image as in corresponding scrambled one, respectively, to estimate the average intensity differences of distinct pixels having the same position in the plain image as in the corresponding scrambled one.

Defined for each of image’s color channels [4951], NPCR indicator can be numerically evaluated using (5) and considering two random images (i.e., the plain image is completely different in comparison with its scrambled version) its maximum expected value [17] is found to be . Consider where represents the matrix associated with the differences between ’s and ’s color channels, with its structure being computed according to the following relationship:

Defined for each of image’s color channels [4951], UACI indicator can be numerically evaluated using (7) and considering two random images (i.e., the plain image is completely different in comparison with its scrambled version) its maximum expected value [17] is found to be . Consider

Analyzing NPCR, UACI, and MSE indicators’ values, for each of the test images, as they are summarized in Table 2, one can say that the proposed scrambling scheme approaches the performance of an ideal digital image scrambler. However, the attention is drawn to UACI indicator’s values, not very close to the maximum expected value. Reasoning for this is the fact that the proposed digital image scrambler keeps the same set of possible values of pixels in the scrambled image as in the plain image. Obviously, this limits the maximum difference values that could be achieved between plain image’s pixels and scrambled image’s corresponding ones [17]. For example, in case of the Peppers plain image, maximum differences that could be achieved on each color channel are upper bounded by pixels maximum values (i.e., 231 for R channel, 239 for G channel, and 229 for B channel), instead of the theoretical one of 255.

3.4. Key Space and Key Sensitivity Analysis

A good digital image scrambler should have a sufficiently large key space to resist brute-force attacks, mostly if its usage as part of images’ encryption schemes is desired (i.e., as part of the two fundamental techniques used to encrypt a block of pixels, i.e., permutation stage, which aims to ensure the coveted confusion properties).

As previously shown, the proposed digital image scrambler operates based on values of the bitstreams generated by a multithresholded digital chaotic map. Thus, taking into consideration the two seeding points, respectively, the two control parameters of the digital chaotic generator (namely, ), with a precision of up to , and the key space of a possible encryption scheme (which uses proposed digital image scrambler scheme within permutation stage) is significantly improved by the key space of the proposed scrambler, namely, by a factor of 1060 (hereafter referred to as improvement factor and abbreviated as IF).

On its turn, this key space improvement factor can be raised if some artifacts are considered, such as (but not limited to) the following:(i)if knight’s moving rules are to be permuted on user choice (e.g., any of the three more cases, out of 8!, listed in Figure 9 may be used) then IF increases with 104.6055;(ii)if features extraction vector’s elements are to be permuted on user choice (e.g., any of the two more cases, out of 4! (i.e., if bits defining each rule are taken grouped) or out of 8! (i.e., if bits defining each rule are taken random), listed in Figure 10) and may be used then IF increases with another 101.3802 or 104.6055;(iii)if color channels interchanging rules are to be permuted on user choice, considering that there are possible ways to do it, then IF increases with 103.5283.

Thereby, proposed scrambler’s key space can achieve a value of 1069.5140 (for the first case mentioned in (ii)) or of 1072.7393 (for the second case mentioned in (ii)), which is sufficiently large to recommend usage of the proposed scrambler within any image encryption scheme.

In addition, in order to approach the performance of an ideal image encryption algorithm, the proposed digital image scrambler should have high sensitivity to scrambling key (i.e., a slight key change should lead to significant changes in the scrambled images during scrambling procedure, respectively, significant changes in the descrambled images during descrambling procedure).

Figure 11 shows the key sensitivity of the proposed digital image scrambler, when operating over Baboon plain image with two different scrambling keys (differentiated from each other by the LSB of initial seeding points, i.e., by variations of and ). As can be seen, one bit change in the scrambling key leads to two different scrambled images, whose difference is also random-like. When image is descrambled using an incorrect key (e.g., with same variation conditions of and ) the result is also a random-like image, as shown in Figure 12.

The two keys used for key sensitivity analysis of the proposed digital image scrambler are

3.5. Performances’ Comparison with Other Digital Image Scrambling Schemes

Performances’ comparison was done taking into consideration some of the most recent works [17, 19, 27, 52]. Table 3 summarizes NPCR’s, UACI’s, APCCs’, and speeds’ measure mean values, computed over the pixels, 24-bit, and color bitmaps, for all subjected scrambling algorithms.

Whilst the proposed digital image scrambler presents similar or better results, in comparison with other proposed ones, when it comes to general qualitative measures (i.e., NPCR, UACI, and APCCs) it seems to lack speed (i.e., from processing time point of view), a fact which can be upheld to MATLAB’s very slow for-loop execution. But using parallel computations or (and) other programming languages the processing speed can be largely enhanced.

All the above results (i.e., numerical results presented in the entire Section 3) were generated with the proposed scrambling scripts for (de)shuffling written on MATLAB 7.3.0 and run on an Intel Pentium Dual CPU T3200 at 2.00 GHz personal computer.

4. Conclusions

In the present paper, the study of a newly designed digital image scrambler (as part of the two fundamental techniques used to encrypt a block of pixels, i.e., the permutation stage) that uses knight’s moving rules (i.e., from the game of chess), in conjunction with a chaos-based PRBG, in order to transpose original image’s pixels between RGB channels, was presented.

Theoretical and practical arguments, rounded by very good numerical results on scrambler’s performance analysis (i.e., under various investigation methods, including visual inspection, adjacent pixels’ correlation coefficients’ computation, key’s space, sensitivity assessment, etc.), confirm viability of the proposed scrambling method (i.e., it ensures the coveted confusion factor) recommending its usage within cryptographic applications, thus contributing to the crystallization of reminded new paradigm (i.e., in the field of images’ encryption algorithms designing branch, namely, designing of new digital image scramblers based on rule sets of the most popular games).

As future work, actual implementation on FPGA (focused on the optimization of proposed algorithm, for parallel computing) is concerned.

Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.