# A New One-Dimensional Compound Chaotic System and Its Application in High-Speed Image Encryption
## 3 The Proposed Image Encryption Scheme
### The Encryption Process
#### 3.1.3 Column-by-Column Encryption Processing  
In the stage of column-by-column encryption, another \(\mathbf{S}\) vector related to the encrypted image content is also used, but this vector is a column vector \(\mathbf{S}=[S(1),\,S(2),\,\ldots,\,S(i),\,\ldots,\,S(M)]^{\mathsf{T}}\). The initial value of any element \(S(i)\) in this vector is equal to \(k\) times of the sum of  
Figure 7: The schematic diagram of one round of encryption. (**a**) The row-by-row encryption; (**b**) the column-by-column encryption. all the elements in the \(i\)-th row, and its calculation principle is the same as that described in Figure 6a. However, the sum is implemented for each row, which can be expressed by the following Equation (17) (compared with Equation (10)):  
\[S^{(0)}(i)=k\times\sum_{j=1}^{N}P(i,j), \tag{17}\]  
When encrypting the \(j\)-th column (\(1\leq j\textless N\)) of the input image, the value of any element \(S^{(j)}(i)\) in the vector \(\mathbf{S}^{(j)}\) is equal to \(k\) times of the sum of all elements with column numbers greater than \(j\) in the \(i\)-th row, and its calculation principle is similar to that described in Figure 6b, but the sum is implemented for each row, which can be expressed by the following Equation (18) (compared with Equation (11)):  
\[S^{(j)}(i)=k\times\sum_{j^{\prime}=j+1}^{N}P(i,j^{\prime}), \tag{18}\]  
When the last column (\(j=N\)) of the input image is encrypted, the values of all elements in the vector \(\mathbf{S}^{(j)}\) will be 0, that is, \(\mathbf{S}^{(j)}=\) [0, 0,..., 0]. From Equation (18), the following relational expression (19) can be deduced:  
\[S^{(j)}(i)=k\sum_{j^{\prime}=j+1}^{N}P(i,j^{\prime})=k[\sum_{j^{\prime}=j}^{N }P(i,j^{\prime})-P(i,j)]=k\times\sum_{j^{\prime}=j}^{N}P(i,j^{\prime})-k\times P (i,j),\]  
That is  
\[S^{(j)}(i)=S^{(j-1)}(i)-k\times P(i,j) \tag{19}\]  
From the relation between \(\mathbf{S}^{(j)}\) and \(\mathbf{S}^{(j-1)}\) described by Equation (19), we can get a method to increase the speed of calculating the vector \(\mathbf{S}^{(0)}\); that is, it is not necessary to directly calculate the sum of all elements after the \(j\)-th column by the cumulative sum method of Equation (18) for the vector \(\mathbf{S}^{(j-1)}\) used in each column, but the following recursive algorithm can be used instead. Therefore, the \(i\)-th element value of the vector \(\mathbf{S}^{(j)}\) corresponding to the current column (\(j\)-th column) can be obtained by subtracting \(k\times P(i,j)\) from the \(i\)-th element value of the vector \(\mathbf{S}^{(j-1)}\) corresponding to the previous column (the (\(j\)-1)-th column). Only the element values of the initial vector \(\mathbf{S}^{(0)}\) must be directly calculated by the cumulative sum method of Equation (17). Therefore, the column vector \(\mathbf{S}^{(j)}\) needed to encrypt the \(j\)-th column can be calculated by the following algorithm: \(\mathbf{S}^{(j)}\)\(\leftarrow\)\(\mathbf{S}^{(j-1)}\)-\(k\times\mathbf{P}(\cdot,j)\). Here, \(\mathbf{P}(\cdot,j)\), represents a one-dimensional array composed of all elements in the \(j\)-th column of image \(\mathbf{P}\) to be encrypted. Therefore, the Equation (19) with elements as operating units can be rewritten as the calculation of Equation (20) with an array as operating units:  
\[\mathbf{S}^{(j)}=\mathbf{S}^{(j-1)}\textless\text{-}k\times\mathbf{P}(\cdot, j). \tag{20}\]  
Executing Equation (20) is equivalent to executing Equation (19) for \(i=1,2,\ldots,M\) in turn. In this way, a single column is treated as a single unit, turning an internal \(M\) times loop into a single loop. The detailed operational steps of the column encryption phase are described in Algorithm 4 below. ```
Input: Image matrix to be encrypted \(\mathbf{P}=\{P(i,j)\,|\,i=1,



**Step 2:** Construct a column vector consisting of \(M\) identical constants \(C_{0}\): \(\mathbf{c}=[C_{0}\), \(C_{0}\),... \(]^{T}\) and pre-allocate the storage space of \(M\)\(\times\)\(N\) elements for the future encrypted image \(\mathbf{C}\).