Secure Chaotic Map Based Block Cryptosystem with Application to Camera Sensor Networks

Recently, Wang et al. presented an efficient logistic map based block encryption system. The encryption system employs feedback ciphertext to achieve plaintext dependence of sub-keys. Unfortunately, we discovered that their scheme is unable to withstand key stream attack. To improve its security, this paper proposes a novel chaotic map based block cryptosystem. At the same time, a secure architecture for camera sensor network is constructed. The network comprises a set of inexpensive camera sensors to capture the images, a sink node equipped with sufficient computation and storage capabilities and a data processing server. The transmission security between the sink node and the server is gained by utilizing the improved cipher. Both theoretical analysis and simulation results indicate that the improved algorithm can overcome the flaws and maintain all the merits of the original cryptosystem. In addition, computational costs and efficiency of the proposed scheme are encouraging for the practical implementation in the real environment as well as camera sensor network.


Introduction
Camera Sensor Networks (CSNs) are usually built with a large number of inexpensive, small and battery-powered devices. They have been used for a wide variety of applications such as environment monitoring, health monitoring, military sensing and tracking, etc. [1]. As CSNs are widely deployed in remote and hostile environments to transmit sensitive information by broadcast, sensor nodes are prone to node compromise attacks and security issues such as data confidentiality and integrity are extremely important. Hence, security becomes a very serious concern in wireless CSN protocols. Unfortunately, the sensors have limited power, computation, storage and communication capabilities, they impose several constraints on the algorithms and protocols that can be effectively deployed for such systems. In this scenario, most of the traditional security mechanisms are useless. Thus, the research of new efficient security techniques such as block and stream cipher [2,3] is needed.
As a very complicated phenomenon of nonlinear system, chaos has inherent analogous cryptographic properties such as sensitive to parameter and initial state, which inspires people to apply it into cryptography [4,5] are representative works. Since Baptista proposed a novel cryptosystem based on the property of ergodicity of chaotic systems [5], a number of new algorithms based on variations of Baptista's one have been published [6,7]. However, most of those modified methods can't possess both fast encryption speed and flat ciphertext distribution. To solve these problems, Xiang et al. [8] proposed a novel chaotic block cryptosystem based on [5,9,10]. Unfortunately, the sub-keys of this scheme are independent of the plaintext and are determined only by the secret key, which will cause chosen plaintext attack and differential known-plaintext attack [11,12]. Wang et al. [11] put forward an improved version by utilizing ciphertext feedback.
This paper studies the security of Wang et al. scheme and reports the following findings: (1) Without the secret key, any ciphertext can be decrypted by using only two identical length of chosen ciphertext sequences; (2) It is vulnerable to key stream attack (KSA), i.e., the underlying chaotic key stream sequence of any key can be deduced from some chosen plaintext and ciphertext pairs. By utilizing the calculated chaotic key stream sequence, any ciphertext encrypted by key can be decrypted efficiently. To provide an efficient cryptographic primitive and eliminate the weaknesses of Wang et al. scheme, this paper presents a modified chaotic block cryptographic algorithm on CSN. Security analysis shows that the proposed scheme is more secure than the original one. In addition, the high computational efficiency promotes its application in CSN.
The rest of this paper is organized as follows. Section 2 briefly reviews the Wang et al. scheme. Section 3 elaborates the chosen ciphertext attack (CCA) and the key stream attack (KSA). A secure chaotic block cipher in camera sensor network and its performance analysis are given in Section 4 and 5.
Conclusions are drawn in Section 6.

