Stationary Randomness of Three Types of Six Random Sequences on Variant Maps

Various random streams have different stationary properties. It is necessary to use statistical probability and time series to evaluate quality of stationary randomness. In this chapter, a testing model is used on three maps for a random sequence. Multiple segments are divided on the shifted sequence as three measuring sets. For a map, the maxima are extracted and three maximal values are identiﬁed. 2D maps represent stationary randomness. Conditions of station random/stationary sequences are investigated. Testing sets are collected from three types of six random resources: AES, DES, A5, RC4, Australian National University (ANU), and University of Science and Technology of China (USTC) (two block ciphers, two stream ciphers, and two quantum ciphers). Six random sequences are selected. Measurements of stationary randomness are compared. There are only 0.0034–4.27% differences that are recognized. Using variation ratios, six samples are composed of three variation categories on {AES, DES}, {A5, RC4}, and {ANU, USTC}, respectively. From a measuring viewpoint, all six samples are showing distinguished stationary randomness properties.


Introduction
In modern cyberspace environment [1], network communication technologies play the essential role to support advanced developments of science, technology, and social daily life in every aspect. From a security viewpoint of network communication, Communication Security (COMSEC) systems [2] are the most important part. Every COMSEC system depends on block cipher/stream cipher/hash technologies, and its core component is linked to a random number generator for any cryptographic applications.
Quantum satellite [3] using Quantum Key Distribution (QKD) systems [4] in cryptographic applications is the most advanced ICT development to establish ultrasecure quantum communications. For a QKD system, a truly random number generator [5], quantum random number generator, plays a key role.
From a reliable viewpoint, it is necessary to test stationary randomness degrees on shift operations in evaluations. In this section, a list of relevant schemes, pseudorandom/truly random sequences, P_value, statistical probability distribution, optical statistics, stationary/nonstationary properties, and variant maps, are discussed.

Pseudorandom Sequences from Linear Stream Ciphers
Traditional stream ciphers [6] on Linear Feedback Shift Register (LFSR) structure (in military cryptography) are used as pseudorandom number generators, due to the ease of implementation from simple hardware, long periods, and uniformly distributed streams. The LFSR stream ciphers are the core in classical stream ciphers through the mathematical theory of algebraic functions for system simulation and analysis.
However, an LFSR is a linear system leading to fairly easy cryptanalysis using the Berlekamp-Massey algorithm. Important LFSR-based stream ciphers A5/1 & A5/2 are used in GSM cell phones and E0 is used in Bluetooth protocol. But from cryptanalysis viewpoint, the A5/2 cipher has been broken and both A5/1 and E0 have serious weaknesses [7,8].

Pseudorandom Sequences from Nonlinear Stream Ciphers
The new generation of stream ciphers [9, 10] is widely used in advanced cyber communications. Three general methods are applied to improve security weaknesses in LFSR-based stream ciphers: 1. Nonlinear Functions: Nonlinear combination of several bits from the LFSR state [11]; 2. Nonlinear Parts: Nonlinear combination of the output bits of two or more LFSRs or using evolutionary algorithm for nonlinearity [12]; and 3. Clock Control: Irregular clocking of the LFSR, as in the alternating step generator [13].
The new generation of stream ciphers has being shifted from the traditional mode: LFSR [6] to various nonlinear modes: NLFSR [20,21], clock control [13], nonlinear functions [11], etc.; it is essential for ciphers to be integrated and implemented [22] to satisfy security models. However, different from LFSR with well-established linear mathematical theories and simulation tools, it is extremely difficult to use advanced nonlinear mathematical theories, recursive models, descriptive tools, and implementing schemes [19] in nonlinear dynamic environments. How to evaluate cryptographic sequences generated from the nonlinear stream ciphers is an urgent problem for modern stream/block ciphers.

Truly Random Sequences from Hardware Devices
In addition to pseudorandom sequences generated by stream ciphers, high-quality stochastic oscillators of truly random sequences are generated from special hardware devices such as laser photonics [23], nonlinear optics [24], quantum optics [25], quantum noises [26], thermal noise [27], and chaos and fractal nonlinear dynamics [28].
Since various truly random sequences are created from specific physical models with special principles and uncertain methodologies, it is extremely difficult for cryptographic researchers to make proper measurements explore nonlinear dynamic properties.

