# A Novel CDMA-Based Secret Message Multiplexing Scheme by Image Data Hiding +
## 3 The Proposed Secret Message Multiplexing Scheme
### Secret Embedding Procedure
\[f(x_{i})=x_{i}\bmod(2N+1) \tag{3}\]  
where \(x_{i}\) denotes the \(i\)-th term of the pixel sequence and the converted result \(f_{i}\equiv f(x_{i})\) is a \((2N+1)\)-ary number. To facilitate embedding, \(N\) is added to each CDMA codeword digit such that the value range is shifted to \([0,\ 2N]\). Next, we compare the \(i\)-th digit of the modified CDMA codeword, \(sc_{i}\) (\(1\leq i\leq L\times N\)), with \(f_{i}\). No modification is needed if \(sc_{i}\) is equal to \(f_{i}\). When \(sc_{i}\
eq f_{i}\), we calculate the difference value  
\[d_{i}=sc_{i}-f_{i}\bmod(2N+1) \tag{4}\]  
If \(d_{i}\) is not larger than \(N\), we increase the value of \(x_{i}\) by \(d_{i}\) ; otherwise, decrease the value of \(x_{i}\) by \((2N+1-d_{i})\). After all pixels are modified, the one-dimensional pixel sequence \(\{x^{\prime}_{n}\}\) is restored to the marked image \(I^{\prime}\) with size \(H\times W\) and the embedding process is complete. Note that after data embedding, it is possible that the grayscale values of some pixels in the marked image exceed the upper bound (255 for an 8-bit grayscale image) or the lower bound (0 for an 8-bit grayscale image). This is caused by the addition or subtraction operations performing on pixel values close to 255 or 0. To avoid overflow or underflow from occurring, a straightforward procedure is adopted. When the modified pixel value \(x^{\prime}_{i}\) is less than zero, \(2N+1\) is added to \(x^{\prime}_{i}\); when \(x^{\prime}_{i}\) is larger than 255, \(2N+1\) is subtracted from \(x^{\prime}_{i}\). The secret embedding procedure is summarized in the following steps. * Perform CDMA multiplexing on the \(N\) individual \(L\)-bit secret messages \(S_{1}\), \(S_{2}\),... \(S_{N}\) to form a CDMA codeword with \(L\times N\) digits. For each digit in the codeword, increase the value by \(N\). * Rearrange the original image \(I\) into a one-dimensional sequence \(\{x_{n}\}\) of length \(H\times W\). Map each pixel value \(x_{i}\) to a \((2N+1)\)-ary number \(f_{i}\) accoridng to Equation (3). * Calculate the difference value between the CDMA codeword digit \(sc_{i}\) and the modular pixel value \(f_{i}\) according to Equation (4). * Compute the marked pixel value \(x^{\prime}_{i}\) by \[x^{\prime}_{i}= \begin{cases}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ x_{i}+d_{i},&d_{i}\ \leq N,\\ x_{i}-(2N+1-d_{i}),&\text{otherwise}.\end{cases} \] (5) when overflow/underflow occurs, do \[x^{\prime}_{i}= \begin{cases}\ \ \ \ x^{\prime}_{i}+(2N+1),&x^{\prime}_{i}<0,\\ x^{\prime}_{i}-(2N+1),&x^{\prime}_{i}>255.\end{cases} \] (6) Step 5. Convert the one-dimensional marked pixel sequence \(\{x^{\prime}_{n}\}\) to the marked image \(I^{\prime}\) with size \(H\times W\). Here, we take the four-user example described in the previous section to further explain our proposed secret multiplexing scheme. The whole CDMA codeword contains 12 digits. For simplicity, just take the first four digits \([0\ 0\ 4\ 0]\), for data embedding. The corresponding original secret messages for four users are 1, 1, 0, and 0, respectively. First, \(N=4\) is added to \([0\ 0\ 4\ 0]\). The resulting CDMA codeword vector is denoted as \(S_{c}=[4\ 4\ 8\ 4]\). Then, we select a group of four consecutive pixels from the 512 \(\times\) 512 grayscale image Lena to form the vector \(X=[162\ 157\ 163\ 161]\). The mapping function \(f\) converts vector \(X\) to a 9-ary vector \(X_{f}=[0\ 4\ 1\ 8]\). Next, calculate the difference between \(S_{c}\) and \(X_{f}\). The result is \(D=[4\ 0\ 7\ 5]\). It means that among the four digits of \(X\), only the second digit need not be modified, while the first digit should be increased by 4 and the third and fourth digits would be decreased by 2 and 4, respectively. Therefore, the modified pixel vector is \(X^{\prime}=[166\,157\,161\,157]\). At this instant, the four secret message bits \((1,\,1,\,0,\,0)\), each belonging to one individual user, have been embedded into the pixel vector through the proposed CDMA multiplexing scheme.