Introduction

As the information technology landscape evolves rapidly, the memristor, a novel resistive device, has emerged as a promising candidate for a wide range of applications, including non-volatile memory, neural networks, and brain-like computing1. Its unique nonlinear characteristics and memory effect position it as an ideal platform for investigating complex dynamic systems2,3,4,5. In 1976, Chua and Kang pioneeringly employed the theoretical framework of the ideal memristor model to a comprehensive class of generalized memristor-based dynamic systems, thereby expanding the horizons of their application6. Zhang subsequently designed an innovative 5D memristive hyperchaotic oscillator with tunable amplitude control, exhibiting remarkable homogeneous multistability and an uncountable array of attractors, which underscores its rich dynamical complexity7. Additionally, Chithra constructed a memristor diode bridge-based MLC circuit that demonstrates coexisting attractors and double-transient chaos, further highlighting the versatility of memristor-based systems8.

In the realm of engineering applications that leverage chaos, the enhancement of distortion and the control of chaos amplitude are of paramount importance. Zhang innovatively designed a straightforward 4D chaotic oscillator equipped with multiple control modes and a comprehensive global amplitude controller and further verified the novel characteristics of this oscillator through the development of a compact chaotic circuit9. In the same year, Zhang’s team contributed an autonomous hyperchaotic system featuring multi-dimensional offset boosting enhancement, capable of achieving both single and synchronous reverse control, further broadening the horizon of chaotic systems10. Additionally, memristors have found applications in conservative chaotic systems, exhibiting remarkable amplitude control and offset enhancement properties11. Memristive chaotic systems, characterized by their intricate dynamical behaviors, significantly enrich the system’s capacity for multistability and complexity, thereby expanding the scope of potential applications and analysis12.

Frequently, scholars discuss coupling memristors into neurons and neural networks to enhance the density and robustness of neural networks. Zhang introduced a novel memristor-synaptic coupled ring neural network (MSCRNN), delving into its intricate dynamical behaviors and subsequently developing a pseudorandom number generator that leverages the network’s unique randomness13. Yu constructed an innovative segmented quadric memristor chaotic neural network model featuring multiple vortices, ensuring a superior encryption effect, marking a significant advancement in the field14. Furthermore, He proposed a charge-controlled discrete fractional memristor model, which is well-suited for neural network applications15.

The jerk chaotic system, as a nonlinear dynamical system, exhibits unique characteristics and intricate complexity, making it a subject of considerable interest16. However, it is not without its limitations, such as narrow chaotic intervals, chaotic degradation, relatively low complexity, and limited dynamical behavior richness, which require careful consideration17,18,19,20. Some researchers have introduced a memristor into the jerk chaotic system to enhance its chaotic characteristics21,22,23. However, due to the simple algebraic structure of the jerk system, the introduction of a single memristor does not significantly enhance its chaotic properties. Issues such as poor uniformity of the chaotic sequences and high autocorrelation persist. Researchers have coupled two memristors into a chaotic circuit, thereby enhancing the chaotic characteristics of the system and increasing its complexity24,25,26. This innovative approach enhances the overall dynamism and intricacy of the chaotic system. Based on this, the integration of two memristors into the jerk chaotic system is considered to enhance its chaotic characteristics. Therefore, we propose a method for coupling two memristors within the jerk chaotic system and constructing a 4D dual-memristor chaotic system (4D-DMCS). This approach not only preserves key fundamental attributes of the original jerk chaotic system but also significantly enhances its dynamical behaviors and elevates the complexity of the system through the incorporation of dual memristors. The primary features of this innovation are outlined below:

  1. (1)

    A method for coupling two memristors into a jerk chaotic system is proposed, and a 4D dual-memristor chaotic system is constructed.

  2. (2)

    Exhibiting offset boosting behavior along the x-axis direction. Three types of coexisting attractors including chaotic, quasi-periodic, and periodic coexisting attractors are investigated.

  3. (3)

    Transient behaviors of the 4D-DMCS have been found. Its high spectral entropy (SE) and C0 complexity reveal its advantages in secure communication and encryption.

  4. (4)

    Various tests have demonstrated that 4D-DMCS exhibits exceptional advantages in the field of image encryption.

The rest of the paper is organized as follows: a new jerk chaotic system and base properties are analyzed in “A new jerk chaotic system”. In “A novel chaotic system with dual memristors”, a method for introducing two memristors into the jerk chaotic system is proposed. As examples, two different types of memristor models are designed and introduced into the jerk system. The dynamical behaviors of the system, including equilibrium points, Lyapunov Exponent (LE) spectrum, bifurcation diagrams,  offset boosting, multistability, and transients, are analyzed. The SE and C0 complexity of the 4D-DMDSC are analyzed and compared in “Complexity analysis”. The 4D-DMDSC is implemented in the STM32 platform in “Implementation of the 4D-DMCS”. Section “Application in image encryption” introduces the application of the 4D-DMSC in image encryption. The conclusion is in the final section.

A new jerk chaotic system

Following the definition of the jerk chaotic system, a nonlinear term is incorporated into the function f(x, y, z), leading to the formulation of a novel jerk chaotic system as depicted in Eq. (1) below.

To analyze the dynamics of the new systems. All simulations in this paper were conducted using MATLAB 2021b for numerical simulations. The ode45 solver was selected for solving the equations, with an integration step size set to 0.01 and a total simulation time of t = 10,000 s.

