1 Introduction

Random number generators are used in cryptography, in games of chance, in all computer algebra systems or other programming languages and in numerical simulations, to cite a few. In order to achieve fast generation of random numbers, researchers have focused their attention to chaotic systems that can be experimentally implemented [5, 15, 21]. Chaotic systems are sensitive to initial conditions and present mixing properties that are necessary for a good pseudo-random number generator [12]. Since then, various chaotic systems generating a large variety of complex dynamics have been modeled, but they are still suffering from lack of reliable methods for their implementation [3, 24,25,26, 32]. Some of them are realized with analogue circuits, while many others are more and more implemented using numerical targets like the Field Programmable Gate Array (FPGA) [2, 16, 19, 26,27,28].

Chaotic systems have been shown efficient and convenient for modern cryptography, although most experimental and commercial systems are using random number generators (RNGs) based on modular algebra operations, as the digitization of chaotic orbits sometimes may reduce the key sensitivity [20, 26]. Such RNGs present the advantage to make modular calculations in a finite field (the Galois field GF(2n) for example), hence to be easily implemented on hardware with a finite number of basic electronic logic gates without loss of precision. An example is the RNG implemented by the RAND function in the MATLAB software to generate uniformly distributed random numbers. Another example is the Arnold cat map (ACM) which is often used for its ergodic and mixing properties [1, 30]. In practical applications, the original cat map is generalized and discretized in the phase space to obtain the quantized ACM (QACM).

Arnold’s cat map is known to be chaotic, area-preserving, ergodic and mixing, and invertible [8, 10, 17]. It has a unique hyperbolic fixed point and the linear transformation defining it is hyperbolic (it presents irrational eigenvalues, one with an absolute value greater than 1 and the other one less than 1). Its quantized version forms short limit cycles whose lengths depend on the modulo value, although it preserves the properties of its continuous analogue [4, 11]. The other properties of this interesting map can be found in the literature [4, 8, 10, 11, 17]. The ACM is used in cryptography, in digital tattoo applications, in watermarking and for random number generation to cite a few [8, 9, 23]. The QACM is particularly used for image scrambling due to its periodic nature [7]. It has been also used for the implementation of public key ciphers [18], but the latter are not secure when dealing with QACM with weak periods [22].

Thus, the period of the QACM is an important parameter when using it in cryptography. It has been shown that the period of the QACM does not exceed 3m, m being the modulo value. In the case of n-bit precision (m = 2n) which is convenient for digital applications, the period of the QACM is only equal to 3 ⋅ 2n− 2, n ≥ 2, which is effectively smaller than 3m. Therefore, for the security level of ciphers including the QACM to be enhanced, its period needs to be increased. In order to overcome such a limitation of the period, the ACM (n = 0) is preferred to the QACM in many applications. Some improvements including the increase of the dimension of the map have been proposed. Guoscheng et al. [14] proposed to extend the conventional 2D Arnold’s cat map into a 3D map by introducing six control parameters. Although the resulting map allows to increase the key space for data encryption, the authors did not investigate its period distribution, as well as the impact of the introduced control parameters on dynamics of the system. To prevent the degradation of chaotic sequences into periodic ones due to the finite computer precision, they just applied a slight perturbation on the 3D map output without formally investigating its impact. In [33], the authors combined the 2D cat map with an affine cipher to enhance the security level of their proposed cipher. In order to efficiently apply Arnold’s cat map to data encryption, it is important to directly investigate and increase its period in the discrete phase space, hence to significantly increase the period of the QACM, even for small data precision.

In this paper, we suggest to introduce a nonlinear perturbation to the linear QACM for its period to increase. In order to preserve the simplicity of the QACM, we consider as nonlinear element another modular algebra based module, such that the final system is a piece-wise linear cat map (PWLCM). We thus investigate the dynamics of the so-called PWLCM and verify that in the case of 4-bit precision, its period is more than 1011 times greater than that of the conventional QACM. An equivalent electronic circuit is proposed in the case of 4-bit precision to further confirm the simplicity of the proposed system that can be used for the generation of pseudo-random numbers. Furthermore, an equivalent implementation on Zynq 7020 FPGA board is presented in order to confirm the effectiveness of the proposed architecture.

The rest of the paper is organized as follows: in Section 2 the modeling system is presented, Section 3 is devoted to the results analysis, Section 4 shows the electronic implementation of the PWLCM while in Section 5 some concluding remarks are given.

