**3. Detail of Proposed Method**

Block encryption algorithms are ineffective in the encryption of digital images. One of the most important reasons for this problem is the high correlation between the pixel values of an image [38]. Usually, images are represented by a matrix with a size of *m* × *n* . The values of *m* and *n* indicate the values of the row and column, respectively. One of the proposed approaches to solving the correlation problem is to reposition the matrix cells using the zigzag transformation method, as shown in Figure 2. In this study, we propose the use of the zigzag reading approach as a postprocessing technique.

**Figure 2.** General structure of zigzag transformation approach.

Since AES-like s-box designs comprise a matrix with a size of 16 × 16, the zigzag transformation approach can be easily performed. The flowchart of the proposed method is given in Figure 3. The operation of the algorithm is given step by step below. Also, the pseudo code is expressed in Table 1 for the logistic map.

**Figure 3.** Flowchart of the proposed method.


**ChaoticSboxGenerate() begin** sbox=[0:255]

**for**(k=0;k<256;I++) sbox[k]=-1 **end for**

xOld= Random\_Selection [0,1]

**for**(i=0;I<1000;I++) xNew=4\*xOld\*(1-xOld) xOld=xNex **end for**

j=0; **while** (j<sbox.lenght) value=(xNex\*100000000)%256 **if**(!**contain**(sbox,value)) sbox[j]=value j++; **end if** xNew=r\*xOld\*(1-xOld) xOld=xNex **end while**

return **ZigZagTransform**(sbox) **end**

```
contain(array, value)
begin
for(int i=0;i<array.length;i++)
if(array[i]==value)
return true
end if
end for
return false
end
```