Review of Wang et al. Cryptosystem
In this cryptosystem, the secret key is , where and is the initial condition and control parameter of the following chaotic logistic map, respectively: , Writing the value of x in a binary representation: A binary sequence , where n is the length of the sequence and is the nth iteration of the logistic map, can be obtained by iterating the logistic map. The whole procedure of this scheme can be described in the following steps and an illustration is given in Figure 1. Step 1. Get the start point which denotes the real value of x from the last transient iterations, i.e., . Note that we set in all the following simulations.
Step 2. Divide the plaintext P into subsequences of length l bytes (here l = 8): Step 3. Set ; Step 4. Based on the method to generate binary sequences by iterating the logistic map, obtain a 64-bit binary sequence and a 6-bit binary sequence formed by all the third bits, i.e., i = 3 in Equation (2), through 70 iterations of the logistic map.
is the decimal value of .
Step 5. Compute the jth ciphertext block: where and denote the left cyclic shift and XOR operation, respectively. Step 6. Dividing the ciphertext block into 8-bit partitions and obtain the ciphertext .
Step 7. If all the plaintexts have already been encrypted, the encryption process is finished. Otherwise, calculate: Compute f(C j ) Iterate D j + f(C j ) times and go to Step 4. The decryption process is almost the same as the encryption one. Just need to replace Equation (4) with: (9) where denote the right cyclic shift operation.

Cryptanalysis of Wang et al. Cryptosystem
According to Kerchoff 's principle [13], the cryptanalyst knows exactly the design and working of the cryptosystem under study except the secret key. The general types of cryptanalytic attacks [14] are enumerated as follows, ordered from the hardest type of attack to easiest: ciphertext only attack, known plaintext attack, chosen plaintext attack and chosen ciphertext attack. In each of these four attacks, the objective is to determine the key that was used. It suffices that one of the attacks is feasible to consider an algorithm insecure.
In the following subsections, we will perform a chosen ciphertext attack (CCA) and a key stream attack (KSA) on Wang et al. scheme. For convenient illustration, suppose and are the plaintext and ciphertext pairs, and denote the corresponding secret key and key stream, respectively.

Chosen Ciphertext Attack
A chosen-ciphertext attack [15] operates under the following model: an adversary is allowed access to plaintext-ciphertext pairs for some number of ciphertexts of his choice, and thereafter attempts to use this information to recover the key (or plaintext corresponding to some new ciphertext).
In the Wang et al. scheme, Equations (5-7) indicate that the space of the feedback message is only 64, i.e., once the secret key is determined, the key stream D j+1 and A j+1 are determined only by the former ciphertext . To illustration this security loophole, we set the secret keys , and decrypt two different ciphertext sequences. They are C1="EAFA4D22D3 26D40C2960D4C5E76…" and C2="F11ED8CA5F72155E8A99683495F…" in hexadecimal format. Each block of , , and are filled into Tables 1 and 2, respectively.  Table 2. Decryption of C2 using , .
The simulation results indicate that once , and all the former ciphertext blocks have equal , any ciphertext has identical sub-key and . This loophole is vulnerable to CCA, one of CCA illustration can be played as follows: (they cannot be showed completely).
(1) Let denotes the 6-bit length of in binary representation. For select two cipher blocks: From Equation (5), it is not difficult to see that: To demonstrate this procedure, we fill the chosen corresponding and of a random selected ciphertext C = 218A916626 E5DA55… (in hexadecimal format) into Table 3. (2) Decrypt and using the same key of , then we can get the corresponding plaintext and (6) and (12) we can deduce that , and have the identical corresponding sub-keys and .
(3) Calculate From Equations (10) and (11), we can obtain that: Therefore, we can determine the value of by searching the position of in . (4) Using Equation (4) and the conquered , we can calculate . To demonstrate these procedures, the chosen and of Table 3 are decrypted using , . The corresponding plaintext blocks and sub-keys are filled into Table 4.

