Skip to main content
. 2020 Dec 31;23(1):57. doi: 10.3390/e23010057
Algorithm 3 Diffusion algorithm
Input: The shuffled image, H, q10,q20,a,b,c1,c2,μ1,μ2,ν1, and ν2.
Output: D, the diffusion vector.
Step 1: Reshape H, H={h1,h2,,hMN}.
Step 2: Covert H to binary, Hb.
Step 3: Set q1(0)=q10,q2(0)=q20.
Step 4: Perform initial iterations,
          For t=0 to 999
                  q1(t+1)=q1(t)+ν1q1(t)[(1μ1)(a2bq1(t)bq2(t))c1]
                  q2(t+1)=q2(t)+ν2q2(t)[(1μ2)(a2bq2(t)bq1(t))c2]
        End For
Step 5: Set q1(0)=q1(1000),q2(0)=q2(1000).
Step 6: For t=0 to MN1
                  q1(t+1)=q1(t)+ν1q1(t)[(1μ1)(a1(t)bq2(t))c1]
                  q2(t+1)=q2(t)+ν2q2(t)[(1μ2)(a2bq2(t)bq1(t))c2]
                  q(t+1)=(q1(t+1)+q2(t+1))/2
        End For
Step 7: Preprocess the values of Q={q(1),q(2),,q(MN)} as follows:
          q(t)=mod(ceil(q(t)1014),256),t=1,2,,MN.
Step 8: Covert Q to binary, Qb.
Step 9: Perform XOR between Hb and Qb, say D=XOR(Hb,Qb).