24 CHAPTER 3 CHAOTIC MAPS BASED PSEUDO RANDOM NUMBER GENERATORS 3.1 INTRODUCTION Pseudo Random Number Generators (PRNGs) are widely used in many applications, such as numerical analysis, probabilistic algorithms, secure communications, integrated circuit testing, computer games and cryptography. The quality of randomness is usually the main criterion to distinguish the different PRNGs. Besides the quality of randomness, implementation cost and throughput are also important factors to evaluate the effectiveness of the PRNGs in applications, such as modern communications, image encryption, video encryption and sensor networks, and so on. Chaos has widely been used in cryptography in recent years. Chaotic maps are often used in encrypting images. Chaos is applied to expand the diffusion and confusion in the image. Due to the desirable properties of nonlinear dynamical systems, such as pseudorandom behavior, sensitivity to initial conditions, unpredictability and ergodicity, chaos-based encryption is suggested as a new and efficient way, to deal with the intractable problem of fast and highly secure image encryption. This chapter discusses chaotic based true pseudo random values generation and its comparisons. A one-dimensional logistic map is commonly used in image encryption schemes due to low hardware complexity, low computation cost, simplicity and better pseudo random number generation.
25 Besides, the high implementation cost renders as unsuitable a pseudo random number generator. Though the logistic map is better for image encryption, it has some common problems such as stable windows, blank windows, uneven distribution of sequences and weak key. New types of chaotic maps have been proposed in this research, to alleviate the aforementioned problems in the logistic map. The maps are mixed together well to improve the random values. Thus, the proposed chaotic maps do not have security issues, which are present in the logistic map. Moreover, the resulting chaotic sequences are uniformly distributed, and the key size has been increased considerably. The proposed chaotic maps have been experimented using the statistical test suite provided by National Institute of Standards and Technology (NIST). It is found that the new types of chaotic maps have perfect randomness and successfully pass all tests. 3.2 LOGISTIC MAP The logistic map is a simple nonlinear model, but it has a complicated dynamic behavior. The chaotic sequence produced by the logistic map is extremely sensitive to the change of its initial value. The logistic map is defined as (1 ) where 0 < < 1 and 0 < 4. The sequences produced by the logistic map are controlled by parameter value of and the initial value of. The system has different characteristics with different values of, called the bifurcation parameter. For > 3.564 starts the process of bifurcation. It may be noted that the closer the value of 4, the more chaotic the system response will be. Figure 3.1 shows the different characteristics for the values of. The horizontal axis shows the values of the parameter, and the vertical axis shows the possible long term values of.
26 Figure 3.1 Bifurcation of the logistic map Logistic mapping sequences also have good auto-correlation and cross-correlation properties. The iterative sequences which are produced by the logistic map can replace the traditional pseudo-random sequences produced by the linear feedback shift register (LFSR) used in encryption. In general, the logistic map has some common weaknesses, such as stable windows, blank windows, uneven distribution of sequences, and a weak key as suggested by Xie et al (2009). The blank window is a more serious weakness than the others. Figure 3.2 illustrates the blank window by a logistic map when > 3.828.
27 Figure 3.2 Blank window of the logistic map Hence, new types of chaotic logistic maps are required to alleviate the weaknesses. The maps are mixed together, so as to achieve a larger key space and to attain chaotic behavior. 3.3 PROPOSED CHAOTIC MAP The proposed chaotic maps are defined as follows x n+1 = [µ y n (1 - x n ) k 1 + z n ] mod 1 y n+1 = [µ y n sin(z n ) k 2 + x n+1 )] mod 1 z n+1 = [µ z n + y n+1 k 3 + x n+1 ] mod 1 where 0 < 3.999, k 1 > 33.5, k 2 > 37.9, k 3 > 35.7 are used to increase the chaotic keys. Along with the key k i the distribution of the sequences becomes better. Figure 3.3 shows that the aforementioned weaknesses such as stable windows, blank windows, uneven distribution of sequences and a weak key are completely resolved.
28 Figure 3.3 Distribution of the sequence of each chaotic map Thus, the proposed chaotic map does not have security issues which are present in the logistic map. Moreover, the resulting chaotic sequences are uniformly distributed and the key size has been increased greatly. 3.3.1 Comparison between Logistic Map and Proposed Chaotic Map In general, the lyapunov exponent is calculated to find the instability of the maps, where the instability is indicated by positive values. The basic expression of the discrete lyapunov exponent is defined as = 1 ( ) ) ) where m i is the subset of the trajectory of a digitized map F in length M and ) is the distance between m i and m j. The computation of the logistic map is shown in Figure 3.4.
29 Figure 3.4 Lyapunov exponents of the logistic map Figure 3.5 shows that the complex degrees of the proposed chaotic maps are larger and more random than those of the logistic map. The positive frequency indicates that the sequences are more random and complex. The larger lyapunov value is better for chaotic systems. Figure 3.5 Lyapunov exponents of the new chaotic map
30 The histograms are constructed to display the frequency, in which the states along a trajectory fall into a given region in the state space. The state space is divided [0, 1] into n=256 discrete non intersecting intervals, where the i th interval is, ; for i=1,2...n-256. Then, a long trajectory of length 100000 is calculated, using an initial system state as follows: For the logistic map L(x)=µx(1-x) x 0 =L 1 (x 0 ),. L 100000 (x 0 ) x i =L(x i-1 ) where i=1,2,3,...100000. Figure 3.6 shows the histogram of the logistic map. Figure 3.6 Histogram of the logistic map
31 For the proposed map S(x, y, z)=(µ y (1-x) k + z) mod 1 T(x, y, z)=(µ y+ sin(z) k + x) mod 1 U(x, y, z)=(µ (z + y)+ sin(z) k + x) mod 1 The trajectory of length 100000 using the initial system (x 0, y 0, z 0 ) is generated as follows x 0, x 1 = S(x 0, y 0, z 0 ), x 2 = S(x 1, y 1, z 1 ),.. y 0, y 1 = T(x 0, y 0, z 0 ), y 2 = T(x 2, y 1, z 1 ),.. z 0, z 1 = U(x 1, y 1, z 0 ), z 2 = U(x 2, y 2, z 1 ),.. x i = S(x i-1, y i-1, z i-1 ) y i = T(x i, y i-1, z i-1 ) z i = U(x i, y i, z i-1 ) Figure 3.7 Histogram of the new chaotic map
32 Note that, in the logistic map (Figure 3.6) the intensity values are not uniformly distributed, and they are high only in (0, 1). But, the histogram of the new chaotic map is uniformly distributed as in Figure 3.7. The equal distribution is obtained for each proposed map. Hence, the key space of the new chaotic system is larger than that of the logistic map. It is better and more suitable for image encryptions. 3.2.2 Randomness of the Nonlinear Chaotic Maps Sequence The series of statistical tests suite provided by the National Institute of Standards and Technology (NIST) special publication (2010) is used to check the perfect randomness of the values generated by each nonlinear chaotic map. In particular, their outputs must be unpredictable in the absence of the knowledge of the inputs. These tests may be useful as the first step in determining whether or not a generator is suitable for a particular cryptographic application. A P_value of zero indicates that the sequence appears to be completely non-random, and the larger the P_value is, the closer a sequence is to a perfect random sequence. For each test, a P_value is computed from the binary sequence. If this value is greater than a predefined threshold, the sequence would be considered as random with a confidence of 1- and the sequence passes the test successfully; otherwise, the sequence fails this test. In this experiment, the P_value is set to 0.01, which means that a sequence which passed the test is considered as random with 99% confidence. In the experiment, 12544 sequences, each of 1,000,352 bits, are generated by maps, and they all pass the statistic tests. If there is more than one statistical value in a test, the test is marked with an asterisk, and the average value is computed. In order to evaluate the randomness of the random numbers generated by the maps, the bit sequences get X, Y, Z, and then test them with the NIST statistical test suite. Table 3.1 shows the P_values of each map.
33 Table 3.1 Results of the randomness test P_value Statistical test name X map Y map Z map Logistic map Frequency (monobits) test 0.53 0.26 0.57 0.008 Test for frequency within a block 0.99 0.44 0.65 Fail Runs test 0.26 0.76 0.36 Fail Test for the longest run of ones in a block 0.24 0.02 0.13 Fail Random binary matrix rank test 0.05 0.17 0.12 Fail Discrete Fourier transform (spectral) test Non-overlapping (aperiodic) template matching test Overlapping (periodic) template matching Test 0.05 0.83 0.19 Fail 0.73 0.41 0.57 Fail 0.71 0.52 0.43 Fail Maurer's universal statistical test 0.37 0.45 0.23 Fail Lempel Ziv complexity test 0.18 0.47 0.54 Fail Linear complexity test 0.62 0.81 0.79 Fail Serial test 0.79 0.78 0.92 Fail Approximate entropy test 0.90 0.39 0.37 Fail Cumulative sum (cusum) test 0.50 0.46 0.40 Fail Random excursions test 0.64 0.41 0.72 Fail Random excursions variant test 0.65 0.37 0.53 Fail Here, it is found that the new chaotic maps have perfect randomness and successfully pass all the tests. The logistic map satisfies only one test, and fails in all other tests. Thus, the new maps are suitable for image encryption.