Key Stream Attack
In the Wang et al. scheme [11], although a ciphertext feedback model is employed to ensure sub-keys depend on both secret key and plaintext, a fundamental flaw is unaware, i.e., the first sub-key are independent of the plaintext and are determined only by the secret key . An adversary can reconstruct the key stream sequence as an equivalent key as follows: (1). Choose two pair of special messages and , where is composed of 64-bit zeros, is 011…11 in binary representation, and are the corresponding ciphertext of and , respectively.
(2). Set as the first plaintext block, then can get . (3). Similarly, when set as the first plaintext block, , i.e., . Thus the position of zero in counting from rightmost bit is equal to .
. By utilizing , choose to make sure (15) From Equation (7), it can be seen that the sub-keys of , , and are continuous state bit of logistic map.
(6). Decrypt with and : (16) (7). Set , i.e., add as the last 64 bits of . (8). Encrypt the 64(k + 1)-bit length plaintext sequence , and then obtain the corresponding ciphertext: Obviously, is equal to when , and . Therefore, it can be calculated that . (9). Encrypt another 64(k + 1)-bit length plaintext sequence , and then obtain the corresponding ciphertext: Similarly, is equal to when , and , i.e., . Utilizing the computed , the adversary can obtain by counting the position of zero in from rightmost bit.
(10) Go to (5) if the length of the key stream sequence is not enough; otherwise, finish the attack. For , translate decimal value to the corresponding 6-bit length binary sequence , and then the adversary can acquire a 70j-bit length binary key stream sequence of secret key . We denote . The key stream can be utilized to decrypt any ciphertext encrypted by . To demonstrate this circumstance, ciphertext is decrypted as follows: (1). Define . Set the start point of kth sub-key in as .
(2). Obviously, the kth sub-key of is , i.e., , is the decimal value of . And then we can obtain the kth plaintext block: (3). If , continue; otherwise, finish the decryption process. (4). By utilizing the known , and Equations (5) and (6), it is easy to obtain the value of .
Thus, we can utilize Equation (7) to calculate the start point of (k+1)th sub-key in : (20) (5). Compute and go to (2). As a result, is decrypted effectively with key stream sequence .

Secure Block Cipher Algorithm
The Wang et al. cryptosystem is cryptographically weak because information about the feedback value leaks into the ciphertext and the first sub-key is independent of plaintext. Except these flaws, it has some excellent benefits, such as flat ciphertext, fast encryption speed and prominent diffusion and confusion. Therefore it is valuable to propose an improved version to get rid of above flaws. As for the first flaw, it can be remedied via hiding from ciphertext, and the latter can be conquered by pretreating of the first plaintext block. Detail of the improvement is described as follows: Steps 1-4. They are the same as Wang et al. scheme described in Section 2.
Step 5. Compute: ,  (27) leak noting about the key stream and , so the security is enhanced in the improvement. Though it involves some computations, they are not time consuming operations. Therefore, the improved scheme does not lose the original efficiency advantage.

Architecture of Wireless Camera Sensor Networks
In this section, we introduce the developed architecture of the secure wireless camera sensor networks by utilizing the proposed chaotic block cipher. Each camera sensor node in the networks is battery-powered and has limited computation and wireless communication capabilities. The sink is a data collection center equipped with sufficient computation and storage capabilities. Camera sensor nodes periodically send the captured images to the sink node. Then the sink nodes transport this information secretly with the data process server via carrier networks. The proposed block cipher is mounting at the carrier network. Figure 3 shows the system architecture of the camera sensor network.

Information Entropy Analysis
It is known that the entropy H(m) of a message source m can be calculated by Equation (28) [8]: represents the probability of symbol . The entropy is expressed in bits. For a purely random source emitting 2N symbols, the entropy is H(m) = N. For encrypted messages, the entropy should ideally be H(m) = N .
When a cipher emits symbols with entropy less than N, there exists a certain degree of predictability, which threatens its security. Let us consider the ciphertext of a random text file, a Lena's image of size 256 × 256 and a random video file encrypted using the proposed scheme. The number of occurrence of each ciphertext pixel is recorded and the probability of occurrence is computed for the three files. The corresponding entropies are filled into Table 5. The test values obtained are very close to the theoretical value N = 8 for the three kinds of files. This means that information leakage in the encryption process is negligible and the encryption system is secure against the entropy attack.