2 The modeling system

2.1 The conventional quantized Arnold cat map

The Arnold cat map has been widely described and investigated in the literature. The evolution of the 2D system behavior, where the two variables (position and momentum) are completely depending on each other is modeled as follows [17]:

$$ \left\{ \begin{array}{ll} x(t+1)=x(t)+\alpha y(t) \\ y(t+1)=\beta x(t+1)+y(t) \end{array}\mod m. \right. $$
(1)

The system in (1) can be rewritten using matrix representation as

$$ \mathbf{x}(t+1)=A\mathbf{x}(t)\mod m $$
(2)

where

$$ A=\left( \begin{array}{cc} 1 & \alpha \\ \beta & \alpha\cdot\beta+1 \end{array} \right), $$

\((\alpha ,\beta )\in \mathbb {N}_{\geq 1}^{2}\), and x = (x,y)T; (⋅)T is the transpose of (⋅). This discrete time system is continuous in the phase space for (x,y) ∈ [0,1)2 and m = 1. The QACM is obtained for (x,y) ∈ [0,m)2 with \(m\in \mathbb {N}_{>1}\). It is periodic and its period depends both on m and the parity of α and β. For α = β = 1 and m = 2n, the period behaves like

$$ {\Pi}_{n}=2\cdot {\Pi}_{n-1}, n>2 $$
(3)

with π1 = π2 = 3 for the minimal period, as shown in [8, 11].

2.2 The piece-wise linear cat map

In order to increase the period of the QACM, we introduce a nonlinear perturbation term to the conventional QACM. The modified system is written as

$$ \mathbf{x}(t+1)=A\mathbf{x}(t)+\mathbf{x}_{c}(t)\mod m, $$
(4)

where

$$ {\mathbf{x}_{c}}(t) = \left( {\begin{array}{*{20}{c}} {\sum\limits_{i = 1}^{M} {\Big({a_{i}} + y(t)\Big)\bmod {c_{i}}} }\\ {\sum\limits_{j = 1}^{N} {\Big({b_{j}} +x(t + 1)\Big)\bmod {d_{j}}} } \end{array}} \right) $$
(5)

with \((i,j)\in \mathbb {N}^{2}\), ci and dj two natural numbers such that 0 ≤ ci < m + ai and 0 ≤ dj < m + bj, 0 ≤ ai,bj < m if (ci,dj) = (0,0); 0 ≤ ai < ci if ci≠ 0 and, 0 ≤ bj < dj if dj≠ 0. Let us consider xc(t) = (xc(t),yc(t))T with

$$ x_{c}(t)=\sum\limits_{i = 1}^{M} {x_{c,i}(t)}, $$
(6)
$$ y_{c}(t)=\sum\limits_{j = 1}^{N} {y_{c,j}(t)}. $$
(7)

and

$$ x_{c,i}(t)={\Big({a_{i}} + y(t)\Big)\bmod {c_{i}}}, $$
(8)
$$ y_{c,j}(t)={\Big({b_{j}} +x(t + 1)\Big)\bmod {d_{j}}}, $$
(9)

Equations (8)-(9) can be written as piece-wise linear functions such that:

$$ x_{c,i}(t)=\left\{ \begin{array}{ll} a_{i}+y(t), & \text{if } a_{i}+y(t)<c_{i}; \\ a_{i}+y(t)-q_{i}c_{i}, & \text{otherwise,} \end{array} \right. $$
(10)

where \(q_{i}=\lfloor \frac {a_{i}+y(t)}{c_{i}}\rfloor \); and

$$ y_{c,j}(t)=\left\{ \begin{array}{ll} b_{j}+x(t+1), & \text{if } b_{j}+x(t+1)<d_{j}; \\ b_{j}+x(t+1)-q_{j}d_{j}, & \text{otherwise,} \end{array} \right. $$
(11)

\(q_{j}=\lfloor \frac {b_{j}+x(t+1)}{d_{j}}\rfloor \). By developing the whole set of equations, we obtain the PWLCM defined as:

$$ \mathbf{x}(t+1)=B\mathbf{x}(t)+C(t)\mod m $$
(12)

where

$$ B=\left( \begin{array}{cc} 1 & \alpha^{\prime} \\ \beta^{\prime} & \alpha^{\prime}\beta^{\prime}+1 \end{array} \right), $$
(13)

with \(\alpha ^{\prime }=M+\alpha \), \(\beta ^{\prime }=N+\beta \) and,

$$ C(t)=\left( \begin{array}{c} \sum\limits_{i=1}^{M} \Bigg(a_{i}-q_{i}c_{i}\cdot u\Big(a_{i}+y(t)-c_{i}\Big)\Bigg) \\ \beta^{\prime}\sum\limits_{i=1}^{M} \Bigg(a_{i}-q_{i}c_{i}\cdot u\Big(a_{i}+y(t)-c_{i}\Big)\Bigg)+ \sum\limits_{j=1}^{N} \Bigg(b_{j}-q_{j}d_{j}\cdot u\Big(b_{j}+x(t+1)-d_{j}\Big)\Bigg) \end{array} \right). $$
(14)

u(t) is the Heaviside function defined as

$$ u(t)=\left\{ \begin{array}{ll} 0, & \text{if } t< 0; \\ 1, & \text{otherwise.} \end{array} \right. $$
(15)

The PWLCM thus obtained presents a conservative linear term Bx(t) (\(\det (B)=1\)) that exhibits the same behavior as a QACM, and a nonlinear term C(t) that contributes to increase the period of the linear term by modifying its trajectory for a given initial condition. ai and bj, ci and dj are defined as perturbation parameters.

2.3 Stability analysis of the PWLCM

In this section, we investigate the stability of the PWLCM. While considering the system in (12), we deduce the following Jacobian matrix:

$$ J = \left( \begin{array}{cc} 1 & \alpha^{\prime}-{\sum}_{i=1}^{M}c_{i}\delta\Big(y(t)-{\tau_{y}^{i}}\Big)\\ \!\!\beta^{\prime}-{\sum}_{j=1}^{N}d_{j}\delta\Big(x(t+1) - {\tau_{x}^{j}}\Big) & \!\!1 + \Bigg(\alpha^{\prime} - {\sum}_{i=1}^{M}c_{i}\delta\Big(y(t) - {\tau_{y}^{i}}\Big)\Bigg)\Bigg(\beta^{\prime} - {\sum}_{j=1}^{N}d_{j}\delta\Big(x(t + 1) - {\tau_{x}^{j}}\Big)\Bigg) \end{array} \!\right) $$
(16)

where \({\tau _{x}^{j}}=d_{j}-b_{j}\) and \({\tau _{y}^{i}}=c_{i}-a_{i}\). Indeed, qi = 1 when \(\delta \Big (y(t)-{\tau _{y}^{i}}\Big )=1\) and qj = 1 when \(\delta \Big (x(t+1)-{\tau _{x}^{j}}\Big )=1\). From the above Jacobian matrix we deduce the eigenvalues

$$ \begin{array}{c} {\Lambda}_{1}(t)=1+\frac{1}{2}\Bigg(\alpha^{\prime}-{\sum}_{i=1}^{M}c_{i}\delta\Big(y(t)-{\tau_{y}^{i}}\Big)\Bigg)\Bigg(\beta^{\prime}-{\sum}_{j=1}^{N}d_{j}\delta\Big(x(t+1)-{\tau_{x}^{j}}\Big)\Bigg) \\ \left( 1+ \sqrt{1+\frac{4}{\Bigg(\alpha^{\prime}-{\sum}_{i=1}^{M}c_{i}\delta\Big(y(t)-{\tau_{y}^{i}}\Big)\Bigg)\Bigg(\beta^{\prime}-{\sum}_{j=1}^{N}d_{j}\delta\Big(x(t+1)-{\tau_{x}^{j}}\Big)\Bigg)}}\right) \end{array} $$
(17)

and

$$ \begin{array}{c} {\Lambda}_{2}(t)=1+\frac{1}{2}\Bigg(\alpha^{\prime}-{\sum}_{i=1}^{M}c_{i}\delta\Big(y(t)-{\tau_{y}^{i}}\Big)\Bigg)\Bigg(\beta^{\prime}-{\sum}_{j=1}^{N}d_{j}\delta\Big(x(t+1)-{\tau_{x}^{j}}\Big)\Bigg) \\ \left( 1- \sqrt{1+\frac{4}{\Bigg(\alpha^{\prime}-{\sum}_{i=1}^{M}c_{i}\delta\Big(y(t)-{\tau_{y}^{i}}\Big)\Bigg)\Bigg(\beta^{\prime}-{\sum}_{j=1}^{N}d_{j}\delta\Big(x(t+1)-{\tau_{x}^{j}}\Big)\Bigg)}}\right) \end{array} $$
(18)

The determinant of J is equal to 1, which implies that the sum of the Lyapunov exponents λ1(t) and λ2(t) is equal to 0, hence Λ1(t) ≥ 1 and 0 ≤Λ2(t) ≤ 1. The PWLCM is thus a conservative system as the generating ACM, independently to the choice of the parameters ai, bi, ci and di. Depending on the choice of these parameters, it can be difficult to determine the steady states of the system, whenever they exist. For ai = bj = 0, ∀i,j, (x = 0,y = 0) is the single steady state of the system. Given that Λ1,2 > 0, all the existing steady states of the PWLCM are unstable.

2.4 The reverse PWLCM

The generalized inverse PWLCM is obtained by determining x(t) and y(t) from (4) as:

$$ \left \{ \begin{array}{r c l} x(t) & = & x(t+1) - y(t) - {\sum}^{M}_{i = 1} (y(t) + a_{i})\bmod c_{i} \\ y(t) & = & x(t+1)- y(t+1) - {\sum}^{N}_{j = 1} (x(t+1) + b_{j})\bmod d_{j}. \end{array} \bmod 2^{n} \right . $$
(19)

Given that x(t + 1) and y(t + 1) are the initial condition for the reverse system, x(t) and y(t) are the iterates that are obtained from the initial conditions. By reversing the time evolution, (19) can be rewritten as:

$$ \left \{ \begin{array}{r c l} y(t+1) & = & x(t)- y(t) - {\sum}^{N}_{j = 1} (x(t) + b_{j})\bmod d_{j} \\ x(t+1) & = & x(t) - y(t+1) - {\sum}^{M}_{i = 1} (y(t+1) + a_{i})\bmod c_{i} . \end{array} \bmod 2^{n} \right . $$
(20)

Equation (20) is the reverse PWLCM.

3 Results and discussion

In this section, we investigate the dynamics of the PWLCM period and largest Lyapunov exponent with respect to the system control parameters and initial conditions. For a given precision, the period of the PWLCM is equivalent to the least common multiple (lcm) of the individual periods of the set of initial conditions [6, 13, 27, 29, 31]. Indeed, each possible initial condition of the phase space generates its own dynamics whose period is determined. The number of initial conditions is directly related to the precision n. For n = 1 for example, there are four possible initial conditions that are (0,0),(0,1),(1,0) and (1,1).

3.1 Sensitivity to initial conditions

3.1.1 Sensitivity of the period

We evaluate the period of the system for various precisions n = 2 to n = 8. Table 1 illustrates the matrix T(x0,y0) of individual periods for the different initial conditions of the PWLCM in the case of n = 2. We set for this example α = β = 1, M = N = 2, c1 = 0, c2 = 3, d1 = 3, d2 = 5, a1 = 1, a2 = 1, b1 = 0 and b2 = 2. The period of the PWLCM in that case is equal to π = lcm({T(x0,y0)}) = 105, 0 ≤ x0,y0 ≤ 2n − 1; while the corresponding period for the QACM is 3. In order to estimate the impact of the nonlinear term on the QACM, we evaluated the period of the QACM described by matrix B, instead of matrix A. We obtained as period πB = 3 while πA = 3. It appears that by adding the modulus terms, the system described by TA is both linearly and nonlinearly modified, thus leading to a new QACM that is perturbed by the nonlinear term C(t). The linear modification leads to the conventional QACM, whereas the nonlinear modification leads to a completely different system with a large period that does not necessarily respect the relation in (3).

Table 1 Matrix of the individual period of different initial conditions of the PWLCM for n = 2, α = β = 1, M = N = 2, c1 = 0, c2 = 3, d1 = 3, d2 = 5, a1 = 1, a2 = 1, b1 = 0 and b2 = 2

Table 1 also shows that the system above described presents a single steady state that is (x0 = 2,y0 = 3). While evaluating the impact of the perturbation on the QACM, we observed that for some combinations of parameters ai, bi ci and di, the PWLCM may present or not multiple steady states. For α = β = 1, M = N = 2, c1 = c2 = 0, d1 = d2 = 0, a1 = 0, a2 = 0 and b1 = b2 = 0 for example, there is a single steady state, that is (x0 = 0,y0 = 1) while the period of the system is π = 3. By just changing the value of c2 as c2 = 3, the system now presents two steady states that are (x0 = 0,y0 = 1) and (x0 = 0,y0 = 2) and a period π = 20.

3.1.2 Sensitivity of the Lyapunov exponent

We also evaluate the Lyapunov exponents of the above system for each initial condition with the above three parameter settings and compare them to the largest Lyapunov exponent of the corresponding QACM, that is

$$ \lambda_{0}(\alpha^{\prime},\beta^{\prime})=\log\left( 1+\frac{1}{2}\alpha^{\prime}\beta^{\prime}+\frac{1}{2}\sqrt{\alpha^{\prime2}\beta^{\prime2}+4\alpha^{\prime}\beta^{\prime}}\right) $$
(21)

We considered 20 000 iterations of the PWLCM to evaluate the Lyapunov exponents.

For the first parameter setting, Table 2 shows the corresponding largest Lyapunov exponents of the PWLCM that are to be compared to λ0(3,3) = 2.3895. It appears from this table that setting ci≠ 0 and dj≠ 0 contributes to reduce the Lyapunov exponent, while it contributes to increase the period of the system.

Table 2 Matrix of the individual largest Lyapunov exponent of different initial conditions of the PWLCM for n = 2, α = β = 1, M = N = 2, c1 = 0, c2 = 3, d1 = 3, d2 = 5, a1 = 1, a2 = 1, b1 = 0 and b2 = 2; λ0(3,3) = 2.3895

The second parameter setting leads to Table 3, with values that are to be compared to λ0(3,3) = 2.3895. We can confirm that the Lyapunov exponent does not depend on ai and bi in the case ci = dj = 0.

Table 3 Matrix of the individual largest Lyapunov exponent of different initial conditions of the PWLCM for n = 2, α = β = 1, M = N = 2, c1 = c2 = 0, d1 = d2 = 0, a1 = 0, a2 = 1, b1 = b2 = 0; λ0(3,3) = 2.3895

The third parameter setting leads to Table 4, with values that are also to be compared to λ0(3,3) = 2.3895. This table as compared to Table 3 shows that setting ci≠ 0 or dj≠ 0 reduces the value of the Lyapunov exponent, while increasing the period of the PWLCM.

Table 4 Matrix of the individual largest Lyapunov exponent of different initial conditions of the PWLCM for n = 2, α = β = 1, M = N = 2, c1 = 0, c2 = 3, d1 = d2 = 0, a1 = 0, a2 = 1, b1 = b2 = 0; λ0(3,3) = 2.3895

The combination of the observations made from these three tables implies that there is no direct relationship between the Lyapunov exponent and the period of the system. Furthermore, a large Lyapunov exponent in that case does not induce a high complexity of the PWLCM, as it corresponds to the smallest period. However, we observe that the period of the system increases with the diversity or variability of the Lyapunov exponent. Indeed, a high sensitivity of the Lyapunov exponent to the initial conditions contributes to increase the period of the system. Figure 1 shows the behavior of the Lyapunov exponent in the case of n = 4 for the above three parameter settings. In the first case (setting 1), there are 187 distinct values of λ, five distinct period values (T = {1,4,5,8,233}), and the corresponding period of the PWLCM is T1 = 9320; in the second case, a single value of λ and four distinct period values (T = {1,3,6,12}) are obtained, thus leading to T2 = 12; while in the third case (setting 3), there are 63 distinct values of λ and 9 distinct periods (T = {1,2,4,8,10,12,14,18,40}), which corresponds to T3 = 2520. We can observe that in the case of a single Lyapunov exponent, the largest period value is a multiple of the other values, which contributes to reduce the period of the whole system.

Fig. 1
figure 1

Behavior of the Lyapunov exponent λ(z0) with respect to the initial condition z0 = 2nx0 + y0, for n = 4 and ai, bi, ci and di set as in Table 2 (setting 1), Table 3 (setting 2) and Table 4 (setting 3). The corresponding periods are respectively T1 = 9320, T2 = 12 and T3 = 2520.The Lyapunov exponents were evaluated after 1000 iterations of the PWLCM

Such an observation also implies a high sensitivity of the period to the precision n. Indeed, for a parameter setting with a high sensitivity of the Lyapunov exponent to the initial conditions, the diversity of the Lyapunov exponent values increases with n, as the number of initial conditions itself increases. While setting n = 5 for the above parameter settings, the periods become respectively T1 = 1.51 ⋅ 1015, T2 = 24 and T3 = 1.02 ⋅ 1010. As shown in Fig. 2, the values of the largest Lyapunov exponent are within the same range (1.4,2.5), but the number of distinct values has significantly increased, 450 for the first parameter setting (setting 1), and 163 for the third one (setting 3). There is no change for the second parameter setting as the corresponding Jacobian matrix does not depend on the initial conditions.

Fig. 2
figure 2

Behavior of the Lyapunov exponent λ(z0) with respect to the initial condition z0 = 2nx0 + y0, for n = 5 and ai, bi, ci and di set as in Table 2 (setting 1), Table 3 (setting 2) and Table 4 (setting 3). The corresponding periods are respectively T1 = 1.51 ⋅ 1015, T2 = 24 and T3 = 1.02 ⋅ 1010. The Lyapunov exponents were evaluated after 1000 iterations of the PWLCM

3.2 Sensitivity to control parameters a i and b i

For the analysis of the impact of ai and bi, we first set M = N = 1 and n = 3, α = β = 1, c1 = 3, d1 = 5. The corresponding periods are summarized in Table 5 from where we can appreciate the sensitivity of the system to the parameters ai and bj. These periods are to be compared to πA = 6 that is the period of the equivalent QACM.

Table 5 Dependence of the PWLCM period πPWLCM on ai and bi for n = 3, M = N = 1, α = β = 1, c1 = 3, d1 = 5 and different values of (a1,b1)

3.3 Sensitivity on control parameters c i and d i

Table 6 shows the dependence of the PWLCM period on the perturbation parameters c1 and d1, for n = 2, M = N = 1, α = β = 1, a1 = 1 and b1 = 3. It appears from this table that the maximum period is obtained for (c1,d1) = (1,6). This table shows that large periods can be achieved even with a small number of bits (n = 2 for example), which is not possible with the conventional QACM. Indeed, the period depends on the choice of the parameters ai, bi, ci and di.

Table 6 Dependence of the PWLCM πPWLCM period on ci and di for n = 2, \(\alpha ^{\prime }=\beta ^{\prime }=2\), a1 = 1, b1 = 3 and different values of (c1,d1)

The proposed PWLCM is conservative and depending on the parameter setting, it can be linear or nonlinear. As it includes all the properties of the QACM, it can be seen as a generalized form of the QACM that can exhibit large periods. The worst parameter setting of the PWLCM corresponds to a QACM. For the PWLCM to generate dynamics with large periods, its Jacobian matrix should depend on the initial conditions. We suggest a particular parameter setting depending on the parity of n that generates large periods such that:

$$ c_{i}(\mathrm{resp.} d_{i})=\left\{ \begin{array}{ll} n+2, & \text{if } n=2p+1; \\ 2^{n+1}-(n+1), & \text{if } n=2p. \end{array}, p\in\mathbb{N}_{\geq 1}, \right. $$
(22)

and

$$ a_{i}(\mathrm{resp.} b_{i})=\left\{ \begin{array}{ll} p, & \text{if } n=2p+1; \\ 2^{n+1}-(2^{n}+1), & \text{if } n=2p. \end{array}, p\in\mathbb{N}_{\geq 1}. \right. $$
(23)

We verified that the case ci = 0 or di = 0 corresponds to the forced QACM in which the steady state (0,0) is modified and depends on ai and bi and the case ci = 1 or di = 1 corresponds to the conventional QACM. The period of the system is large when only one dimension is perturbed with di = 1 and ci as in (22), or ci = 1 and di as in (22). In such a case, the Lyapunov exponent of the PWLCM is sensitive to the initial condition as it is the case for many chaotic systems. It can therefore generate rich and complex dynamics. An example periodic image shuffling using both 8-bit QACM and 8-bit PWLCM is shown in Fig. 3. The period of the QACM in that case is 192, while that of the PWLCM, with a1 = 0, a2 = 0, c1 = 0, c2 = 11 and d1 = d2 = 1, is 4.28 × 10114. Applying the reverse system to the shuffled image with the same number of iterations allows to obtain the original image without needs of running the shuffling process on the whole period of the system.

Fig. 3
figure 3

Image shuffling using the QACM and PWLCM Transformation. The first line shows the results of the QACM, the second line depicts the PWLCM results, while the third line shows the reverse image obtained from the reverse PWLCM

In order to compare the mixing property of the PWLCM and QACM, we applied the NIST800-22 statistical test to a periodic 213 × 213 image shuffled with both systems. The periodic image is obtained by repeating sequences of 8-bit encoded integers ranged from 0 to 255. Such a data set can be divided into 50 bitstreams of 106 length each. The NIST test was applied to the shuffled images, after 50 iterations. The PWLCM parameters were set as a1 = 0, a2 = 0, c1 = 0, c2 = 11 and d1 = d2 = 1, and the number of bits was n = 13 for both systems. The corresponding results are shown in Table 7, from where it appears that the PWLCM shuffled image is passing NIST test, whereas the QACM image is failing. The PWLCM thus better mixes the pixels of the image than the QACM, hence is suitable for image shuffling.

Table 7 NIST 800-22 test results:

4 Hardware implementation

In this section, we propose 2-dimensional (2D) electronic implementations of the conventional QACM and the proposed PWLCM. The implementation circuit includes exclusively basic electronic logic circuits such as adders, multiplexers, D-type flip-flops, and basic logic gates (AND, NOR, NAND, NOT, …). We propose a hardware architecture which is simulated on both Multisim and Vivado HLx, and implemented on a Zynq 7020 FPGA board to confirm the effectiveness of the proposed architecture. The Multisim synthesis allows to optimize the FPGA architecture.

4.1 Multisim architecture

We first designed the circuit corresponding to the conventional 2-dimensional (2D) QACM with α = β = 1. For such a circuit, we considered two stages, the one computing x(t + 1) and the one computing y(t + 1). Given that y(t + 1) depends on x(t + 1), we considered a delay time of half the clock period to sequentially determine x(t + 1), then y(t + 1). The corresponding electronic architecture is shown in Fig. 4.

Fig. 4
figure 4

Circuit of the conventional 2D QACM for α = β = 1, n = 4. Values are displayed in hexadecimal representation

Components U1 and U4 are multiplexers (74157N) that are used to set initial conditions x0 and y0, respectively. The SET input allows to load initial conditions when SET = 1. Once initial conditions have been set, the circuit starts oscillating (SET = 0), that is computing x(t + 1) on the leading edge of the clock pulse and y(t + 1) on the trailing edge of the clock signal. U3 and U6 are D-type flip-flops (74ALS273) that allow the circuit to sequentially change the output value as a clock pulse occurs (time increment). U2 and U5 are 4-bit adders (74283N) that are used to implement (1).

Now considering the perturbation term, we propose the schematic of the PWLCM whose equation is

$$ \left\{ \begin{array}{ll} x(t+1)=x(t)+y(t)+\Big(a_{1}+y(t)\Big)\mod c_{1}+\Big(a_{2}+y(t)\Big)\mod c_{2}\\ y(t+1)= x(t+1)+y(t) \end{array}\mod 2^{n}. \right. $$
(24)

The circuit in Fig. 5 implements such a system for \(\alpha ^{\prime }=3\), \(\beta ^{\prime }=1\), c1 = 0, c2 = 11, a1 = a2 = 0 and, n = 4. The circuit implementing modulo 11 is shown in Fig. 6. The period of the above PWLCM is T = 4.8135 × 1012, while that of the corresponding QACM is only T = 12. The period gain for this example is therefore γ = 411. We simulated this circuit using MULTISIM software as well as PROTEUS/ISIS software and verified that the dynamics of the electronic system perfectly matches with the MATLAB simulation. Based on the low complexity of the electronic circuit and the period gain brought by the insertion of the nonlinear term into the QACM, we concluded that the proposed system can be efficiently included in a pseudo-random number generator.

Fig. 5
figure 5

Electronic implementation of 4-bit PWLCM with \(\alpha ^{\prime }=3\), \(\beta ^{\prime } =1\), c1 = 0, c2 = 11 and, a1 = a2 = 0. Values are displayed in hexadecimal representation

Fig. 6
figure 6

Electronic implementation of modulo 11 (Modulo_11 module), 4-bit precision

We analyzed its period for 2 ≤ n ≤ 10 and compared it with that of the corresponding QACM. The overall results obtained are summarized in Table 8, from where we can confirm the efficiency of the nonlinear element for increasing the QACM period, thus giving an exponential growth of the period with respect to the precision n. Cases n = 2 and n = 3 correspond to the QACM with α = 3 and β = 1, as c2 > 2n, while the periods of the cases 4 ≤ n ≤ 10 are evaluated using the Maple software to avoid calculation errors in Matlab. An example of distribution of the orbit periods T(x0,y0) with respect to the initial condition (x0,y0) for the case n = 8 is shown in Fig. 7. One can observe that there are some initial conditions for which the period is greater than the upper limit of the orbit periods of the QACM, that is π = 2n. Figure 8 shows the probability distribution of T(x0,y0) for n = 6, 7 and 8. It appears from this figure that the frequency or probability increases with the period: the highest probability corresponds to the largest period T(x0,y0). Such a result is interesting as our goal is to obtain large periods for all the nontrivial points of the PWLCM.

Table 8 Dependence of the period π on the precision n
Fig. 7
figure 7

Distribution of the PWLCM orbit period T(x0,y0) with respect to the initial condition (x0,y0), case of n = 8. The other parameters are set as \(\alpha ^{\prime }=3\), \(\beta ^{\prime }=1\), c1 = 0, c2 = 11 and a1 = a2 = 0

Fig. 8
figure 8

Probability distribution of T(x0,y0) of the PWLCM for n = 6, n = 7 and, n = 8; with \(\alpha ^{\prime }=3\), \(\beta ^{\prime }=1\), c1 = 0, c2 = 11 and a1 = a2 = 0

4.2 FPGA implementation

In order to confirm the effectiveness of the above architecture simulated with the Multisim software, we used Vivado and implemented the system on Zynq 7020 FPGA board. The schematic of the implemented system is shown in Fig. 9, with \(\alpha ^{\prime }=3\), \(\beta ^{\prime } =1\), c1 = 0, c2 = 11, a1 = a2 = 0 and, n = 4. The resource utilisation as well as the throughput of the proposed architecture are given in Table 9. From this table we observe that the implementation of the PWLCM does not require any DSP module, but exclusively basic modules such as look-up tables (LUT) and flip-flops (FF). We verified that the outputs of the FPGA and Multisim architectures perfectly match, thus confirming the effectiveness of the proposed architectures of the QACM and the PWLCM. For 4-bit precision, the FPGA implementation performs 1.072 Gbps throughput at 134 MHz maximum frequency. Such a high throughput shows that the proposed system can be easily combined with other basic gates such XOR gates or linear feedback shift registers (LSFR) for a real-time generation of pseudo-random numbers.

Fig. 9
figure 9

Generalized FPGA implementation of n-bit PWLCM. The “LOAD” command allows to set x0 and y0 as initial conditions in the 2n-bit register; “RESET” allows to clear the 2n-bit register; and the “SET” command allows to load the initial conditions to n-bit registers FF1 and FF2, therefore to start the system

Table 9 Hardware resource utilization of the 4-bit PWLCM architecture

5 Conclusion

We presented in this paper the PWLCM obtained from a QACM that is nonlinearly perturbed. Depending on the parameter setting, the PWLCM exhibits large periods as compared to the equivalent QACM. The increase of the period enhance the complexity of the PWLCM, thereby is more suitable for image shuffling than the QACM. We evaluated the dependence of the period of the proposed system on the control parameters involved by the perturbing nonlinear term and observed that the worst parameter setting corresponds to a QACM. The PWLCM thus appears to be a generalized form of the QACM in which the sensitivity to the initial conditions has been improved for generating rich and complex dynamics. We showed that the Lyapunov exponent of the PWLCM is sensitive to the initial condition as it is the case for many chaotic systems, which justifies the large periods obtained. We noticed that the period of the PWLCM does not depend on the value of the largest Lyapunov exponent, but on its variability: a large Lyapunov exponent does not imply a large period, but a constant Lyapunov exponent implies a weak period. We also proposed an electronic implementation of both the QACM and the PWLCM. The two circuits are nearly identical, whatever confirms that introducing the perturbation term does not significantly modify the complexity of the QACM, despite the high period gain obtained. The effectiveness of the proposed architecture was confirmed by implementing the system on a Zynq 7020 FPGA board. Both the resource utilisation and the throughput of 1.072 Gbps at a maximum frequency of 134 MHz attest that the PWLCM can be easily combined with other basic gates to design a complete PRNG. The analysis of the model electronically implemented shows that the period exponentially increases with the precision n. In prospect, we intend to apply the PWLCM to data encryption in order to take advantage of its large periods, and to investigate its dynamics in the continuous phase space.