## 3 Design and Implementation of the Proposed Scheme
### Diffusion of Image Pixels  
Step 2. The top values of matrix P are preserved, while the top value of each odd column is used to perform a bitwise exclusive OR operation with all values in the corresponding even column, excluding the top value. Similarly, the top value of each even column is used to perform a bitwise exclusive OR operation with all values in the corresponding odd column, also excluding the top value to obtain matrix H. Figure 4 and Equation (6) illustrate the process of performing a bitwise exclusive OR operation on the matrix, where \(x\) and \(y\) represent odd and even columns, respectively, and \(i\), \(j\) represent the different image pixel positions within the matrix at the nth position. \[ \begin{cases}x(i,j+n)=y(i+1,0)\oplus x(i,j+n)\\ y(i,j+n)=x(i-1,0)\oplus y(i,j+n)\end{cases}  \tag{6}\]  
Step 3. In this process, all elements in a matrix \(H^{\prime}\) are encrypted using the Hill Cipher technique, in which a predefined \(2\times 2\) secret key K is used to encrypt the diffusion matrix \(H^{\prime}\). The process involves iterating over the \(4\times 4\) block matrix until the entire image is encrypted. To ensure that the encryption is secure, a modulo operation of 256 is performed on each element of the matrix during the process, as shown in Equation (7), to have intermediary Ciphertext \(K_{1}\). \[K_{1}=\text{mod}\big{(}\big{(}H^{\prime}\times K),256\big{)} \tag{7}\]  
Step 4. In this process, a sigmoid logistic map is used to randomly generate secret keys \(K_{2}\)&\(K_{3}\) according to Equation (8). Secret key \(K_{2}\) is used in the exclusive operation with secret key elements \(K_{1}\) to obtain intermediary Ciphertext \(K_{4}\), as shown in Equation (9). This helps to ensure that the secret keys are unique and more secure. \[K_{2}\&K_{3}=\bigg{|}r\times\bigg{(}\frac{x}{1+exp(x)}\bigg{)}\times\bigg{(}1 -\bigg{(}\frac{x}{1+exp(x)}\bigg{)}\bigg{)}\bigg{|} \tag{8}\]  
Figure 4: Diffusion process 1. Figure 3: Shift rows transformation. \[K_{4}=K_{1}\oplus K_{2} \tag{9}\]  
Step 5. In this stage of the diffusion process, the Kronecker xor transformation process is applied to matrix \(K_{4}\), expanding the image from size \(n\times n\) to size \(n^{2}\times n^{2}\). To further obscure the original message, the columns or rows of the matrix are shifted by the \(i^{th}\) positions, where \(i\) acts as the secret key in the process. In the proposed technique, the rows are moved down, and the value of \(i\) is chosen as \(i=3\). Each element of the matrix \(K_{4}\) undergoes a bitwise exclusive OR operation with the other elements of \(K_{4}\), while its value remains unchanged to form the image (secret keys) \(K_{5}\). The Kronecker xor product, as shown in Equation (11), illustrates the operation process on a \(2\times 2\) block matrix M, which is a part of \(K_{4}\), as shown in Equation (10). This helps to ensure that the diffusion process is secure and resistant to attacks. Figure 5 shows the expansion of the \(2\times 2\) encrypted image that results in the \(4\times 4\) matrix. \[M= \begin{bmatrix}i,j&i+1,j\\ i,j+1&i+1,j+1\end{bmatrix}  \tag{10}\]  
\[M\oplus M\Leftarrow K_{5}= \begin{bmatrix}(i,j)&(i,j)\oplus(i+1,j)&(i+1,j)&(i+ 1,j)\\ (i,j)\oplus(i,j+1)&(i,j)\oplus(i+1,j+1)&(i,j+1)\oplus(i+1,j)&(i+1,j)\oplus(i+1, j+1)\\ (i,j)\oplus(i,j+1)&(i,j+1)\oplus(i+1,j)&(i,j)\oplus(i+1,j+1)&(i+1,j)\oplus(i+1, j+1)\\ (i,j+1)&(i,j+1)\oplus(i+1,j+1)&(i,j+1)\oplus(i+1,j+1)&(i+1)\oplus(j+1)\end{bmatrix}  \tag{11}\]  
The use of the Kronecker xor product aims to obscure the original message and prevent unauthorized access to the information being transmitted. By expanding the image and shifting the rows or columns, the resulting encrypted image can be made to appear significantly different from the original, making it more difficult for unauthorized users to infer the contents of the message. Additionally, the use of a secret key in the transformation process adds an additional layer of protection, as the original message can only be decrypted with knowledge of the key. Step 6.