## 3 Our Proposed Scheme
### Encryption Scheme
len\(\leftarrow\)length(IDS); \(\mathbf{T1}\leftarrow\) IDS\((1)\); \(\mathbf{T2}\leftarrow\) IDS\((1)\) for\(i=2\)to len do \(\mathbf{T1}\leftarrow\) AT(T1, IDS(i)) T2\(\leftarrow\) AT(T2, IDS(i)) endfor DSHASH\(\leftarrow\) SHA256(\([\mathbf{T1},\mathbf{T2}]\)); KEYHASH\(\leftarrow\) SHA256(\(\mathbf{K}\)) TS\(\leftarrow\) DSHASH \(\mathbf{A1}\leftarrow\) TS(1:64); A2\(\leftarrow\) TS(65:128); A3\(\leftarrow\) TS(129:194); A4\(\leftarrow\) TS(195:256); x0\(\leftarrow\) (\(mod(fix(\mathbf{A1}/10^{8}),\,80)-40)+(\mathbf{A1}/10^{14}-fix(\mathbf{A1}/10^{14})\)) y0\(\leftarrow\) (\(mod(fix(\mathbf{A2}/10^{8}),\,80)-40)+(\mathbf{A2}/10^{14}-fix(\mathbf{A2}/10^{14})\)) z0\(\leftarrow\) (\(mod(fix(\mathbf{A3}/10^{8}),\,80)+1)+(\mathbf{A3}/10^{14}-fix(\mathbf{A3}/10^{14})\)) w0\(\leftarrow\) (\(mod(fix(\mathbf{A4}/10^{8}),\,500)-250)+(\mathbf{A4}/10^{14}-fix(\mathbf{A4}/10^{14})\)) Put \(x_{0},y_{0},z_{0},w_{0}\) into Equation (2) to generate a sequence \(\mathbf{X}\) by iterating. PCS\(=mod(floor(\mathbf{X}\times 10^{15}),\,len)\) Remove the repeated elements from PCS, and then put the absent numbers at the end. OUTPUT permutation control sequence PCS
```
INPUT image DNA sequence IDS and permutation control sequence PCS. \(len\gets length(\textbf{IDS})\) for\(i=1\textbf{to}\leavevmode\
obreak\ fix(len/2)\textbf{do}\)\(IDS(\textbf{PCS}(i))\leftrightarrow IDS(\textbf{PCS}(len-i+1))\) endfor PIS\(\leftarrow\) IDS OUTPUT permutated image sequence PIS. ```
**Algorithm 4** Permutation/Reverse permutation algorithm. ```
INPUT initial key K and rules selection control sequence RSCS. \(\textbf{KEYHASH}\leftarrow\) SHA256(K) \(\textbf{A1}\leftarrow\textbf{KEYHASH}(129:194)\) \(\textbf{A2}\leftarrow\textbf{KEYHASH}(195:256)\) \(x=mod(\textbf{A1}/10^{15},\leavevmode\
obreak\ 1)\leavevmode\
obreak\ p=mod(\textbf{A2}/10^{15}, \leavevmode\
obreak\ 0.5)\)  Put \(x,\)\(p\) into Equation (1) to generate a sequence X by iterating. \(\textbf{DSA}=mod(floor(\textbf{X}\times 10^{15}),256)\)  Input RSCS and DSA into Algorithm 2, then output DNA sequence KDS. OUTPUT key DNA sequence KDS. ```
**Algorithm 5** Generation algorithm of key DNA sequence (KDS). ```
INPUT permutated image sequence PIS and key DNA sequence KDS. Build a DNA addition operation table AT (see Table 2) and a DNA XOR operation table AT (see Table 4). \(len\gets length(\textbf{PIS})\) \(\textbf{T}(1)\leftarrow\textbf{AT}(\textbf{PIS}(1),\textbf{KDS}(1))\); \(\textbf{T}(1)\leftarrow\textbf{XT}(\textbf{T}(1),\textbf{KDS}(1))\); for\(i=2\textbf{to}\leavevmode\
obreak\ let\)do if\(mod(i,2)=0\)then \(\textbf{T}(i)\leftarrow\textbf{XT}(\textbf{PIS}(i),\textbf{KDS}(i))\); \(\textbf{T}(i)\leftarrow\textbf{XT}(\textbf{T}(i),\textbf{T}(i-1))\); else \(\textbf{T}(i)\leftarrow\textbf{AT}(\textbf{PIS}(i),\textbf{KDS}(i))\); \(\textbf{T}(i)\leftarrow\textbf{XT}(\textbf{T}(i),\textbf{T}(i-1))\); endif endfor DS\(\leftarrow\) T OUTPUT diffused sequence DS. ```
**Algorithm 6** DNA diffusion algorithm. ```
INPUT DNA sequence DS and rules selection control sequence RSCS. Build a DNA encode rules table RT (see Table 1). \(len\gets Length(\textbf{DS})\); \(n\gets 1\) \(\textbf{NS}\leftarrow\textbf{NULL}\) for\(l=1\textbf{to}\leavevmode\
obreak\ let\)do \(\textbf{NS}(n,n+1)\leftarrow\textbf{RT}(\textbf{DS}(i),\textbf{RSCS}(i))\) \(n\gets n+2\) endfor  Change bit sequence NS to a numerical array NA by each 8 bits. OUTPUT numerical array NA. ```
**Algorithm 7** DNA decode algorithm. ```
INPUT DNA sequence DS and rules selection control sequence RSCS. Build a DNA encode rules table RT (see Table 1). \(len\gets Length(\textbf{DS})\); \(n\gets 1\) \(\textbf{NS}\leftarrow\textbf{NULL}\) for\(l=1\textbf{to}\leavevmode\
obreak\ let\)do \(\textbf{NS}(n,n+1)\leftarrow\textbf{RT}(\textbf{D}\textbf{S}(i),\textbf{RSCS}(i))\) \(n\gets n+2\) endfor  Change bit sequence NS to a numerical array NA by each 8 bits. OUTPUT numerical array NA. ```
**Algorithm 8** DNA decoding algorithm.