P_value Schemes-Statistical Tests on Cryptographic Sequences
Randomness has being explored for many years [29] on a series of statistic testing theories and methods. From a testing viewpoint, it is feasible to apply statistic testing packages to measure randomness properties on a given cryptographic sequence. NIST 800-22 package is a typical representative to provide more than 15 testing schemes for evaluation. Using the testing package, it is essential to check whether P_value >0.01 for the sequence. Since such measuring scheme provides static property, it is difficult to use only P_value parameter to express complex dynamic behaviors intrinsically involved in cryptographic sequences.
Since comprehensive behaviors in nonlinear dynamics may increase computational complexities tragically to involve complicated dynamic properties in the multivariate environment, those dynamic behaviors are completely ignored in P_value schemes.

Multiple Statistical Probability Distributions
Measuring cryptographic sequences under segment conditions, multiple statistical probability schemes are useful to create various distributions to illustrate complex spatial relationships.
Multivariate normal probability distributions are the most important and powerful tool to test stochastic characteristics of a random data sequence [30] under the framework of probability, stochastic process, and statistics [31] for nonlinear problems. In this kind of measuring models, when a data sequence is sufficiently long, the high-dimensional probability distribution of the sequence [32] is converted into a continuous Gaussian distribution. A typical projection model is shown in Fig. 1a; the central part shows a Gaussian surface with an unbalanced distribution in a 2D plane distributed as P(X, Y ) measures with pseudo-colors and two 1D projections shown in horizontal P(X ) and vertical P(Y ) planes, respectively. In Fig. 1b, a standard Gaussian surface with symmetric shapes is illustrated and the 2D projection of its pseudo-color map is shown in Fig. 1c with continuous distribution of color on the map. From sample figures, the relationship between the projection curve and two 1D Gaussian distributions are observed in the multivariate normal probability environment. Multivariate Gaussian probability distributions support various schemes to analyze complex stochastic data set of measuring sequences in many applications in continuous conditions.

Photon Statistic in Quantum Optics
Photon statistics is the theoretical and experimental approach on the statistical distributions in photon counting experiments to analyze the statistical nature of photons in a light source.
Three types of statistical distributions shown in Fig. 2 can be obtained by the light source [33]: Poissonian, super-Poissonian, and sub-Poissonian. The variance and average number of photon counts are identified for the corresponding distribution. Both Poissonian and super-Poissonian light are described by a semi-classical theory in which the light source is modeled as an electromagnetic wave and the atom is modeled by quantum mechanics. In contrast, sub-Poissonian light requires the quantization of the electromagnetic field for a proper description and is a direct measure of the particle nature of light.

Stationary and Non-stationary Properties
In mathematics and statistics, a stationary process is a stochastic process [34] whose joint probability distribution does not change when shift operations performed. Consequently, parameters such as mean and variance, if they are present, also do not change over time. Stationarity is an interesting property for many statistical procedures in time series analysis.
In 1938, Kolmogorov established the basic theorems for smoothing and predicting stationary stochastic processes [35,36] that had major military applications during the Cold War.
In applied mathematics, the Wiener-Khinchin theorem [37][38][39] states that the Autocorrelation Function (ACF) of a wide-sense-stationary process has a spectral decomposition given by the power spectrum of the process. One of the effective ways identifying stationary times series is the ACF plot [40]. For a stationary time series, the ACF will drop to zero relatively quickly, while the ACF of nonstationary data decreases slowly [41].

Pseudorandom Number Resources
Four cryptographic sequences are selected: {AES,DES, A5, RC4}. For each cipher, a cryptographic sequence of 100MB data streams is collected.
{AES, DES} are block ciphers [16] on OFB mode to transfer block cipher output as a stream cipher stream.
A5/1 is a stream cipher [42] based around a combination of three LFSRs with irregular clocking.
RC4 is a stream cipher [43] designed by Ron Rivest in 1987. The design of RC4 avoids the use of LFSRs, its structure is ideal for software implementation, and it requires only byte manipulations.

