Keywords

1 Introduction

In modern cyberspace environments, more than 2.5 EB data streams per day are generated from global network environments [1]. Huge network companies managed massive data streams in PB every day [2]. The development of artificial intelligence fields makes it easier to extract valuable information from big data [3,4,5]. Big data and big data technology provide modern societies so much convenience to many places, and with several threats to network security [6, 7].

Stream ciphers are the most useful scheme to protect the security of data streams in both transmission and storage processes. Pseudorandom number sequences are generated by various algorithms based on recursive computational models, and true random number sequences are generated by different physical methods. The typical stream ciphers are RC4 and Salsa20. Stream ciphers can be built using block ciphers in OFB or CTR model. In this chapter, an RC4 stream cipher is selected to generate pseudorandom sequences for testing.

From a testing viewpoint, randomness tests focus on three aspects: probability, autocorrelation, and unpredictability. NIST 800-22 provides a list of randomness testing method based on p-value [8].

In this chapter, two types of 1D and 2D statistical probability maps are used to visualize a longer pseudorandom number sequence generated from an RC4 stream cipher.

2 Related Work

Variant map is an emerging technology proposed in 2010s to handle multiple 0–1 vectors in phase spaces on variant framework [9,10,11]. Different applications are explored for variant maps on ECG data sequences [12], bat echolocation call sequences [13], gene sequence [14], and cryptographic sequences [15,16,17].

3 Mapping Model

This chapter uses two mapping schemes on 1D and 2D statistical probability distributions as variant maps for an input N-length 0–1 sequence. The architectural diagram of the mapping model is shown in Fig. 1. It is composed of three components: segmentation, measurement, and visualization.

Fig. 1
figure 1

Architecture of variant map for cryptographic sequence

3.1 Basic Symbol

  1. (1)

    S: an input 0–1 sequence,

  2. (2)

    \( s_{i} \): the i-th segment of the input sequence,

  3. (3)

    N: length of the input sequence,

  4. (4)

    M: count of segments,

  5. (5)

    m: length of a segment, and

  6. (6)

    p: number of 1’s elements in the segment.

3.2 Mapping Model

Three components can be described as follows.

  • Segmentation

Input data is a 0–1 sequence S of length N. It can be divided into M segments and each segment has m elements.

$$ {\text{M}} = {\text{~}}\left\lfloor {\frac{N}{m}} \right\rfloor $$
$$ S = \left\{ {s_{0} ,s_{1} , \ldots ,s_{i} , \ldots ,s_{M - 1} } \right\},\quad 0 \le i < M $$
  • Measurement

    For each segment \( s_{i} \) of S, the following analysis is performed to obtain the one feature \( p_{i} \) of the segment, that is, the number of 1 of \( s_{i} \), and 0 \( \le p \le m \). For example, for two segments \( s_{1} \) = 00011 and \( s_{2} \) = 10110, and two measurements are \( p_{1} = 2 \) and \( p_{2} = 3 \) (Fig. 2).

    Fig. 2
    figure 2

    Measurement

Calculating all segments of S, a set of p measurements are determined.

$$ \left\{ {p_{0} , \ldots ,p_{i} , \ldots ,p_{M - 1} } \right\} = \left\{ {p_{i} } \right\}_{i = 0}^{M - 1} ,\quad 0 \le i < M $$
  • Visualization

From the generated sequence of measurements, two types of diagrams can be created: The first one is a 1D map, 1DP sorted from \( \left\{ {p_{i} } \right\}_{i = 0}^{M - 1} \) directly shown in Fig. 3a. The second one is a 2D map, 2DP sorted from a pair of measurements \( \left\{ {p_{i} ,p_{i + 1} } \right\}_{i = 0}^{M - 1} \) created from \( \left\{ {p_{i} } \right\}_{i = 0}^{M - 1} \) shown in Fig. 3b. This mapping scheme is one of Markov chain models.

Fig. 3
figure 3

Two maps; a 1DP; b 2DP

4 Random Sequence Data Sources

In this chapter, a pseudorandom generator is based on an AES block cipher on the OFB mode. A total amount of 120 MB cryptographic sequences has been generated.

5 Mapping Results

The input sequence is mapped with a list of various lengths on different segmentations. Three sets of various m lengths are selected and two types of relevant 1DP and 2DP maps are shown in Fig. 4a–c, for (a) \( m = \left\{ {8,16,32,64,128,256} \right\} \), (b) \( m = \left\{ {80,100,120,140,160} \right\} \), and (c) \( m = \left\{ {126, 127, 128, 129, 130} \right\} \). Four enlarged 2DP maps are shown in Fig. 5 for \( m = \left\{ {126,127,128,129} \right\} \) and two enlarger 2DP maps are shown in Fig. 6 for \( m = \left\{ {128,130} \right\} \), respectively.

Fig. 4
figure 4

1DP and 2DP maps. a \( m = \left\{ {8,16,32,64,128,256} \right\} \); b \( m = \left\{ {80,100,120,140,160} \right\} \); c \( m = \left\{ {126,127,128,129,130} \right\} \); d enlarged 1dp and 2dp, \( m = \left\{ {126, 127, 128, 129, 130} \right\} \)

Fig. 5
figure 5

Enlarger 1DP maps. a m = 126; b m = 127; c m = 128; d m = 129

Fig. 6
figure 6

Enlarged 2DP maps. a m = 126; b m = 127; c m = 128; d m = 129

6 Result Analysis

In Fig. 4, both 1DP and 2DP maps are illustrated. When the input sequence is larger enough to \( m \times 2^{m} \), the results of 1DP maps are corresponding to binomial distributions. It is interesting to see significant changes when various lengths of segments are applied.

For various 2DP maps in Figs. 4, 5, and 6, 2D distributions are represented as pseudocolor to illustrate relevant 3D structures. From smaller maps to enlarged maps, many interesting features can be identified and significant symmetric or nonsymmetric properties could be identified. Enlarger maps can see further refined patterns in detail.

7 Conclusion

Mapping model in this chapter is a focus on a single sequence for two types of 1DP and 2DP maps. 1DP maps are corresponding to classical statistical maps and 2DP maps are represented as various Markov chains. Further researches and experiments are required to explore useful tools on cryptographic sequences in detail (Figs. 7 and 8).

Fig. 7
figure 7

Enlarger 1DP maps. a m = 128; b m = 130

Fig. 8
figure 8

Enlarger 2DP maps. a m = 128; b m = 130