Chaotic systems are non-linear deterministic systems that behave in a dynamical and complex way without time, depending on their initial conditions (may1976simple). Chaos-based cryptography method uses a chaotic set of equations to produce a pseudo-random encryption key. Such a feature can be useful for file exchanging, as it keeps in-between parties unable to obtain the information on transit. As the security and reliability of this procedure depend on obtaining the same key from both ends, concerns about the finite precision of computational arithmetic must emerge.
The study of dynamical systems dates back from 384–322 BC, when Aristotle proposed laws for object motion, persisting all the way to Rayleigh-Bénard’s convection model and the wide famous butterfly effect by E.N. Lorenz (monteiro). Chaotic systems are dynamical systems that have a sensitivity to their initial conditions, are deterministic and non-periodic (lorenz1963deterministic).
One way to encode files is to use a single pseudo-random sequence obtained from a chaotic map and there has been extensive research regarding more efficient methods. For example, Liu2018 proposes a one-dimensional chaotic map encoding scheme that is more attack-tolerant and HUA201580 uses a combination of sine and logistic maps to tackle the same problem and recently there have been many works regarding new cryptography schemes (silvarealizaccao; CHAI2017197; Li2017; 7932843; pop00001; pop00002; pop00003).
Chaos-based cryptography often relies on computer simulation of dynamical systems to generate a key. It is well known that the inherit finite precision of computers don‘t yield exact results (Goldberg:1991:CSK:103162.103163; Monniaux:2008:PVF:1353445.1353446; 852391). It is also known that the IEEE 754 standard doesn’t specify a default rounding mode, leading to different results of the same operation across different software (PEIXOTO201836).
When cryptography is used to ensure data security, it is important that this data remains unchanged when passed from one device to another. Therefore, when simulating the same system across devices, the results must be a match. However, when simulating the Lorenz’s system in two different devices it was noticed that just the first element of the pseudo-orbits was corresponding, which corresponds to its initial condition. To solve this problem and increase the correspondences, it was proposed the application of the step function, in order to replace the elements of the pseudo-orbit by binary numbers.
In this study it was shown that encrypted data exchange can fail to be interpreted if some aspects of computational arithmetic and finite computer precision were not taken into account. As any chaotic system, any variation of the initial conditions and subsequent iterations can lead to completely different results. The authors also demonstrated that it is possible to interpret the information if such characteristics are considered.
2 Preliminary Concepts
This section presents the fundamental theoretical concepts for the accomplishment of this work.
2.1 Chaotic dynamical systems
Chaotic dynamical systems have been studied from the work of lorenz1963deterministic. The accepted definition of chaos found in the literature can be properly explained by banks1992devaney.
Definition 1: (banks1992devaney). Let be a chaotic system. This system is chaotic when it has the three following properties:
1) f is transitive;
2) the periodic orbits of f are dense in X;
3) f is sensitive to the initial conditions.
As for the first condition, for any subset of U end V in X, there is a positive integer number k, where is a is a non-empty set. The second condition refers to a density of periodic orbits of f in X.
v V, such that . The third condition, f is sensitive to initial conditions if there is a positive real number , such that for any point and all neighborhood N of x exists a point and , such that where d is the distance in X.
For the system to be chaotic the system constants mus be: , e . (Jambersi) (Andrucioli, 2008).
2.2 Orbits and pseudo-orbits and Lower Bound Error
Orbits and pseudo-orbits
Definition 1: An orbit is a sequence of values from a map that can be represented by:
Definition 2: A pseudo-orbit is an approximation of an orbit that can be represented by:
where the real numbers is the error .
2.2.1 Lower Bound Error
The LBE (Lower Bound Error) is a tool used to obtain the lower limit of the computational error obtained at each iteration of computational simulation. It was developed by nepomuceno2017analysis and its mathematical representation is given by:
Where the pseudo-orbit is represented by and a and b are its indices indicating extensions.
2.3 XOR Operation
XOR encryption is an encryption encoding that is well known for its simplicity in modern encryption. XOR encoding is a symmetric encryption algorithm. As it is based on Boolean algebra, its principle is the derivative of the XOR function which returns "true"when two arguments have different values. The key is the same length as the message to be encrypted. And if the content of any message can be guessed or known, the key may be revealed. Within the context of encryption, the strength of the XOR cipher depends on the size and nature of the key. XOR encoding with a long random key may achieve better security performance (xor). A property of the XOR cipher is its statistical property that, for a perfectly random key stream, each encrypted bit has a 50 % chance of being 0 or 1.
To exemplify the operation XOR encryption method, we have the following example:
The "SBAI"string (01110011-01100010-01100001-01101001 in 8-bit ASCII) can be encrypted with an arbitrary 01001100-01001100-01001100-01001100 key as follows:
And decrypted as follows:
2.4 Cubic Map
The Cubic Map is a map that has a chaotic behavior from the value r, known as the bifurcation parameter. This map is a discrete and dynamical system characterized by the equation below:
2.5 Shannon Entropy
Shannon entropy is given by the formula
is the probability of numberappearing in any position of the message. The normalized entropy output values from to , where the higher the number, the higher the entropy and it can be given by
The current investigation involved sampling and comparing the results from the cubic map simulations on different devices. The system was selected based on the frequency it appears in the literature about chaos-based cryptography (Rogers1983).
Two devices, described in Table 1 using GNU Octave 4.2.1 were used to compute the Cubic Map. The simulations had its initial condition set to and and were made on IEEE 754(1985--ieee754) compliant environment to prevent different representation standards to interfere with results. The simulations ran until reaching iterations. This method was chosen because it is widely used by works regarding image cryptography.
|1||Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz|
|2||Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz|
The two simulations used the same interval extension to prevent error propagation, as previous studies shown that even using an equivalent expression to describe the same equation, if one changes the sequence of mathematical operations, results could diverge from each other (nepomuceno2016lower).
The encryption process was based on the XOR operation. Figure 2(a) was selected as it is present in great part of the works regarding image cryptography. The image is represented by a 256x256 matrix of pixels named , each position being the intensity of the pixel expressed between a minimum and a maximum. This range is generally represented from 0 (0%) (black) and 255 (100%) (white). Thus, we need to manipulate the simulation results to obtain a key that has the same format as the image.
In order to obtain a key that matches the image pixel value range, the pseudo orbits were manipulated. For the encryption process, the pseudo-orbit obtained from Device 1 was used. Each iteration was divided by 2, added 1, the first 3 decimal places were discarded, and the remainder were normalized as shown in Equation 10, where floor is defined as rounding towards . Such operations made possible to transform the pseudo-orbit from values in [-1,1] range into [0,255] range, as required to perform the cryptography.
It was also necessary to compose a 256x256 matrix consisting of the normalized results , that would be the key for the cryptography process. A matrix named will be filled by terms from top to bottom, left to right, until all positions are defined. One should note the importance of specify the exact order used to fill the matrix, as a different method could yield an unreadable decryption.
Finally, for the encryption phase, the XOR operation was used. The encryption process was made as in Equation 11, using octave’s bitxor() function. One should expect the original image if the first result is operated again with the same , which is thereby called decryption phase.
After obtaining the result, was sent through internet to Device 2. As for the decryption phase, using the same set of initial conditions, Device 2 synthesized the same interval extension, went through the same manipulation and normalization techniques and compose it’s own matrix, thereby called . If one should expect a reversible operation as shown in Equation 12.
Considering the suspicions of error propagation due to floating point representation between different devices, which would lead to , a technique to reduce the largest Lyapunov exponent was applied. In this method, each iteration of the chaotic map was multiplied by before it was fed back into the equation, as this value was found to yield a satisfactory output. Such operation should reduce the minimal error and the largest Lyapunov exponent, also decreasing the lower bound error curve’s slope (llenepomuceno). It shoud be noted that this technique only applies to small values of Lyapunov exponent, making necessary to develop new strategies to handle bigger values.
Also, a set of initial conditions was generated by obtaining 70 partitions of the interval (0,1) linearly. Each one of the partitions were an input to the chaotic map and simulated until reaching
iterations that filled a vector named, using . Care was taken to reduce the simulation length for the same initial condition, to avoid ergodicity and have more accuracy throughout iterations. In order to check this results, an additional interval extension was simulated solely for this purpose. Aside from this multiplication, this method follows the exact same path as the above for both encryption and decryption phase.
For the sake of validating the results, the entropy of the images was first studied qualitatively by means of the calculation of Shannon Entropy and histogram comparison. The former is a standard test used in the literature about chaos simulations to validate outputs and the latter facilitate the visualization of the quantity of pixels within the same value at an image. It was also analyzed how both pseudo-orbits diverges as they were iterated, using the lower bound error. The logarithmic scale indicates error propagation as the difference between orbits grow. To validate the hypothesis that the output was chaotic, the largest Lyapunov exponent was obtained from the coefficient of the line formed by the linear regression of the lower bound error plot(llenepomuceno).
The problem of sharing an encrypted file across different devices was studied. According to previous researches (CHAI2017197; Li2017; 7932843; pop00001; pop00002; pop00003) and to the best of our knowledge, few concerns were raised about the reliability of the chaotic system simulation. In our study, we have analyzed how chaos-based encryption is applied for information exchange, and developed a method to raise the chance of success of the decryption phase. Obtained results of the simulations were compared iteration by iteration. Figure 1 shows the chaotic output for the first calculations on each device.
A qualitative analysis to determine the randomness of both matrix was applied, based on the normalized Shannon entropy method and calculating the probabilistic distribution of the output vector. Table 2 shows that entropy values differs from one another, which also reassure that the two pseudo-orbits are different.
Nevertheless, Table 2 shows great values of entropy, matching the expectations for a chaotic output and what is present in the literature.
After simulating the system, matrix from Device 1 was used as input to Equation 11, and operated with the original Figure 2(a) to generate Figure 2(b). The latter was then operated with matrix from Device 2 and yielded Figure 2(c). The decryption process failed, as can be seen in Figure 2(c), as it was expected the original image to be shown, but instead the output remained unreadable.
Figure 3(a) illustrates the histogram of the original image, Figure 3(b) illustrates the histogram of the encrypted image and the Figure 3(c) illustrates the histogram of the decrypted image by means of the gray-scale frequency analysis. It can be seen that the histogram of Figure 3(b) - encrypted - is quite uniform and is significantly different from the histogram of the original image given by Figure 3(a). The more homogeneous (evenly distributed) the histogram is, the more diffuse the image will be. It is observed that the histogram of the original image is not homogeneous, that is, it has different behavior in relation to the encrypted image, whose graph is used to indicate the quality of the cryptography. It is also noted that in Figure 3(a) there are small apertures between the columns, which are filled as soon as the encryption algorithm is executed.
It can be seen that inherit characteristics of the different processor construction interfered in the process of generating the same key. It was not possible to generate the same temporal series from different devices. The error propagation and limited precision of floating point representation makes such cryptography unreliable for data exchange between different devices, since any minor divergence in the numerical representation could have great impact in system’s synthesis, and consequently, key generation.
As an attempt to enable some interpretation of the decrypted file, each iteration result was multiplied by , and expected to have a reduction of the largest Lyapunov exponent. Such expectation can be confirmed by comparing Figure 5 and Figure 6, which means that the simulation acquired greater levels of trust for the same number of iterations llenepomuceno. As the process gets repeated, now with Lyapunov reduction, a partially readable decryption is possible, as shown in Figure 4.
The problem of sharing an encrypted file across different devices was studied. It has been shown that many existing chaos-based encryption schemes are just special cases of computational arithmetic properties, where non-user accessible conditions of the processor architecture matched. Also, authors observed that even applying techniques to get more reliability over computational simulation, additional treatment was needed in order to perform the decryption process. Although unable to recover the image integrally, the proposed method presents a solution were minor Lyapunov exponents can be reduced to ensure reliability of the simulation. It should be noted that this solution only applies to small values of Lyapunov exponent, and other techniques should be developed to handle bigger values.