Two Quantum Random Number Resources
Reliable and unbiased random numbers are important in cryptographic applications. Many algorithms can be used to generate pseudorandom numbers, but they can never be perfectly random or indeterministic.
Quantum random numbers can be generated from a physical quantum source of a coherent laser light to be splitting a beam of light into two beams and then measuring the power in each beam. Due to the light intensity in each beam, it fluctuates about the mean. Those fluctuations can be converted into a source of random numbers [44][45][46] being a stationary Poisson distribution.
Two quantum cryptographic resources are selected: {ANU, USTC}. For each quantum cipher, a truly random sequence of 1GB data streams is collected.
USTC resource: In the Key Laboratory of Quantum Information, USTC, CAS, true random number sequences are generated [45]. This type of true random sequences supports advanced quantum communication devices of QKD systems [47,48].
More than 20GB quantum random number sequences are provided by USTC for randomness testing.
ANU resource: The ANU Quantum Random Numbers Server is an open website [49] to offer true random numbers to anyone on the Internet. Such random numbers are generated in real time by measuring the quantum fluctuations of the vacuum. The electromagnetic field of the vacuum exhibits random fluctuations in phase and amplitude at all frequencies. By carefully measuring these fluctuations, ultra-high bandwidth random numbers can be generated. Relevant data streams are downloaded.

Variant Framework
The conjugate classification [50] is proposed to apply seven measures in a hierarchy to partition the kernels of four regular plane lattices on n = {4, 5, 7, 9} cases for 2D binary images. For 1D cellular automata sequences, global random behaviors [51] are visualized in 2D maps.
Various schemes following the top-down strategy are explored to use multiple measures to partition special phase spaces from a top state set to multiple bottom states via multilevels of a hierarchy in combinatorial algorithms [52], image analysis, and processing for many years.

Proposed Scheme
For the convenience of testing stationary randomness on six cryptographic sequences, we propose a testing system for a stationary random sequence with length N ; multiple segments M are divided from the sequence by a given length m; a 2-tuple pair of measures can be extracted from a 0-1 segment that is the number of 1 element and the number of 01 pattern in the segment. All paired measures are composed of a sequence of M pairs of measures as an ordered measuring set with M elements.
The pairs of the measuring sequence are directly separated as two independent measuring sequences to keep each parameter in the same order. A total of three sequences of distinct measures are constructed including two sequences on single measures and one sequence on 2-tuple measures.
Following this approach, two sets of single measuring sequences are sorted as two 1D numeric arrays as statistical histograms corresponding to 1D maps, and the 2tuple measuring sequence is sorted as a 2D integer array as statistic histograms being a 2D map. Under the controlling operations on the changes of shift displacement, multiple results of the three measuring sequences are transformed into 1D statistic histograms and 2D pseudo-color maps to show effective patterns from the generated sequence under various positions and conditions on a list of shift operations.

Organization of the Chapter
This chapter describes a testing system for a stationary random sequence on diagrams of the system architecture and the core modules with input/output and processing functions in Sect. 2. In Sect. 3, the relationships among measuring sequences and the three statistical distribution maps are analyzed. In Sect. 4, four random sequences are generated from {AES, DES, A5, RC4} ciphers and two quantum cryptographic sequences collected from the Key Laboratory of Quantum Information, USTC, CAS, and ANU quantum number site. From the results of the visual maps in section IV, numeric analysis and brief comparison are carried out in Sect. 5. And finally in Sect. 6, the main results are summarized.

Testing System
To describe the testing system, diagrams are shown in Fig. 3.  Fig. 3 The architecture of testing stationary random sequences

System Architecture
This system is composed of five parts: Input, Shifted Transformation (ST), Segment Measurement (SM), Combinatorial Projection (CP), and Output.
The input of the testing system is a selected 0-1 sequence, and its output is composed of three maps, two in 1D and one in 2D for visual distributions, and three maximals to be processed by ST, SM, and CP modules, respectively.

