## 3 Our Proposed Scheme  
### Encryption Scheme  
The block diagram of the encryption scheme is shown in Figure 2, the detailed processes are as follows:  
_Step 1:_ Input an 8-bit gray level plain image \(\mathbf{P}\) with size of \(M\times N\), and an initial key \(\mathbf{K}\) into the encryption scheme. _Step 2:_ Input initial key \(\mathbf{K}\) into Algorithm 1 to generate a rules selection control sequence \(\mathbf{RSCS}\). _Step 3:_ Change the plain image matrix \(\mathbf{P}\) into an array \(\mathbf{PA}\) by rows. _Step 4:_ Input image array \(\mathbf{PA}\) and rules selection control sequence \(\mathbf{RSCS}\) into Algorithm 2 to randomly encode the image array \(\mathbf{PA}\) under the DNA encode rules which are shown in Table 1, and generate an image DNA sequence \(\mathbf{IDS}\). _Step 5:_ Input image DNA sequence \(\mathbf{IDS}\) and initial key \(\mathbf{K}\) into Algorithm 3 to generate permutation control sequence \(\mathbf{PCS}\). _Step 6:_ Input image DNA sequence \(\mathbf{IDS}\) and permutation control sequence \(\mathbf{PCS}\) into Algorithm 4 to do plaintext related permutation, and get a permutated image sequence \(\mathbf{PIS}\). _Step 7:_ Put initial key \(\mathbf{K}\) and rules selection control sequence \(\mathbf{RSCS}\) into Algorithm 5 to generate a key DNA sequence \(\mathbf{KDS}\). \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **A** & **T** & **C** & **G** \\ \hline Rule 1 & 00 & 11 & 10 & 01 \\ Rule 2 & 00 & 11 & 01 & 10 \\ Rule 3 & 11 & 00 & 10 & 01 \\ Rule 4 & 11 & 00 & 01 & 10 \\ Rule 5 & 10 & 01 & 00 & 11 \\ Rule 6 & 01 & 10 & 00 & 11 \\ Rule 7 & 10 & 01 & 11 & 00 \\ Rule 8 & 01 & 10 & 11 & 00 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: DNA encode/decode rules. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \(-\) & **A** & **C** & **G** & **T** \\ \hline A & C & A & T & G \\ C & G & C & A & T \\ G & T & G & C & A \\ T & A & T & G & C \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Subtraction operation of DNA code. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \(\mathbf{XOR}\) & **A** & **C** & **G** & **T** \\ \hline A & A & C & G & T \\ C & C & A & T & G \\ G & G & T & A & C \\ T & T & G & C & A \\ \hline \hline \end{tabular}
\end{table} 
Table 4: XOR operation of DNA code. _Step 8:_ Input permutated image sequence **PIS** and key DNA sequence **KDS** into Algorithm 6 to do DNA diffusion operation, and generate a diffused sequence **DS**. _Step 9:_ Put diffused sequence **DS** and rules selection control sequence **RSCS** into Algorithm 7 to decode DNA sequence to a recovered image array **RIA**. _Step 10:_ Reshape recovered image array **RIA** as \(M\times N\) to a cipher image matrix **C**. _Step 11:_ Output cipher image **C** and the encryption process is finished. ```
INPUT initial key \(\mathbf{K}\) KEYHASH\(\leftarrow\) SHA256(\(\mathbf{K}\)) A1\(\leftarrow\) KEYHASH(1:64) A2\(\leftarrow\) KEYHASH(65:128) \(x=mod(\mathbf{A1}/10^{15},\,1)\)\(p=mod(\mathbf{A2}/10^{15},\,0.5)\) Put \(x,\,p\) into Equation (1) to generate a sequence \(\mathbf{X}\) by iterating. RSCS\(=mod(floor(\mathbf{X}\times 10^{15}),\,8)\) OUTPUT rules selection control sequence RSCS. ```  
**Algorithm 1** Generation algorithm of rules selection control sequence (RSCS). ```
INPUT rules selection control sequence RSCSand data array \(\mathbf{A}\) Build a DNA encode rules table \(\mathbf{RT}\) (see Table 1). Change data array \(\mathbf{A}\) to a bit array \(\mathbf{AB}\) len\(\leftarrow\)\(Length(\mathbf{AB})\); \(n\gets 1\) DS\(\leftarrow\) NULL for\(l=1\)to len\(-1\)step 2 do \(\mathbf{DS}(n)\leftarrow\mathbf{RT}(\mathbf{AB}(i,\,i+1),\mathbf{RSCS}(n))\) \(n\gets n+1\) endfor OUTPUT DNA sequence DS. ```  
**Algorithm 2** DNA random encode algorithm. ```
INPUT image DNA sequence IDS and initial key K Build a DNA addition operation table \(\mathbf{AT}\) (see Table 2), a DNA XOR operation table \(\mathbf{XT}\) (see Table 4).