Correlation of Adjacent Pixels in Encrypted Image
In order to resist statistical attacks, the ciphertext should possess certain random properties. A detail study has been explored and the results are summarized. The results of the Lena.bmp are used for illustration. For an ordinary image, each pixel is usually highly correlated with its adjacent pixels either in horizontal, vertical or diagonal directions. These high-correlation properties can be quantified as their correlation coefficients for comparison. To calculate the correlation coefficients, the following formulas are used: where x and y are the grey-scale value of two adjacent pixels in the image and N is the total number of pixels selected from the image for the calculation. In Table 6 and Figure 4, the correlation coefficients of Lena image and those of its encrypted image with the secret key (μ = 3.998, x 0 = 0.21745) are given. It is clear that there is negligible correlation between these two adjacent pixels in the encrypted image. However, the two adjacent pixels in the original image are highly correlated. The results indicate that the proposed algorithm has successfully removed the correlation of adjacent pixels in the plain-image so that neighbor pixels in the cipher-image virtually have no correlation. That is to say, the new scheme possesses prominent diffusion property. (  Figure 4. Correlation of the adjacent pixels (1-3)are plaintext and (4-6) are ciphertext.

Sensitivity Analysis
From the cryptographical point of view, given two distinct keys, even if their difference is the minimal value under the current finite precision, the encryption and decryption results of a good cryptosystem should still be completely different. In other words, this cryptosystem should have a very high sensitivity to the secret key [14]. For testing the key sensitivity of the proposed block encryption procedure, we use the grayscale image Lena.bmp of size 256 × 256 as the test image to illustrate the result and perform the following steps: (1). Lena.bmp is encrypted by using the secret key (μ = 3.998, x 0 = 0.21745) and the resultant image is referred as Ciphertext A; (2). The same image is encrypted by making the slight modification in the secret key i.e., (μ = 3.998 + 10 −15 , x 0 = 0.21745) and the resultant image is referred as Ciphertext B; (3). Again, the same original image is encrypted by making the slight modification in the secret key i.e., (μ = 3.998, x 0 = 0.21745 + 10 −15 ) and the resultant image is referred as Ciphertext C; (4). The same original image is encrypted by making the slight modification in the secret key i.e., (μ = 3.998, x 0 = 0.21745 − 10 −15 ) and the resultant image is referred as Ciphertext D. (5). Finally, the correlation coefficients between the corresponding pixels of the four ciphertexts A, B, C and D are computed and filled into Table 7.
It is clear from the Table 7 that no correlation exists among four encrypted images even though these have been produced by using slightly different secret keys. These results sufficiently demonstrate the proposed cryptosystem is highly key sensitive.  Another cryptographical property required by a good cryptosystem is that the encryption should be very sensitive to plaintext, i.e., the ciphertexts of two plaintexts with a slight difference should be very different [14]. Figure 5 is the bit-wise XOR of two ciphertexts when encrypting two image plaintexts with only the first bit different based on the proposed cryptosystem. The result of Figure 5 showing that the proposed encryption scheme is very sensitive with respect to small changes in the plaintext. From the above investigation and study, we can conclude that the lack of security will discourage the use of these algorithms for secure applications. It is advisable that new chaotic cryptosystems take into account some important things: (1) the distribution of the ciphertext should be sufficiently flat in order to resist the statistics attack [8]; (2) the sub keys should depend on not only the secret key but also the plaintext to avoid key stream attack [11]; (3) the first block or sub key should be pretreated to resist some existing attacks; (4) the ciphertext should not leak out any information of the sub keys to eliminate corresponding utilizing ciphertext attacks.

Conclusions
This paper has analyzed the security of a block cipher based on logistic map proposed in [11]. It demonstrated that [11] is vulnerable to chosen ciphertext attack and key stream attack. Then it gave an enhancement version on wireless camera sensor network. Performance analysis demonstrates that the proposed scheme possesses the original benefits as well as enhancing its security. The sample procedure and efficiency of the new scheme are encouraging for the practical implementation in wireless camera sensor network.