Core Modules
The Let X, Y be 0-1 sequences with N elements, and the ST module takes the sequence X as input, then shift r position on the whole sequence to be the shifted sequence Y = X (r ) (i.e., a cyclic shift right + or shift left −).
In the SM module, the shifted vector is inputted and will be divided from a long sequence into M segments. For the i-th sub-vector, 0 ≤ i < M on the j-th position 0 ≤ j < m, denoted as Y i, j .
This sequence at the end of sub-vectors after the segmenting operation forms an m * M matrix, m positions for the i-th complete row vector in the sequence correspond to a pair of 2-tuple measures: ( p i , q i ).
The SM outputs the ordered M pairs of 2-tuple measures { p i , q i } M−1 i=0 . The CP module consists of two units: Split and projection. The split adapts the SM's output as the input, and the 2-tuple measuring sequence {( p i , q i )} M−1 i=0 will be splitted into two independent measuring sequences: . The projection unit consists of three steps: Project Array (PA), Color Map (CM), and Get Maximal (GM). For three measuring sequences, two types of 1D and 2D measures will be processed separately.
The PA processes measuring sequences to transform them into integer arrays and the CM will organize them on either normalized histograms (1D measures) or color maps (2D measures), respectively.
The The 1DP statistic histogram is generated from a sequence { p i } M−1 i=0 , N P, P two arrays (floating point, integer) with (m + 1) elements. For the j-th element N P[ j], P[ j], 0 ≤ j ≤ m, and 1DP x the maximal element, the output can be obtained by following procedure: In the 1DP map, the PA corresponds to initialization and calculation; the MA handles normalization and the GM identifies the maximal element of the map.
The 1DQ statistic histogram is generated from a sequence {q i } M−1 i=0 , N Q, Q two arrays (floating point, integer) with ( m/2 + 1) elements. For the j-th element N Q[ j], Q[ j], 0 ≤ j ≤ m/2 , and 1DQ x the maximal element, the output can be obtained from following procedure: Using P, N P, Q, N Q arrays, it is possible to generate corresponding 1D statistical histograms as 1D maps.
In the 1DQ map, the PA corresponds to initialization and calculation; the MA handles normalization and the GM identifies the maximal element of the map.
The 2D measures specially processes one measuring sequence: 2DPQ statistic histogram is generated from a sequence{( and 1DPQ x the maximal element, their values can be obtained by following procedure: In the 2DPQ map, the PA corresponds to initialization and calculation; the MA handles pseudo-color and the GM identifies the maximal element of the map. Through the CP module, three measuring sequences are transformed into two 1D arrays and one 2D array with (m + 1), ( m/2 + 1) and (m + 1) * ( m/2 + 1) clusters.
The outputs of the testing system are three maps {1DP, 1DQ, 2DPQ} and three maximals {1DP x , 1DQ x , 2DPQ x } as expected statistic distributions and representatives of the input 0-1 sequence, respectively.

Association Analysis
It is a counting scheme to sort the { p i } M−1 i=0 measuring sequence as a 1D histogram. When the measuring sequence meets ideal conditions, the 1D statistical distribution is a binomial distribution.
Lemma 1 For an input 0-1 sequence, if the total number of segments is equal to M = 2 m , and each segment of m bits appears only once in the sequence, then the 1DP array satisfies the binomial distribution Corollary 2 If the input sequence meets the conditions of Lemma 1, then the total number of items in the 1DQ array is equal to Corollary 3 For any 0-1 sequence with N elements, a 2DPQ projection in two directions is corresponding to either a 1DP array or a 1DQ array, respectively.
Proof A 2DPQ array is generated from a measuring sequence { p i , q i } M−1 i=0 and the 2DPQ array is sorted by So two projections are corresponding to an either 1DP or 1DQ array.
In Corollaries 3 and 4, the total number of each component on three statistic arrays is equal to the total number of segments M, and the 2DPQ array occupies a central position in the projection to other two arrays.
Let {1DP x (r ), 1DQ x (r ), 2DPQ x (r )} denote three maximals on the selected sequence for 0 ≤ r ≤ m; three maximal sequences are . For a 0-1 sequence with M segments, if each segment of m bits is composed of a state and only one state is involved, then the sequence is a circular sequence.
Proof For a circular sequence, shift operations do not change the pair of measures, only a single ( p, q) value is possible.

Theorem 1 For a sequence with stationary random properties, it has
Proof In any random condition, it is necessary for pairs of {( p, q)} to have certain states significantly different from a circular sequence in either 1 or M condition. Under the stationary random condition, all maximals satisfy only relations under shift operations.
For a G map, let G x be an average variation, ΔG x be a region of variations, and G R x = ΔG x /G x be a variation ratio. Theorem 2 For two {i, j}-th G maps G i and G j on G i x G j x with variation ratios G i,R x and G j,R x , if a variation ratio has a minimal value, then the relevant map has a better stationary random property than the maximal one.

Testing Results
Four pseudorandom sequences are generated by {A5,RC4,DES, AES} ciphers, and two quantum cryptographic sequences are selected from both ANU and USTC resources.  Table 1, and their sorted orders are listed in Table 2. Twentyfour 2D maps of maximal curves for r = 0 − 128 are shown in Table 3. Three left columns contain 18 enlarged variation maps of {1DQ, 1DP, 2DPQ} and the last column contains six variation regions of 1DQ + 1DP + 2DPQ in six 2D maps. Six enlarged 2D maps are shown in Table 4 and six larger 2D maps are shown in Table 5.
In Table 6, 49 pairs of differences for variation ratios are listed in three 7 × 7 tables to illustrate refined quantity measures on three levels. There are seven entries on diagonals with seven trivial 0 values. For other 42 nontrivial values, let dG R x % denote differences of G R x % based on the basic variation ratios in Table 1, and various differences of variation ratios among six samples are listed. Differences of three variation ratios {d Q R x %, d P R x %, d P Q R x %, } on seven items {∅, AES, DES, A5, RC4, ANU, USTC} are illustrated.

Result Analysis
Eighteen maps in Fig. 4   In Table 1, three pairs of maximal and minimal variation ratios are identified and three full orders are sorted in Table 2. Compared with G x sorted orders, both {ΔG x , G R x } variation ratios, six samples keep the same sorted orders as two groups: 1DQ and {1DP, 2DPQ} for their min-max variation ratios. Six enlarged 2DPQ maps on shift r = 32 are shown in Fig. 5 to form three pairs {AES:DES, RC4:A5, ANU:USTC}. Three pairs of six maps have similar visual distributions.
Twenty-four variation maps are shown in Table 3 as four groups. Each group contains six 2D maps. For three groups of {1DQ, 1DP, 2DPQ}variation distributions, eighteen enlarged 2D maps are shown in significant waveforms. For the group of 1DQ + 1DP + 2DPQ distributions, six maps are shown in three average variations satisfying 1D Q x > 1D P x > 2D P Q x , respectively. The fourth group of variation measures combines three variations of 1DQ + 1DP + 2DPQ in one unified 2D maps. From the six 2D maps, their stationary randomness of global variations are clearly illustrated.
In Table 4, AES and DES map may have high frequent waves, and other enlarged 2D maps have stationary properties. In Table 5, larger waves appear and more details could be identified. Although significant variations are appeared in different 2D maps, it is difficult to make classification depending on their variation behaviors.  Considering all differences of variation ratios on six samples listed in Table 6, there are only 0.0034-4.27% differences (thirty-four in one million to four percent) are recognized. From a measuring viewpoint, all six samples are showing distinct stationary randomness properties.  Table 6 Differences of variation ratios among three maximals of six samples

Conclusion
It is feasible to evaluate stationary properties for a random sequence using the testing system. Using three maps {1DP, 1DQ, 2DPQ}, a series of variation measures and their ratios are illustrated. Extracting maximal measures is identified for shift r : 0 − m. For each sample, three 2D maps of variation curves provide refined characteristics to evaluate stationary randomness properties in global. Sample variation maps are shown in exactly similar-equal relationships among the same group of average variations. Further explorations and applications are required to check the testing system on other applications of cryptographic streams. Three quantity categories of artificial, semi-artificial, and natural designs may be explored to get intrinsic stationary randomness information from refined testing and future explorations.
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.