Skip to main content
. 2020 Nov 4;22(11):1253. doi: 10.3390/e22111253
Algorithm 4 A step-by-step image encryption scheme.
  • Input: Plain image Pi.

  • Output: Cipher image Ci.

  • Begin
    1. Examine the dimensions of Pi (i.e., M, N, grayscale or RGB color image) and Change it into a 1-D vector of pixels (length =M×N or 3×M×N for grayscale and color images, respectively)
    2. Alter the intensity values into the range (0,1) by mathematical operation included into the arrangement as the state values of the proposed mapping.
    3. SplitPi into two vectors (P1 and P2 of lengths M×N/2 each.
    4. Generate the chaotic sequence by selecting two of the proposed maps (e.g., Execute Equations (1) and (2))
    5. Change the chaotic sequence (different maps in Figure 2 can be used for each half of Pi).
    6. Iterate the chaotic sequence for P1 for scrambling P1p row by row and column by column (starting from the first row and the first column).
    7. Compute the next quantized chaotic pair using the 2nd proposed map to scramble P2p for P2 with the second chaotic sequence, and reiterate this step n times1
    8. Combine the two encrypted image halves (each half has its own encryption parameters) and mix the pixels of the combined image.
    9. Permute Ski using the 3rd proposed map for the secret key.
    10. Construct the new vector of mistook pixels SPi=SKi (index, size = M×N).
    11. Adjust and changes the vector SPi realizing that every component of level gray ranges in [0,255] utilizing the 4-th proposed chaotic map and the accompanying condition: SPi(i)=mod(round(1012SPi(i)),256), where 1iM×N.
    12. Create the diffused vector SDi=SPiSKi, where ⊕ denotes the bit-wise exclusive OR
    13. Create the final matrix with cipher image Ci = reshape (SDi, M, N)
    14. Determine the encryption image matrix and spare as Ci.
  • End