$$\left\{ {\begin{array}{*{20}l} {\dot{x} = y} \hfill \\ {\dot{y} = z} \hfill \\ {\dot{z} = - ax + by^{2} - y - cz} \hfill \\ \end{array} } \right.$$
(1)

In this system, a, b, and c are system parameters, where a ≠ 0 and c ≠ 0. With initial condition (IC) and parameters set to IC = (0.1, 0.1, 0.1), a = 4.2, c = 2, and b = 1, the Lyapunov exponents (LEs) were calculated using the Wolf algorithm with the ode45 solver in Matlab 2021b, over a simulation time of t = 5000 s27,28. The resulting three LEs are LE1 = 0.10929 (+), LE2 = 0.000010842 (≈ 0), and LE3 = − 2.1093 (−), as shown in Fig. 1a. By rearranging the LEi (i = 1, 2, 3) in descending order \(\sum_{i=1}^{j}{LE}_{j}\ge 0\) and \(\sum_{i=1}^{j+1}{LE}_{j}<0\) finding the largest integer j that satisfies certain conditions, we can compute the Kaplan–Yorke dimension (DKY) to describe the dynamic behavior of the nonlinear system29. The specific calculation formula is given by Eq. (2).

$$D_{KY} = j + \frac{{\sum\nolimits_{i = 1}^{j} {LE_{i} } }}{{\left| {LE_{j + 1} } \right|}} = 2 + \frac{{\sum\nolimits_{i = 1}^{2} {LE_{i} } }}{{\left| {LE_{3} } \right|}} \approx 2.052$$
(2)
Fig. 1
figure 1

The Lyapunov exponents and Poincare map corresponding to a = 4.2, b = 1, c = 2, and IC = (0.1, 0.1, 0.1). (a) Lyapunov exponents. (b) Poincare map when z = 0.1.

The DKY is approximately 2.052, indicating a fractional dimension, which proves that the system is chaotic under this combination of parameters and IC. To further verify that the system is in a chaotic state under these parameters, a Poincaré section with z = 0.1 is chosen to map the phase space trajectory of the system. The resulting Poincaré section, as shown in Fig. 1b, consists of densely packed points with hierarchical patterns30.

The dissipativity of the system can be calculated by Eq. (3). When c > 0, the system is dissipative, and as t → ∞, each volume element of the system trajectory shrinks to 0 at a rate of e-c, gradually stabilizing onto a fixed attractor31.

$$\nabla V = \frac{{\partial \dot{x}}}{x} + \frac{{\partial \dot{y}}}{y} + \frac{{\partial \dot{z}}}{z} = - c$$
(3)

After calculation, it is found that the chaotic system has only one equilibrium point P(0, 0, 0). The Jacobian matrix obtained after linearizing the system at the equilibrium point P is given as Eq. (4).

$$J_{P} = \left[ {\begin{array}{*{20}c} 0 & 1 & 0 \\ 0 & 0 & 1 \\ { - a} & { - 1} & { - c} \\ \end{array} } \right]$$
(4)

Hence, its characteristic equation can be obtained.

$${\mathbf{Det}}\left( {{\varvec{E}}\lambda - {\varvec{J}}_{p} } \right) = \lambda^{3} + c\lambda^{2} + \lambda + a{\kern 1pt} = {\kern 1pt} {\kern 1pt} {\kern 1pt} 0$$
(5)

According to the Routh–Hurwitz criterion, Eq. (6) can be obtained32.

$$\left\{ {\begin{array}{*{20}l} {c > 0} \hfill \\ {a > 0} \hfill \\ {c - a > 0} \hfill \\ \end{array} } \right.$$
(6)

According to the criterion, P is stable if all the conditions in Eq. (6) are satisfied at the same time, otherwise, P is unstable. When parameters a = 4.2, c = 2, and b = 1 are selected, c − a = − 2.2 < 0 does not satisfy the third article in Eq. (6). The characteristic equation is solved to obtain a negative real root and a pair of positive conjugate complex roots. λ1 = − 2.3398, λ2 = 0.16990 + 1.3290i, λ3 = 0.16990–1.3290i. It shows that the equilibrium point P of the system is an unstable index two of the saddle focus33.

Parametric dependent dynamic analysis

The dynamic characteristics of the system are analyzed by drawing the LE spectrum and bifurcation diagram within a certain range of parameters a and c. The Poincaré cross-section method was used as the bifurcation diagram algorithm34. This method involves selecting a specific cross-section in the system’s phase space, such as planes or surfaces, to capture the intersection trajectories of the system at different time points, thereby constructing a bifurcation diagram as the system parameters change.

With the cross-section z = 0.1, parameters b = 1, c = 2, and IC = (0.1, 0.1, 0.1), the LE spectrum and bifurcation diagram of a in the interval [3, 4.6] are shown in Fig. 2a. Within this interval, as a increases, the system undergoes period-doubling bifurcations and enters a chaotic state, with the volume of the attractor also increasing. After entering chaos, periodic windows appear within the intervals [4.05, 4.07], [4.44, 4.46], and [4.535, 4.55]. By selecting a = 3.2, 4.2, and 4.54, periodic attractors, chaotic attractors, and quasi-periodic attractors are obtained as shown in Fig. 2b–d.

Fig. 2
figure 2

Dynamics in respect to parameter a in the interval [3, 4.6] with parameters b = 1, c = 2, and initial condition IC = (0.1, 0.1, 0.1). (a) LE spectrum and bifurcation diagram. (b) The periodic attractor when a = 3.2. (c) The chaotic attractor when a = 4.2. (d) The quasi-periodic attractor when a = 4.54.

Amplitude control

The amplitude controllability of the attractor implies that upon scaling certain variables and associated terms within the equations of a chaotic system, the morphology of the attractor remains invariant, while the attractor undergoes scaling transformations in specific directions35.

To explore the amplitude controllability of the newly proposed jerk system, the following transformation is made to the state variables of the system: x = mu, y = mv, z = mw (m > 0), which leads to the new system equations as shown in Eq. (7). In these equations, only the coefficient of the v2 term contains m. That is, the change in the value of b (b → b/m) can control the amplitude changes of the three state variables x, y, and z, while the shape of the corresponding attractor of the system remains unchanged. In this case, b serves as a non-bifurcation parameter and functions as a global amplitude control parameter.

$$\left\{ {\begin{array}{*{20}l} {\dot{u} = v} \hfill \\ {\dot{v} = w} \hfill \\ {\dot{w} = - au + bmv^{2} - v - cw} \hfill \\ \end{array} } \right.$$
(7)

In system (1), the parameter b assumes the role of a global amplitude control parameter. Variations in b exclusively influence the amplitude of the state signals, leaving the frequency components of these signals unaltered. Figure 3a–c demonstrates the time-domain waveforms of the state variables x, y, and z when a = 2, c = 2, and the initial conditions IC = (0.1, 0.1, 0.1), with b taking values of 0.5, 1, and 2. These figures prove that the amplitude of each state variable changes while the frequency remains constant. Figure 3d shows that as b increases within the range [0.01, 2], the mean absolute values of the corresponding state variables decrease with a trend of 1/b. The LE spectrum and bifurcation diagram in Fig. 3e reveal that as parameter b increases, the LE values remain unchanged, but the bifurcation diagrams for each state variable reflect a decrease in the volume of the attractor. Figure 3f depicts the attractors in three-dimensional space for selected values of b = 0.5, b = 1, and b = 2.

Fig. 3
figure 3

Influence of amplitude modulation parameter b when parameter a = 2, c = 2, and initial condition IC = (0.1, 0.1, 0.1). (a) Time domain waveform of x. (b) Time domain waveform of y. (c) Time domain waveform corresponding to z. (d) The mean of the absolute values of the three state variables. (e) Lyapunov exponential spectrum and bifurcation diagram of b in the interval [0.01, 2]; (f) an attractor in 3-dimensional phase space when b = 0.5, b = 1, b = 2.

Offset boosting

Offset boosting control is a technique used to adjust or manipulate the offset characteristics of chaotic signals. Offset boosting control plays a crucial role in the research and applications of chaotic systems, enabling synchronization and demodulation in chaotic communication, key generation and management in chaotic encryption, and frequency adjustment in chaotic oscillators36,37,38. By meticulously manipulating the characteristic of offset boosting in chaotic signals, substantial enhancements can be achieved in the controllability, stability, and overall performance of the system, thereby optimizing its operational capabilities.

Since the state variable x in system (1) appears only once as a linear term in the third dimension, it is inferred that the system possesses controllable offset boosting characteristics in the x-axis direction39. To specifically investigate the offset boosting of this system, a parameter k is introduced to the x variable, resulting in a new differential equation as shown in Eq. (8).

$$\left\{ {\begin{array}{*{20}l} {\dot{x} = y} \hfill \\ {\dot{y} = z} \hfill \\ {\dot{z} = - a(x + k) + by^{2} - y - cz} \hfill \\ \end{array} } \right.$$
(8)

With fixed parameters a = 4.2, b = 1, c = 2, and IC = (0.1 − k, 0.1, 0.1), the time-domain waveforms for typical values of k = − 10, k = − 5, k = 0, k = 5, and k = 10 are shown in Fig. 4a. When x takes different values, the time-domain waveform shifts in the direction of the x-axis. Figure 4b shows the attractors of k in the xy plane for each of the five values. It can be observed that the variation of k leads to a shift in the attractor along the x-axis. The LE spectrum and bifurcation diagram within the range of k [− 10, 10] are plotted in Fig. 4c. The values of the LEs remain unaffected by the change in k and the bifurcation diagram corresponding to the x state variable shifts linearly with the change of k. Figure 4d shows the mean values of each state variable as k increases. The state variable x exhibits a linear change, while the mean values of y and z remain unaffected by the change in k.

Fig. 4
figure 4

Parameters a = 4.2, b = 1, c = 2, IC = (0.1 − k, 0.1, 0.1), offset boosting in the x axis. (a) Time domain waveform when k takes typical values. (b) Attractors on the x–y plane when k takes typical values; (c) LE spectrum (top) and bifurcation diagram (bottom) in the range of k [− 10, 10]. (d) The mean values of each state over the interval k [− 10, 10].

A novel chaotic system with dual memristors

The newly established jerk chaotic system, though endowed with amplitude and offset boosting controllability, suffers from limited complexity, hindering its efficacy in pseudorandom number generation. Introducing memristors, leveraging their non-volatility and nonlinearity, can enhance the system’s correlation characteristics, addressing the issue of low complexity. In this section, we introduce a novel enhancement strategy by coupling multiple memristors into a chaotic system, thereby augmenting its performance significantly. This multi-memristor coupling methodology not only elevates the system’s dimensionality but also enriches its complexity and dynamical behavior, leading to more intricate and robust chaotic dynamics.

When a memristor is introduced in jerk chaotic systems, the dimension of the system does not change because the second term of the system equation is the input of the memristor when coupling the first memristor, as shown in Eq. (9).

$$\left\{ {\begin{array}{*{20}l} {\dot{x}_{1} = x_{2} + MEM_{1} (x_{2} )x_{3} } \hfill \\ {\dot{x}_{2} = x_{3} } \hfill \\ {\dot{x}_{3} = f(x_{1} ,x_{2} ,x_{3} )} \hfill \\ \end{array} } \right.$$
(9)

As additional memristors are introduced, the increase in state variables leads to an increase in the dimensionality of the system40. In Eq. (9), the memristor is further introduced, and then the memristor is introduced into the third term of the equation, the equation of the 4D chaotic system can be obtained, as shown in Eq. (10).

$$\left\{ {\begin{array}{*{20}l} {\dot{x}_{1} = x_{2} + MEM_{1} (x_{2} )x_{3} } \hfill \\ {\dot{x}_{2} = x_{3} } \hfill \\ {\dot{x}_{3} = f(x_{1} ,x_{2} ,x_{3} ) + MEM_{2} (x_{4} )v} \hfill \\ {\dot{x}_{4} = g(v)} \hfill \\ \end{array} } \right.$$
(10)

where v represents xn (n = 1, 2, 3). By analogy, we can derive a method to couple multiple memristors in higher-dimensional chaotic systems41.

In this paper, two new memristor models are created and introduced into a newly built jerk system to construct a new 4D dual-memristor coupled continuous chaotic system with more dynamic behavior and higher complexity.

Modeling of memristors

Based on the definition of the ideal memristor model42, this article selects a classic smooth quadratic flux-controlled memristor model W1, whose expression is given as Eq. (11).

$$\left\{ {\begin{array}{*{20}l} {W_{1} (\varphi_{1} ) = \alpha_{1} + \beta_{1} \varphi_{1}^{2} } \hfill \\ {i(t) = W_{1} (\varphi_{1} )V(t)} \hfill \\ {\dot{\varphi }_{1} = \varepsilon_{1} v_{1} } \hfill \\ \end{array} } \right.$$
(11)

Due to the nonlinearity and symmetry of the absolute value function, this article also designs an ideal memristor W2 that contains an absolute value term. The specific model is shown in Eq. (12).

$$\left\{ {\begin{array}{*{20}l} {W_{2} (\varphi_{2} ) = - \alpha_{2} + \beta_{2} \left| {\varphi_{2} } \right|} \hfill \\ {i(t) = W_{2} (\varphi_{2} )V(t)} \hfill \\ {\dot{\varphi }_{2} = \varepsilon_{2} v_{2} } \hfill \\ \end{array} } \right.$$
(12)

In Eqs. (11) and (12), W1 and W2 are the memductance, while α1, β1, α2, and β2 are the parameters of the two memristors. By choosing α1 = 0.1, β1 = 0.01, α2 = 0.1, and β2 = 1, a sinusoidal excitation with an amplitude of ± 2V is applied to the input terminal of the memristors. By varying the frequency of the excitation signal, hysteresis loops at different frequencies can be obtained, as shown in Fig. 5. As the frequency increases, the side lobe area of the hysteresis loop gradually decreases and approaches a straight line, indicating that the designed memristor model satisfies the characteristics of an ideal memristor43.

Fig. 5
figure 5

The hysteresis loops of the memristor W1 and W2 at different frequencies (f = 200 Hz, f = 400 Hz, f = 800 Hz) when the parameters are α1 = 0.1, β1 = 0.01, α2 = 0.1, β2 = 1, respectively. (a) Hysteresis loops of W1. (b) Hysteresis loops of W2.

Dual memristors coupling

Based on the previously described method of coupling multiple memristors in a continuous chaotic system, we first introduce W1 into the system described in Eq. (1) to obtain a new three-dimensional Eq. (13).

$$\left\{ {\begin{array}{*{20}l} {\dot{x} = y + m_{1} W_{1} (y)z} \hfill \\ {\dot{y} = c_{1} z} \hfill \\ {\dot{z} = - ax + by_{2} - y - cz} \hfill \\ \end{array} } \right.$$
(13)

Then, by further coupling the memristor W2 into Eq. (13), a novel 4D dual-memristors chaotic system (4D-DMCS) is constructed as shown in Eq. (14).

$$\left\{ {\begin{array}{*{20}l} {\dot{x} = y + m_{1} W_{1} (y)z} \hfill \\ {\dot{y} = c_{1} z} \hfill \\ {\dot{z} = - ax + by^{2} - m_{2} W_{2} (w)y - cz} \hfill \\ {\dot{w} = c_{2} y} \hfill \\ \end{array} } \right.$$
(14)

In the equation, W1(y) and W2(w) represent the memristance of two memristors, where when W1(y) is introduced, y is a function of the independent variable z and also the input signal for memristor W1. The system incorporates novel parameters, c1, c2, m1, and m2. Specifically, c1 and c2 are memristor parameters, which are fixed as c1 = c2 = 1 in this article. m1 and m2 represent the coupling strengths of the two memristors, which can be used to control the dynamic characteristics of the 4D-DMCS.

When the parameters are chosen as a = 1.8, b = 0.8, c = 1, m1 = m2 = 0.8, and IC = (0.1, 0.1, 0.1, 0), the Wolf algorithm is again used to solve the Eq. (14) with ode45 in Matlab2021b, and the chaotic attractor formed by the trajectories in the x–y, x–z, x–w, y–z, y–w, and z–w planes are plotted, as shown in Fig. 6.

Fig. 6
figure 6

When the parameters are set as a = 1.8, b = 0.8, c = 1, m1 = m2 = 0.8, and initial condition IC = (0.1, 0.1, 0.1, 0), the phase trajectory diagram of the new 4-dimensional chaotic system in each plane is obtained. (a) x–y. (b) x–z. (c) x–w; (d) y–w. (e) y–z. (f) z–w.

Given the parameters, a = 1.8, b = 0.8, c = 1, m1 = m2 = 0.8, and IC = (0.1, 0.1, 0.1, 0), the time-domain waveform of each state variable is depicted in Fig. 7a, which shows irregular non-periodic signals. The LEs are calculated using the Wolf algorithm with a simulation time set to t = 5000 s, as shown in Fig. 7b. The results are LE1 = 0.11869(+), LE2 = 0.000094829(≈ 0), LE3 = − 0.0018454(−), LE4 = − 1.1178(−). Since there is one positive LE, and the sum of all four LEs is negative, it indicates that the 4D-DMCS is in a chaotic state. A Poincaré section map was created for the 4D-DMCS using the cross-section z = − 0.1, as shown in Fig. 7c. This Poincaré section map consists of dense points with a layered structure, further confirming that the system is in a chaotic state under this combination of parameters and IC44. Figure 7d presents the 0–1 test result for this system, which exhibits irregular Brownian motion, further proving that the 4D-DMCS is in a chaotic state.

Fig. 7
figure 7

The dynamic behavior analysis of the system when parameters a = 1.8, b = 0.8, c = 1, m1 = m2 = 0.8, and IC = (0.1, 0.1, 0.1, 0). (a) time domain waveform diagram. (b) Lyapunov index value. (c) Poincare map diagram when section z = − 0.1. (d) 0–1 test.

Based on the four obtained LE values, they are rearranged in ascending order. To find the largest integer j that satisfies the \(\sum_{i=1}^{j}{LE}_{j}\ge 0\)\(\sum_{i=1}^{j+1}{LE}_{j}<0\), we calculate the DKY as DKY = j + \(\frac{{LE_{1} + LE_{2} + LE_{3} }}{{|LE_{4} |}} = 3.225\). This serves as evidence that the 4D-DMCS is indeed in a chaotic state.

Equilibrium point and stability analysis

Respectively order \(\dot{x}=0\), \(\dot{y}=0\), \(\dot{z}=0\), and \(\dot{w}=0\) get the Eq. (15) for calculating the equilibrium point.

$$\left\{ {\begin{array}{*{20}l} {y + m_{1} W_{1} (y)z = 0} \hfill \\ {c_{1} z = 0} \hfill \\ { - ax + by^{2} - m_{2} W_{2} (w)y - cz = 0} \hfill \\ {c_{2} y = 0} \hfill \\ \end{array} } \right.$$
(15)

Based on the calculation from Eq. (15), the equilibrium point of the system is P = (0, 0, 0, w0), where w0 is the initial value of the memristor W2, indicating that any point on the w-axis is an equilibrium point of the system (infinite number of line equilibrium points). The Jacobian matrix after linearization at point P can be expressed as Eq. (16)45.

$$J_{p} = \left[ {\begin{array}{*{20}l} 0 \hfill & {2m_{1} \beta_{1} y + 1} \hfill & {m_{1} (\alpha_{1} + \beta_{1} y^{2} )} \hfill & 0 \hfill \\ 0 \hfill & 0 \hfill & { - c_{1} } \hfill & 0 \hfill \\ { - a} \hfill & {2by - m_{2} (\beta_{2} |w| - \alpha_{2} )} \hfill & { - c} \hfill & { - m_{2} \beta_{2} ysign(w)} \hfill \\ 0 \hfill & {c_{2} } \hfill & 0 \hfill & 0 \hfill \\ \end{array} } \right]$$
(16)

With the parameters α1 = 0.1, β1 = 0.01, α2 = 0.1, β2 = 1, and c1 = c2 substituted into Eq. (16), we obtain the matrix Eq. (17).

$$J_{P} = \left[ {\begin{array}{*{20}l} 0 \hfill & {0.02m_{1} y + 1} \hfill & {m_{1} (0.1 + 0.01y^{2} )} \hfill & 0 \hfill \\ 0 \hfill & 0 \hfill & { - 1} \hfill & 0 \hfill \\ { - a} \hfill & {2by - m_{2} (|w| - 0.1)} \hfill & { - c} \hfill & { - m_{2} ysign(w)} \hfill \\ 0 \hfill & 1 \hfill & 0 \hfill & 0 \hfill \\ \end{array} } \right]$$
(17)

Therefore, its characteristic equation is Eq. (18)46.

$$P(\lambda ) = \lambda^{3} (\lambda + c)$$
(18)

λ₁ = λ₂ = λ₃ = 0, λ₄ = − c. The given characteristic equation comprises three zero eigenvalues and a unique non-zero real eigenvalue, implying that the 4D-DMCS encompasses at least three linearly independent equilibrium modes. This finding could be interpreted as the manifestation of multiple equilibrium points or a multitude of equilibrium solutions within the 4D-DMCS. Notably, the existence of a non-zero real eigenvalue, denoted as − c, hints at the presence of at least one mode within the 4D-DMCS that exhibits exponential behavior, either growing or decaying over time. The stability of the system is intimately tied to the sign of this non-zero real eigenvalue. Specifically, if − c is negative, it signifies that the 4D-DMCS is stable within that particular mode. Conversely, even if the system possesses three zero eigenvalues, the stability is primarily dictated by the non-zero real eigenvalues. Therefore, if the non-zero real eigenvalue − c is positive, it indicates that the 4D-DMCS becomes unstable in that specific mode.

Dynamics dependent on parameters

To investigate the influence of parameters on the dynamics of the system, LE spectrum, and bifurcation diagrams were plotted for various parameter dependencies of the 4D-DMCS.

In Fig. 8a,b, the 2D maximum LE distribution plots reveal that the interplay among parameters a, b, and c results in the exhibition of diverse dynamical behaviors. Specifically, the dark blue regions within these plots signify areas where the maximum LE is less than 0, whereas the red regions denote areas characterized by higher maximum LE values, indicating a higher degree of chaos. Figure 8c–e exhibits the LE spectra and bifurcation diagrams for various parameter configurations. The dynamical evolution of the system transitions into chaos via a series of period-doubling bifurcations. The system demonstrates high sensitivity to the parameter c, which, within the interval of [0, 1.5], undergoes numerous periodic and chaotic windows.

Fig. 8
figure 8

Dynamic behaviors corresponding to parameters a, b, and c. (a) The 2D maximum LE distribution for a [0, 3.5] and b [0, 1.8]. (b) The 2D maximum LE distribution for b [0, 3.5] and c [0, 1.8]. (c) LE spectrum and bifurcation diagram for a [0, 3.5]. (d) LE spectrum and bifurcation diagram for b [0, 1.8]. (e) LE spectrum and bifurcation diagram for c [0, 1.5].

As shown in Fig. 8a, when the parameters are set as a = 1.5, b = 0.5, m1 = m2 = 0.8, IC = (0.1, 0.1, 0.1, 0), the 4D-DMCS experiences multiple transitions between periodic, quasi-periodic, and chaotic states in the interval c [0.3, 1.5], and eventually stabilizes to a quasi-periodic state at c = 1.38. Figure 9a shows the periodic attractors of xy plane projections corresponding to the typical values c = 0.45, c = 0.895, c = 1.3, and c = 1.4 of parameter c in each period interval. Figure 9b shows that when c = 0.49, c = 0.65, c = 1.18, it corresponds to the quasi-periodic attractor. The chaos attractor at c = 0.75 is shown in Fig. 9c, The evolution process of the attractor contains period-doubling bifurcation, inverse bifurcation, and episodic chaotic processes.

Fig. 9
figure 9

The attractors when c take some typical values for a = 1.5, b = 0.5, m1 = m2 = 0.8, IC = (0.1, 0.1, 0.1, 0). (a) Quasi-periodic attractors. (b) Quasi-periodic attractors. (c) Chaotic attractor.

The coupling strengths, denoted as m1 and m2, of the two memristors, exert an influence on the dynamic characteristics of the system. To examine the impact of these coupling strengths on the system’s dynamics, we conducted an analysis with fixed parameters: a = 2.5, b = 0.5, c = 1.5, and an initial condition IC = (0.1, 0.1, 0.1, 0). Subsequently, the 2D distribution of the maximum LE was generated within the ranges of m1 [0.1, 3] and m2 [0.1, 2], as illustrated in Fig. 10a. The blue-colored regions represent areas where LE is less than or equal to 0, while cyan, yellow, and red regions indicate areas where LE is greater than 0, corresponding to the chaotic state of the system. Through this maximum LE distribution, it is possible to efficiently discern the chaotic and periodic regions that are influenced by the coupling strengths m1 and m2. For specific values of (m1, m2) chosen as (0.9, 0.3), (1.2, 0.5), and (2, 0.5), the respective periodic, quasi-periodic, and chaotic attractors are plotted in Fig. 10b. To further investigate the influence of coupling strength on the dynamic characteristics of the system, with the coupling strength m2 fixed at 0.5, the LE spectrum and bifurcation diagram are plotted for m1, as shown in Fig. 10c. The evolution of the system dynamics involves a reverse bifurcation from chaos to a periodic state, with a large number of intermittent periodic windows appearing within the interval [0.3, 1.45]. As m1 increases, the system undergoes a reverse period-doubling bifurcation to form a period-2 state and eventually stabilizes to a period-1 state. Similarly, with m1 fixed at 0.6, under the same parameters and IC, The LE spectrum and bifurcation diagram are depicted for m2 [0.3, 2], as shown in Fig. 10d.

Fig. 10
figure 10

The influence of couple strength m1 and m2 on the dynamic behavior of the system with fixed parameters a = 2.5, b = 0.5, c = 1.5, IC = (0.1, 0.1, 0.1, 0). (a) 2D maximum LE distribution diagram. (b) Periodic, quasi-periodic, and chaotic attractors corresponding to typical values of m1 and m2. (c) The LE spectrum and bifurcation diagram in m1 [0.3, 2]. (d) The LE spectrum and bifurcation diagram in m2 [0.3, 2].

Offset boosting

With the incorporation of memristors, the amplitude modulation parameter b transforms from a non-bifurcation to a bifurcation parameter, which subsequently restricts the controllability of the attractor’s amplitude within the system. Notably, the approach utilized in this study for integrating memristors does not alter the occurrence times of the state variable x as a linear term, specifically confined to the third term of the equation. As a result, the newly coupled system, comprising two memristors, maintains the capability for offset boosting controllability of the attractor47. Therefore, by incorporating a parameter k into Eq. (14) to derive the Eq. (19), the regulation of this parameter k facilitates the control of the offset boosting effect in the attractor within the 4D-DMCS.

$$\left\{ {\begin{array}{*{20}l} {\dot{x} = y + m_{1} W_{1} (y)z} \hfill \\ {\dot{y} = c_{1} z} \hfill \\ {\dot{z} = - a(x + k) + by^{2} - m_{2} W_{2} (w)y - cz} \hfill \\ {\dot{w} = c_{2} y} \hfill \\ \end{array} } \right.$$
(19)

When fixing parameters a = 2, b = 1, c = 1.5, m1 = m2 = 0.8, IC = (0.1 − k, 0.1, 0.1, 0), the time-domain waveform when k = − 10, k = − 5, k = 0, k = 5, and k = 10, respectively are shown in Fig. 11a. The time-domain waveform corresponding to the state variable x shifts with the change of k, while the frequency of the signal remains unchanged. Figure 11b illustrates the locations of the attractors in the 3D phase space following these five shifts. Figure 11c presents the LE spectrum and bifurcation diagram for the parameter k within the range of [− 10, 10]. The results indicate that k serves as a non-bifurcation parameter, as the LE remains invariant across different values of k. Furthermore, the bifurcation diagram corresponding to the state variable x exhibits a linear shift with variations in k. The mean value of the state variable effectively captures this shift as a function of k. Figure 11d plots the mean values of the state variables for k in the range of [− 10, 10]. Except for the linear change in x, the mean values of the other three state variables y, z, and w remain constant, indicating that the change in k does not affect these state variables.

Fig. 11
figure 11

The offset boosting controllability of the new system with parameters a = 2, b = 1, c = 1.5, m1 = m2 = 0.8, IC = (0.1 − k, 0.1, 0.1, 0). (a) The time domain wave of x when k = − 10, k = − 5, k = 0, k = 5, and k = 10. (b) Position of the attractors in 3-dimensional phase space after offset boosting. (c) The LE spectrum and bifurcation diagram in the interval of k [− 10, 10]. (d) The mean of each state variable.

Multistability analysis

Multistability refers to the phenomenon where a chaotic system can exhibit the coexistence of multiple stable states or attractors simultaneously under the same parameter settings due to different initial values48. The trajectory of a chaotic system can originate from any arbitrary IC, and after a prolonged transient or chaotic phase, ultimately converge to a stable state. Minor alterations in the IC can lead to corresponding changes in the transient trajectory of the system’s path, potentially resulting in substantial variations in the ultimate stable state49. This indicates that the chaotic system is highly sensitive to IC. Since the memristor exhibits exceptional sensitivity to initial values, rendering the system’s motion state reliant not only on current inputs and parameters but also influenced by its past state history. Consequently, minor perturbations in the IC can provoke significant deviations in the system’s evolutionary path, ultimately leading to diverse motion states. Therefore system (1) exhibits no multistability, the 4D-DMCS demonstrates rich multistability behaviors.

Fixing a = 4, b = 1, c = 2, m1 = m2 = 0.5 and IC = (x0, 0.1, 0.1, w0), the basin of attraction in the region of x0 [− 5, 5] and w0 [− 5, 5] can be obtained as depictd in Fig. 12a. The diagram features six distinct colored regions, namely blue, cyan, yellow, red, magenta, and green. Typical IC values are chosen from each of these regions, and the corresponding phase trajectories in the x–y plane are plotted, as illustrated in Fig. 12b.

Fig. 12
figure 12

When fixing parameters a = 4, b = 1, c = 2, m1 = m2 = 0.5, and IC = (x0, 0.1, 0.1, w0), the basin of attraction and coexisting attractors of the x-w plane. (a) The basin of attraction. (b) Coexisting attractors.

The colors of the attractors align with the colors of their respective basins of attraction. Through calculations, the LEs for the magenta attractor are determined as LE1 = 0.12314 (+), LE2 = 0.01115 (+), LE3 = − 0.000436 (0), and LE4 = − 2.1238 (−). The presence of two positive LEs indicates that the system is in a hyperchaotic state50. The analysis reveals that there is one hyperchaotic attractor and two chaotic attractors, and two periodic attractors and one quasi-periodic attractor coexist in the system under this parameter combination.

When the parameters are set to a = 2.5, b = 1, c = 1.5, m1 = m2 = 0.5, and IC = (x0, 0.1, z0, 0), we observe the multistability that is dependent on the initial values x0 [− 4, 4] and z0 [− 4, 4]. The basin of attraction is shown in Fig. 13a, where the red, yellow, cyan, black, and green regions correspond to the attractors of the same colors in Fig. 13b,c. Among them, when x0 = − 0.46 and z0 = − 2.1, and when x0 = − 1 and z0 = 0.1, cyan and black chaotic attractors are formed, which are topologically identical but have different amplitudes. The attractors formed by the initial values x0 = − 3.4, z0 = 1 and x0 = 0.22, z0 = − 0.54 exhibit very small amplitudes, specifically on the order of 10−6. As a result, they are designated as point attractors. Consequently, under this particular combination of parameters, the 4D-DMCS exhibits two types of chaotic attractors, one type of period-2 attractor, and two types of point attractors, all coexisting within the dynamical landscape.

Fig. 13
figure 13

When fixing parameters a = 2.5, b = 1, c = 2, m1 = m2 = 0.5, and IC = (x0, 0.1, w0, 0), the basin of attraction and coexisting attractors of the x–z plane. (a) The basin of attraction. (b) Coexisting attractors. (c) The coexisting point attractors.

With the parameters and initial condition set as a = 1.5, b = 0.8, c = 1.5, m1 = m2 = 0.8, and IC = (0.1, y0, z0, 0), the basin of attraction in the y–z plane for the range of y0 [− 6, 6] and z0 [− 6, 6] is shown in Fig. 14a. There are six different colored regions in the figure, and the attractors corresponding to these regions are labeled with their corresponding colors and typical ICs in Fig. 14b,c. Through the calculation of LE values for the typical ICs within these six regions, it is revealed that the system demonstrates a coexistence of one chaotic attractor, three quasi-periodic attractors, and two periodic attractors. Notably, the attractor associated with the cyan region possesses a volume on the order of 10−6, thus it is classified as a point attractor.

Fig. 14
figure 14

The basin of attraction in the y—z plane and coexistence attractors with parameters a = 1.5, b = 0.8, c = 1.5, m1 = m2 = 0.8, and initial conditions IC = (0.1, y0, z0, 0). (a) the basin of attraction for y0 [− 6, 6] and z0 [− 6, 6]. (b) The coexisting attractors. (c) The coexisting point attractor.

The 4D-DMCS exhibits multistability with at least five attractors coexisting under the aforementioned three parameter combinations, providing further evidence that the incorporation of two memristors significantly enhances the system’s multistable behavior. For the convenience of readers, Table 1 summarizes the corresponding multistability conditions for various parameter combinations, encompassing the parameters, initial conditions, Lyapunov exponents, state descriptions, and attractor colors.

Table 1 Multistability conditions with different combinations of parameters.

Transient dynamic behavior

Chaos is a long-term and progressive characteristic, and the transitional phase preceding the system’s entry into stable chaotic and periodic states is overlooked. This transitional process is termed the transient behavior of the system51, which represents the non-equilibrium process before the system approaches the relatively stable state. Some processes in transient behavior may also have chaotic characteristics, and we call this type of chaos with a finite lifetime transient chaos. Transient behavior is a special chaotic property, its attractors will also change significantly as time increases to a cutoff point. Transient behaviors have been found in the 4D-DMCS.

With fixing parameters a = 3, b = 0.5, c = 0.8, m1 = m2 = 0.8, and IC = (0.1, 0.1, 0.1, 0), the 4D-DMCS exhibits transient behavior at t = 1533.88 s. As shown in Fig. 15a, the amplitude of the signal x(t) significantly decreases and becomes ordered after t ≥ 1533.88 s, indicating a transition from a chaotic state (red) to a periodic state (cyan). Figure 15b demonstrates the process of the chaotic attractor evolving into a periodic attractor. Notably, when t < 1533.88 s, the phase trajectory is an asymmetric chaotic attractor, which rapidly contracts and stabilizes onto a periodic orbit as time progresses to t ≥ 1533.88 s. In the numerical analysis, the simulation step size is set at 0.001 s, and the simulation time spans t [0, 5000] s.

Fig. 15
figure 15

The transient behavior for parameters a = 3, b = 0.5, c = 0.8, m1 = m2 = 0.8 and IC = (0.1, 0.1, 0.1, 0). (a) Time-domain waveform diagram. (b) The attractor evolution of the transient behavior in the x–y plane.

When the parameters are changed to a = 2, b = 0.8, c = 1, m1 = m2 = 1, and IC = (0.1, 0.1, 0.1, 0), the 4D-DMCS exhibits transient behavior at cutoff time points t = 6888.8 s and t = 17,728.3 s. As seen in the time-domain waveform depicted in Fig. 16a, for t < 6888.8 s, the signal x(t) exhibits irregular waveforms (red). When 6888.8 s ≤ t < 17,728.3 s, the signal amplitude decreases after the cutoff point and continues to diminish (cyan). When t > 17,728.3 s, the amplitude of signal x(t) stabilizes and remains ordered, exhibiting periodicity. This indicates that the system quickly stabilizes into a periodic state after experiencing two types of transient chaos. Figure 16b shows the evolution of the attractor in the x–y plane as the system undergoes two transient chaotic states and finally stabilizes onto a periodic orbit. In the numerical analysis, the simulation step size is set at 0.001 s, and the simulation time spans t [0, 30,000] s.

Fig. 16
figure 16

The transient behavior for parameters a = 2, b = 0.8, c = 1, m1 = m2 = 1 and IC = (0.1, 0.1, 0.1, 0). (a) Time-domain waveform diagram. (b) The attractor evolution of the transient behavior in the x–y plane.

The incorporation of two memristors in the 4D-DMCS results in the exhibition of diverse transient behaviors, indicating an escalated level of complexity within the system. Table 2 summarizes the transient behaviors for these two combinations of parameters, including parameters, initial conditions, cutoff time, and simulation time.

Table 2 Transient behaviors of the 4D-DMCS.

Complexity analysis

The complexity of a system is an important indicator reflecting the performance of chaotic systems. SE and C0 complexity, based on the power spectral density of the system, reflect the randomness and irregularity of the system’s dynamics and are often powerful tools for identifying and quantifying the complexity of chaotic systems52,53. In this section, the chaotic characteristics of system complexity are discussed from the perspective of the interaction of system parameters using the "flab(hot)" mode in Matlab R2021b. The SE complexity measurement algorithm is employed to calculate the spectral entropy complexity as parameters change, and contour maps with different colors are used to describe the results.

When c = 1, m1 = 0.8, m2 = 0.8, and IC = (0.1, 0.1, 0.1, 0), the 3D distribution of the SE complexity and 2D distribution of C0 complexity within the region defined by a [0.1, 5] and b [0.1, 2] are shown in Fig. 17a,b. In Fig. 17a, the utilization of color intensity serves as a visual representation of SE complexity. Specifically, white and yellow hues denote regions of low SE complexity, whereas red and darker red tones signify areas of high SE complexity. The progressive darkening of the color spectrum directly correlates with an increase in SE complexity, implying a heightened level of chaos within the 4D-DMCS. Consequently, the pseudo-random sequences generated under conditions of high SE complexity exhibit superior pseudo-randomness properties. Fixing a = 4 and b = 1.57, the SE complexity of the system reaches its maximum value of 0.7635. The light blue area in Fig. 17b indicates that the C0 complexity is very low and close to 0, and the darker orange area indicates higher C0 complexity. At b = 1.29, the C0 complexity reaches its maximum value of 0.48. When a = 3, b = 1, c = 1, and IC = (0.1, 0.1, 0.1, 0), the 3D distribution of the SE complexity and 2D distribution of C0 complexity within the region defined by m1 [0.1, 2] and m2 [0.1, 2] are presented in Fig. 17c,d. When the parameters m1 and m2 are set to 0.2615 and 0.784, respectively, the 4D-DMCS exhibits a maximum SE complexity of 0.817001, while simultaneously, the C0 complexity attains its peak value of 0.528.

Fig. 17
figure 17

SE and C0 complexity of the 4D-DMCS. (a) The SE complexity in the region of a [0.1, 5] and b [0.1, 2] when c = 1, m1 = 0.8, m2 = 0.8 and IC = (0.1, 0.1, 0.1, 0). (b) The C0 complexity distribution in the region of a [0.1, 5] and b [0.1, 2]. (c) a = 3, b = 1, c = 1, and IC = (0.1, 0.1, 0.1, 0), the SE complexity distribution for m1 [0.1, 2] and m2 [0.1, 2]. (d) the C0 complexity distribution for m1 [0.1, 2] and m2 [0.1, 2].

To investigate the influence of integrating memristors on the complexity of chaotic systems, we have additionally computed the SE and C0 complexity of system (1) for comparative analysis. With parameter b of system (1) fixed at 1, the 3D distribution of SE and C0 complexity within the region defined by a [2,5] and c [3, 5] is shown in Fig. 18a,b. Through comprehensive comparison, the complexity of system (1) before adding memristors is generally lower. At the parameter value of a = 2.9044 and c = 4.888, the SE complexity reaches its maximum value of 0.5654. At a = 2.52, the highest C0 complexity of 0.3494 is obtained.

Fig. 18
figure 18

The 3D SE and C0 complexity distribution of the system (1)in the region of a [2, 5] and c [3, 5] when b = 1. (a) The 3D SE complexity distribution. (b) The 2D C0 complexity distribution.

Following an exhaustive analysis of the system’s complexity, we have observed a notable enhancement in both the SE and C0 complexity of the system upon the incorporation of dual memristors. This substantial increase in complexity presents considerable promise for diverse applications, such as the generation of pseudo-random sequences, image encryption, and secure communications, thereby rendering the system advantageous for these fields.

Implementation of the 4D-DMCS

Both analog circuits and digital hardware methods can be used to realize chaotic systems. However, due to the presence of parasitic capacitance in the analog circuit, the initial value of the system cannot be controlled, meaning that the initial values in analog circuits are random54,55,56. In contrast, digital hardware achieves computation through programming and then converts the resulting digital signals into analog chaotic signals using a Digital-to-Analog converter (DAC). Discretization of the continuous chaotic system is required in this process. Discretization algorithms include the Euler algorithm and the Runge–Kutta algorithm. However, in practical applications, both performance and cost should be considered comprehensively. Euler’s method is a relatively simple and computationally inexpensive way to implement chaotic systems. Additionally, the STM32 is a high-performance, low-power microcontroller that is much cheaper than DSP and FPGA. Combining STM32 with Euler’s method provides a cost-effective solution for implementing the proposed chaotic system.

In this section, the STM32F103C8T6 microcontroller is selected as the core processing unit to discretize the continuous chaotic signal by the Euler algorithm and then iterate57,58. The specific implementation process is shown in Eq. (20).

$$\left\{ \begin{aligned} x(n + 1) & = x(n) + \Delta T[y(n) + m_{1} (0.1 + 0.01y(n)^{2} )z(n)] \\ y(n + 1) & = y(n) + \Delta T[z(n)] \\ z(n + 1) & = z(n) + \Delta T[ - ax(n) + by(n)^{2} \\ & \quad - m_{2} (|w(n)| - 0.1)y(n) - cz(n)] \\ w(n + 1) & = w(n) + \Delta T[y(n)] \\ \end{aligned} \right.$$
(20)

where ∆T is the sampling time, if the sampling time is small enough, the dynamic characteristics of the discretized system (20) will be the same as that of the 4D-DMCS. The result of the discretization iteration is transmitted to the 16-bit digital-to-analog converter DAC8552 with bipolar output through an SPI serial communication interface. Finally, the converted analog signal is captured by dual-trace oscilloscope UTD2102CM. The principle of digital hardware implementation is shown in Fig. 19.

Fig. 19
figure 19

The platform of the digital hardware experiment of the 4D-DMCS based on microcontroller.

To verify the physical feasibility of the system, we selected the parameters and IC delineated for the chaotic state in “Dual memristors coupling”, specifically a = 1.8, b = 0.8, c = 1, m1 = m2 = 0.8, with IC = (0.1, 0.1, 0.1, 0). The phase trajectory captured in the xy, xz, xw, yw, yz, and zw planes is shown in Fig. 20, which is completely consistent with the numerical simulation results in “Dual memristors coupling”, further proving the physical realizability of the system.

Fig. 20
figure 20

The projections of the attractor captured by the oscilloscope on various planes when the parameters are a = 1.8, b = 0.8, c = 1, m1 = m2 = 0.8, and the initial condition IC = (0.1, 0.1, 0.1, 0). (a) x–y. (b) x–z. (c) x–w. (d) y–w. (e) y–z. (f) z–w.

Application in image encryption

The image encryption algorithm employed in this section focuses on the permutation of plaintext-related information. As illustrated in Fig. 21, the specific implementation process is as follows59,60,61:

Fig. 21
figure 21

Plain association scrambling algorithm flowchart.

Step 1: Convert the two-dimensional plaintext image P into a one-dimensional vector of size M × N, where M and N represent the number of rows and columns in the image matrix, respectively.

Step 2: Compose the encryption key K by combining the initial values of the four state variables of 4D-DMCS with two random integers between 0 and 255. The key is denoted as K = (x0, y0, z0, w0, r1, r2).

Step 3: Generate five pseudo-random sequences from 4D-DMCS, and transform them into six independent integer sequences, each with elements ranging from 0 to 255. Subsequently, populate these integer sequences sequentially into six M × N matrices labeled X, Y, Z, W, U, and V.

Step 4: Employ a plaintext-independent diffusion algorithm I and utilize the random matrix X to alter the pixel values at corresponding positions in the original plaintext image P, transforming it into a new matrix A.

Step 5: Calculate using the random matrices Z, W, U, and V to generate two integers k and l. Traverse the image matrix A in a specific order and swap the pixel value at position A(k, l) with that at position A(i, j), resulting in a permuted image B. This permutation disrupts the correlation between adjacent pixels in the original image.

Step 6: Perform a second diffusion on the permuted image B using the random matrix Y. Unlike Step 4, this diffusion propagates backward from the last pixel of the image, ultimately yielding the encrypted image C.

The decryption process for the image is simply the reverse of the encryption procedure.

Employing the selected key K = (0.113, 0.121, 0.164, 0.011, 35, 201), we conducted encryption and decryption experiments on three 512 × 512 pixel plaintext images: Goldhill, Peppers, and Baboon. These images collectively occupy 2684 KB of storage. The encryption process took 0.5317 s, while decryption required 0.5149 s. Consequently, the 4D-DMCS image encryption algorithm achieved encryption and decryption speeds of 5.05 Mbps and 5.21 Mbps, respectively. The detailed experimental outcomes for both encryption and decryption are illustrated in Fig. 22. Specifically, Fig. 22a,d,g present the original plaintext images, Fig. 22b,e,h showcase the encrypted ciphertext images, and Fig. 22c,f,i display the successfully decrypted images.

Fig. 22
figure 22

Experimental results of encryption and decryption, plain images: (a) Goldhill, (d) Baboon, (g) Peppers. Ciphered images: (b) Goldhill, (e) Baboon, (h) Peppers. Decrypted images: (c) Goldhill, (f) Baboon, (i) Peppers.

Key space

The key space encompasses the entirety of possible keys. To effectively defend against brute-force attacks, an exceptional image encryption system necessitates a vast key space. In the image encryption system designed in this paper, the key K comprises the initial values x0, y0, z0, and w0 for 4D-DMCS, all of which lie within the interval [− 1,1], as well as two random integers r1 and r2, each ranging from 0 to 255. Specifically, the step sizes are 10−16 for x0 and w0, 10−15 for y0 and z0, and 1 for the two random integers.

Based on calculations, the key space of this system is

$$S = S_{1} \times S_{2} \times S_{3} \times S_{4} \times S_{5} \times S_{6} = 1.048 \times 10^{68} \approx 2^{226}$$
(21)

where S1 = S4 = (1 − (− 1)) × 1016, S2 = S3 = (1 − (− 1)) × 1015, S5 = S6 = 256. corresponding to a key length of approximately 226 bits (i.e., L = log2(S) ≈ 226). Such a colossal key space underscores the system’s outstanding encryption capabilities.

Histogram and χ2 test

In the realm of image encryption, the histogram serves as a pivotal analytical instrument for assessing the performance of encryption algorithms as well as the statistical characteristics exhibited by images post-encryption. Specifically, the histogram of an unencrypted image provides insights into its brightness, contrast, and color distribution, typically manifesting significant fluctuations. Conversely, encryption transforms these images, resulting in a more uniform distribution of pixel values, where each value occurs with comparable frequency. This transformation leads to a histogram that is flattened, even, or seemingly random, starkly contrasting with the histogram of the original plaintext image. As depicted in Fig. 23a–f, the process effectively encrypts the valuable information contained within the three plaintext images, ensuring their confidentiality.

Fig. 23
figure 23

Histograms of the images Goldhill, Baboon, and Peppers, plain image histograms of (a) Goldhill, (b) Baboon, (c) Peppers. Ciphered image histograms of (d) Goldhill, (e) Baboon, (f) Peppers.

To further verify the homogeneity of the histogram, the test can be used with the following formula:

$$\chi^{2} = \sum\limits_{L = 0}^{255} {\frac{{(f_{i} - g_{i} )^{2} }}{{g_{i} }}}$$
(22)

where, fi represents the observed frequency of each gray level that occurs, while gi denotes the theoretically expected frequency of each gray level. A χ2 test is performed on the three plain images, and the results of this test are presented in Table 3. It is evident from the table that the χ2 test values for the plain images are significantly larger than χ20.01(255) = 310.45739, indicating a deviation from the expected uniform distribution. In contrast, the χ2 test values for all three cipher images are less than χ20.01 (255), demonstrating that the histograms of the cipher images are uniform.

Table 3 The χ2 test values of the images.

Pixel correlation analysis

In digital image encryption, the pixel correlation coefficient is often used to measure the encryption effect. Pixel correlation refers to the degree to which adjacent pixels in an image are related to each other, i.e., how a pixel value relates to the pixel values around it. Excellent encryption algorithms can destroy the pixel correlation in the original image and weaken the correlation between pixel values. The correlation coefficient D(r) between pixels is defined as62:

$$D(r) = \frac{{\sum\nolimits_{i = 1}^{N} {(x_{i} - \overline{x})(y_{i} - \overline{y})} }}{{\sqrt {\sum\nolimits_{i = 1}^{N} {(x_{i} - \overline{x})^{2} \times \sum\nolimits_{i = 1}^{N} {(y_{i} - \overline{y})^{2} } } } }}$$
(23)

where xi and yi are the gray values of two adjacent pixels in the image, so \(\overline{x }=\frac{1}{N}{\sum }_{i=1}^{N}{x}_{i}\), and \(\overline{y }=\frac{1}{N}{\sum }_{i=1}^{N}{y}_{i}\). By changing the summed value, the correlation coefficient in different directions can be obtained.

The correlation of the horizontal, vertical, diagonal, and reverse diagonal directions is shown in Fig. 24a–c. The pairs of pixels are concentrated on the line y = x, indicating that the adjacent pixels in the plaintext images have a strong correlation. Instead, from the correlation Fig. 24d–f, the pairs of adjacent pixels in all directions are uniformly distributed in a rectangular box. It shows that due to the function of the encryption algorithm, the correlation of the original plaintext images is destroyed, and the correlation of the adjacent pixels is reduced, which is beneficial for the prevention of statistical attacks.

Fig. 24
figure 24

Correlation of images in each direction before and after encryption. Plain image: (a) Goldhill; (b) Baboon; (c) Peppers. Ciphered image: (d) Goldhill; (e) Baboon; (f) Peppers.

Table 4 records the correlation coefficients of plain and ciphered images in different directions and compares them with other researchers’ work. The comparison showed significant differences in the correlation of adjacent pixels in plain and ciphered images. In the plained images, there is a strong correlation between the adjacent pixels, and the correlation coefficient is relatively large and close to 1, indicating that they are more closely related. Weak correlation between pixels in ciphered images, with a correlation coefficient close to 0. Through literature comparison, it says that the proposed 4D-DMCS-based encryption scheme is as effective as the other three recent methods.

Table 4 Correlation coefficients in all directions of Goldhill, Baboon, and Peppers.

Key sensitivity

Key sensitivity refers to the phenomenon that during the process of encryption and decryption, when a slight change occurs in the key, the key generated after being processed by the key sequence generator or iterative function undergoes significant alterations, leading to substantial changes in the image during encryption and decryption. In other words, a minor change in the key results in a drastically different encryption outcome. Excellent key sensitivity is a crucial indicator for assessing the security of image encryption algorithms, making it difficult for attackers to crack the encryption system through guessing or minor adjustments.

Key sensitivity is typically analyzed through the average values of the number of pixels change rate (NPCR), unified average changing intensity (UACI), and block average changing intensity (BACI). NPCR refers to the percentage of pixels with differing values between the two images before and after encryption. UACI represents the average intensity of differences in corresponding pixel values between the two images. BACI, on the other hand, signifies the average intensity of pixel value changes within specific regions (i.e., “blocks”) within the image. In this paper, keys are randomly generated within the key space of the IC = (x0, y0, z0, w0) for 4D-DMCS. Five different sets of experiments are conducted, each with a step size of 10−13 for x0, y0, z0, and w0, respectively. NPCR, UACI, and BACI are calculated 2000 times for each set, and their averages are taken, with four decimal places retained. The specific experimental data is presented in Table 5. When five distinct minor changes are introduced to the key, notable variations are observed in the values of NPCR and UACI, demonstrating strong key sensitivity.

Table 5 Key sensitivity analysis results.

Information entropy

Information entropy (IE) reflects the distribution of gray values in the encrypted image, that is, the randomness and unpredictability of the image’s gray values, and the IE of the encrypted image is defined as

$$H(m) = - \sum\limits_{i = 0}^{{2^{n} - 1}} {P(m_{i} )\log_{2} P(m_{i} )}$$
(24)

where n is the number of bits corresponding to the grayscale value of the grayscale image (such as the 8-bit grayscale image, n = 8), and P(mi) is the probability that the grayscale value mi appears in the image. For an image with 256 Gy levels (8 bits), the theoretical information should be 8 bits. Hence, upon the application of a superior image encryption algorithm, the IE of the encrypted image should approach an infinite proximity to the value of 8, In practice, it is considered that when the IE of the ciphered image exceeds 7.99, the algorithm has good encryption performance. Calculating the IE of Goldhill, Baboon, and Peppers is shown in Table 6, and the IE of each image is greater than 7.999, indicating that the encryption algorithm has good encryption performance.

Table 6 The IE of Goldhill, Baboon, and Peppers.

To verify the superiority of the proposed system, Table 7 compares the information entropy of encrypted images from various literature sources. It can be observed that the information entropy of images encrypted using the chaotic system proposed in this paper is closer to 8 compared to that obtained by encryption algorithms in other literature. This indicates that the encrypted images contain a greater amount of information and demonstrate a better encryption effect.

Table 7 Comparison of information entropy of different chaotic systems.

Conclusion

In this paper, a method for coupling dual memristors within a jerk chaotic system is proposed, and a new 4D dual-memristors chaotic system is constructed by coupling two memristors into a novel jerk chaotic system. The dynamic characteristics are analyzed include the LE spectrum and bifurcation diagram of each parameter, offset boosting controllability of attractors, multistability, transient behaviors, and complexity analysis. Compared with the jerk system before adding the memristors, the introduction of double memristors enriched the dynamic characteristics, enhanced the multistability, and improved the SE and C0 complexity of the system, which made the performance of the system superior. The 4D-DMCS is implemented physically by using a microcontroller STM32F103C8T6. Finally, the application of 4D-DMCS in image encryption demonstrates excellent performance, reinforcing the assertion that the multi-memristor coupling approach is indeed capable of augmenting the functionality of chaotic systems.