This paper presents a new image encryption solution using the chaotic Josephus matrix. It extends the conventional Josephus traversing to a matrix form and proposes a treatment to improve the randomness of this matrix by mixing chaotic maps. It also derives the corresponding encryption primitives controlled by the chaotic Josephus matrix. In this way, it builds up an image encryption system with very high sensitivities in both encryption key and input image. Our simulation results demonstrate that an encrypted image of using this method is very random-like, that is, a uniform-like pixel histogram and very low correlations in adjacent pixels. The design idea of this method is also applicable to data encryption of other types, like audio and video.
Encryption is the process of transforming information (referred to as plaintext) using an algorithm (referred to as a cipher) to make the encrypted information (referred to as ciphertext) unreadable to anyone except those authorized users with special knowledge (referred to as a key) [
Digital image is a major data type of two dimensions. Although a digital image can be extracted in order and becomes a one-dimensional data, its distinctive characteristics make conventional ciphers developed for one dimensional data unsuitable [
The chaotic map is considered a wise choice for data encryption because of its ergodicity, mixing property, high sensitivity to the initial conditions, high deterministic properties, high unpredictable random behaviors, and so forth [
In computer science [
In order to achieve higher security level, many recent efforts adopt the hybrid idea to use one encryption system to suppress disadvantages of another system while keeping advantages unchanged. For example, [
The Josephus permutation or Josephus problem is well known in computer science and mathematics. It is named after Flavius Josephus, a Jewish historian lived in the 1st century. It is a theoretical problem related to a certain counting-out game that works by having
It is clear that three parameters are involved in the Josephus problem, namely, the initial total number of persons in a circle
count = 0; done = 0; pos = while ( todo = label(pos); if (todo == 0) % if this person has not been taken out count = count + 1; if (count == if (length( done = 1; end end end pos = pos + 1; if (pos > end end
For example,
The Logistic map is a polynomial mapping of degree two. It was introduced by the biologist Robet May in 1976 [
The Logistic map has been well studied. The plots of the first few iterations of the Logistic map and its bifurcation diagram are shown in Figure
The Logistic map.
In reality, the Logistic sequence is controlled by a set of parameters of
For example, if
From previous sections, it is clear that the Josephus permutation sequence
In order to achieve the above objective, the new Josephus permutation sequence based on a chaotic permutation sequence
It is noticeable that the chaotic Josephus problem has parameters for both the chaotic Logistic map and for the conventional Josephus problem. In other words, a chaotic Josephus permutation sequence
In the conventional Josephus problem (controlled by parameters
The chaotic Josephus problem.
Conventional Josephus problem
Chaotic Josephus problem
Therefore, the new Josephus permutation sequence
For example, if
Compared to the previous conventional Josephus permutation sequence (see (
Based on chaotic Josephus permutation sequence(s), a chaotic Josephus permutation matrix can be generated via various ways. Among these methods, Algorithm
Input: Output: for end
It is noticeable that Algorithm
Rearranging a CJPS to a CJPM.
Therefore, a CJPM is determined by the same set of parameters controlling a CJPS. In order to emphasize the matrix property, the parameter
Figure
Parametric CJPMs (Note:
In 1949, Claude Shannon, the father of “Information Theory,” proposed that confusion and diffusion are two properties of the operation of a secure cipher, where the term confusion refers to making the relationship between the encryption key and the ciphertext a very complex and developed one [
Since the CJPM is parametric and random-like, it can be used for image encryption directly. However, considering the requirements from confusion and diffusion properties, the encryption procedure can be described as Figure
Image encryption method based on CJPM.
It is clear that the CJPM is the core of the cipher and thus key is related to the used CJPM reference matrix
Key functions in CJPM.
The output encryption key is composed of
In order to enhance the resistance to differential attacks, the CJPM generator used in Figure
The internal structure of CJPM generator.
A plaintext is considered as an object of pixels where its upper-left corner pixel is the reference point located at
It is worth noting that the plaintext-dependent CJPM generator guarantees that the proposed cipher has good diffusion property: any slight changes in plaintext lead to big difference in ciphertext. This is because the resulting CJPM matrix
Pixel substitution refers to the process of changing pixel values. From the point of view of statistics, this process is to change the statistics of a plaintext image, so that the statistics of resulting ciphertext image is completely different. Moreover, it is desired that different ciphertext images have similar statistics, which implies that ciphertext images tell little information about keys and plaintext images. As a result, the confusion property is achieved.
The proposed pixel substitution block is shown in Figure
The internal structure of CJPM generator.
Because elements in a CJPM matrix
Pixel substitution results based on CJPMs are shown in Figure
Pixel substitution results for CJPM at various sizes.
Original image
32-by-32
64-by-64
128-by-128
Histogram of (a)
Histogram of (b)
Histogram of (c)
Histogram of (d)
Pixel permutation refers to the process scrambling the positions of pixels in plaintext to disguise information contained in an image. Denote an image before and after pixel permutation as
For example, Figure
Pixel permutation results for CJPM at various sizes.
Original image
32-by-32
64-by-32
64-by-64
64-by-128
128-by-128
256-by-128
256-by-256
It is clear that images after pixel permutation look very different from the plaintext image. It is also worth noting that a CJPM also depends on a set of parameters besides the size and that any change in other parameters will lead to a completely different permutated image.
An excellent encryption method should be both robust and effective. Robustness means that the cipher should be applicable to any plaintext image written in a supported format. Effectiveness implies that the cipher is able to generate eligible ciphertext images, which hide information from possible intruders.
In this section, we focus on discussing the performance of the CJPM based image cipher described in Section
Histogram analysis is one of the most straightforward evaluations for ciphertext quality for it directly analyzes the pixel distribution of a ciphertext image.
Figure
Histogram analysis for image encryption based on CJPM.
It is clear that no matter what histogram a plaintext image has, the histogram of its ciphertext image is flat, which implies that the pixel distribution is almost uniform. Complex patterns and large homogenous regions in plaintext images are completely unintelligible and become random-like in ciphertext images. These results imply that the proposed image encryption method based on CJPM is robust and effective for various image formats and contents.
High correlations of adjacent pixels can be utilized to carry out cryptanalysis. Therefore, a secure encryption algorithm should break the high correlation relationship between adjacent pixels.
In statistics, the autocorrelation
Based on the reference direction, there are three ways of extracting a two-dimensional image to a one-dimensional sequence and they are the horizontal adjacent correlation coefficient, the vertical adjacent correlation coefficient, and the diagonal adjacent correlation coefficient.
“Lena” image in the 2nd column of Figure
Adjacent pixel autocorrelation analysis.
Correlation coefficients (10−3) | Horizontal | Vertical | Diagonal | |
---|---|---|---|---|
Plaintext | Lena | 939.9652 | 970.9000 | 970.9894 |
|
||||
Ciphertext | CJPM | −2.2281 |
|
|
[ |
|
16.1870 | 17.805 | |
[ |
−2.5000 | −1.0000 | −9.3000 | |
[ |
5.7765 | 28.434 | 20.662 | |
[ |
−12.7212 | −60.2579 | 62.4427 | |
[ |
−13.4000 | 1.2000 | 39.8000 | |
[ |
−15.8900 | −65.3800 | −32.3100 | |
[ |
81.5860 | −40.0530 | −4.7150 | |
[ |
125.7000 | 58.1000 | 50.4000 |
In addition, Figure
APAC analysis for image encryption based on CJPM.
In order to test the resistance of the cipher to differential attacks, plaintext sensitivity analysis is required for a secure cipher. In differential attacks, an adversary attempts to extract meaningful relationship between a plaintext image and its ciphertext image by making a slight change, usually only one pixel, in the plaintext image while encrypting the plaintext image with the same encryption key. By comparing the change in ciphertext images, the encryption key might be cracked and furthermore the information contained in ciphertext might be leaked.
Although there are other measures [
Suppose ciphertext images before and after one pixel change in a plaintext image are
Table
NPCR and UACI analyses on “Lena” image.
CPJM size | 16-by-16 | 32-by-32 | 64-by-64 | 128-by-128 | 256-by-256 |
---|---|---|---|---|---|
NPCR % | 99.6170 | 99.6246 | 99.5895 | 99.5850 | 99.6338 |
UACI % | 33.8205 | 33.8379 | 33.4048 | 33.4076 | 33.4040 |
Figure
Plaintext sensitivity analysis (differential attacks) for image encryption based on CJPM.
The encryption key in the proposed image encryption method using CPJM is composed of a set of parameters
Because the chaotic Logistic map is used as the trigger for pseudorandom sequences, the proposed cipher has high key sensitivities as well. The results of key sensitivity analysis are shown in Figure
Key sensitivity analysis.
Encrypted image (1, 1, 128, 128, 1, 1, 4, 0)
Decrypted image (1, 1, 128, 128, 1, 1, 4, 0)
Decrypted image (1, 1, 128, 128, 1, 2, 4, 0)
Decrypted image (1, 1, 128, 128, 1, 1, 3.9999, 0)
In this paper, we discussed the generation of a chaotic Josephus permutation matrix by using the conventional Josephus permutation sequences and the logistic chaotic map. The proposed CJPM is parametric and is uniquely dependent on the set of parameters, which is sufficiently large to provide a secure size of key space. As another heritage from the chaotic Logistic map, the CJPM is highly sensitive to its initial values (parameters). Any slight change in parameters leads to significant differences in resulting CJPM. Simulation results show that
The proposed cipher can be used for various image types, for example, binary images, 8-bit gray images, 16-bit gray images, RBG images, and so forth. The same encryption idea may also be applied to audio, video, or other types of digital formats.
The authors declare that there is no conflict of interests regarding the publication of this paper.
This work was supported by the Scientific Research Fund of Hunan Provincial Education Department under Grant (no. 12B023). It is also supported by the National Natural Science Foundation of China (nos. 61204039 and 61106029) and Scientific Research Foundation for Returned Scholars, Ministry of Human Resources, and Social Security of the People’s Republic of China.