3.2 Encryption process
The proposed encryption algorithm is depicted as follows.
Step 1
The initial parameters (x0, y0, u) obtained in section 3.1 are entered into the 2D-SCLMS map for 500 + N2 iterations. The first 500 values are removed to acquire the sequences X, Y. Sequence X1 is obtained
$${X_1}=\bmod (round(X \times 10\^8),4)$$
11
X 1 is divided equally into 4 sequences and each sequence is transformed into an \(\frac{N}{2} \times \frac{N}{2}\) matrix named X11, X12, X13, X14.
The sequence X is transformed into a matrix X2 (N×N) and X2 is divided into X21, X22 by rows, so the matrices A, B are obtained according to Eqs. (14) and (15), respectively.
$${X_{21}}={X_2}(1:N \times CR,:)$$
12
$${X_{22}}={X_2}((1 - CR) \times N+1:end,:)$$
13
$$A=mod(floor({X_{21}} \times {10^{10}}),256)$$
14
$$B=mod(floor({X_{22}} \times {10^{10}}),256)$$
15
The sequence Y is transformed into a N×N matrix and then divided into two parts Y1, Y2 according to the number of rows. The matrix Y1 is arrayed in descending order by columns and the matrix Y2 is arrayed in ascending order by rows to get the index matrix L1, L2 respectively.
$${Y_1}=Y(1:N \times CR,:)$$
16
$${Y_2}=Y((1 - CR) \times N+1:end,:)$$
17
$$[\sim ,{L_1}]=sort({Y_1},2,'descend')$$
18
$$[\sim ,{L_2}]=sort({Y_2})$$
19
Step 2
The plaintext image P (N×N) generates a discrete coefficient matrix P1 through DWT and then matrix P1 is divided equally into 4 small matrices P11, P12, P13 and P14.
$${P_1}=\Psi \times P \times {\Psi ^{\rm T}}$$
20
Step 3
Perform pixel transformation on P11, P12, P13, P14 using matrices X11, X12, X13, X14. Take X11 as an example for illustration.
$$\begin{array}{*{20}{c}} {If~{X_{11}}(i,j)=0,then} \\ {temp={P_{11}}(i,j)} \\ {{P_{11}}(i,j)={P_{12}}(i,j)} \\ {{P_{12}}(i,j)=temp} \end{array}$$
21
$$\begin{array}{*{20}{c}} {If~{X_{11}}(i,j)=1,then} \\ {temp={P_{11}}(i,j)} \\ {{P_{11}}(i,j)={P_{13}}(i,j)} \\ {{P_{13}}(i,j)=temp} \end{array}$$
22
$$\begin{array}{*{20}{c}} {If~{X_{11}}(i,j)=2,then} \\ {temp={P_{11}}(i,j)} \\ {{P_{11}}(i,j)={P_{14}}(i,j)} \\ {{P_{14}}(i,j)=temp} \end{array}$$
23
$$\begin{array}{*{20}{c}} {If~{X_{11}}(i,j)=3,then} \\ {temp={P_{11}}(i,j)} \\ {{P_{11}}(i,j)={P_{11}}(\tfrac{N}{2}+1 - i,\tfrac{N}{2}+1 - j)} \\ {{P_{11}}(\tfrac{N}{2}+1 - i,\tfrac{N}{2}+1 - j)=temp} \end{array}$$
24
Similarly, pixel transformation is performed again based on the values of \({X_{12}},{X_{13}},{X_{14}}\), respectively. When the pixel transformation is over, the four matrices are combined to acquire P2.
Step 4
The initial values (z0, w0) created in section 3.1 and parameters are entered into the 2D-SLIM iterating 500 + d×M×N times to produce two chaotic sequences. The first 500 values of the two sequences are removed to obtain the chaotic sequence Z, W. M = CR×N, wherein, CR is the compression rate and d is the sampling distance.
Sequence Z1 is acquired by sampling from sequence Z according to the sampling distance d. The measurement matrix \(\Phi\)(M×N) is generated.
$${Z^{\prime}_i}=1 - 2{Z_{1+id}},i=1,2, \cdots ,MN$$
25
$$\Phi =\sqrt {\frac{2}{M}} reshape({Z^{\prime}_i},M,N)$$
26
Take MN values from the sequence W and transform it into a matrix W1. According to Eqs. (23) and (24), W2 and C can be generated as (27) and (28).
$${W_2}=\bmod (floor({W_1} \times {10^6}),8)$$
27
$$C=\bmod (floor({W_1} \times {10^6}),256)$$
28
Step 5
Compress P2 to obtain the measurement results P3.
$${P_3}=\Phi \times {P_2}$$
29
Step 6
Quantize P3 according to the sigmoid function introduced in Section 2.2 and round the quantized result to obtain P4.
$${P_4}=\frac{a}{{1+{e^{ - b({P_3} - c)}}}}$$
30
Step 7
Rotate P4 counterclockwise by 180° and then scramble the columns according to the index matrix L1 to get P5.
$${P_{41}}=rot90(rot90({P_4}))$$
31
$${P_5}(i,j)={P_{41}}(i,{L_1}(i,j))$$
32
Step 8
Rotate P5 counterclockwise by 180° and then scramble the rows according to the index matrix L2 to get P6.
$${P_{51}}=rot90(rot90({P_5}))$$
33
$${P_6}(i,j)={P_{51}}({L_2}(i,j),j)$$
34
Step 9
Rotate P6 counterclockwise by 180° and then perform the bit-cycle operation according to W2. If W2(i, j) = 1, then P61(i, j) is shifted left by 1 bit. If W2(i, j) = 2, then P61(i, j) is shifted left by 2 bits. Similarly, if W2(i, j) = 7, then P61(i, j) is shifted left by 7 bits and finally P7 is obtained.
$${P_{61}}=rot90(rot90({P_6}))$$
35
$${P_7}={P_6}(bit - cycle)$$
36
Step 10
The final ciphertext image P8 is obtained by double XOR of P7.
$${P_8}=bitxor(\bmod (bitxor({P_7},C)+A,256),B)$$
37