# A Novel CDMA-Based Secret Message Multiplexing Scheme by Image Data Hiding +
## 3 The Proposed Secret Message Multiplexing Scheme
### Secret Embedding Procedure  
In this subsection, we design a secret multiplexing scheme where there is a secret distributor to deliver individual secret messages to \(N\) participants via a digital image. Each participant can only extract his or her own secret message using a correct secret key. For illustrative purposes, we used the Hadamard matrix of order \(N\) to generate secret keys. Hadamard codes have excellent cross-correlation properties but the structure is regular and well-known. To reduce the risk of eavesdropping in realistic applications, besides Hadamard codes, other types of PN codes, such as Maximum Length sequences and Gold codes, could also be used as the secret keys [34]. Maximum Length sequences, also known as \(m\)-sequences, can be generated using linear generator polynomials of degree \(m\) as given by  
\[g(x)=g_{m}x^{m}+g_{m-1}x^{m-1}+g_{m-2}x^{m-2}+\cdots+g_{1}x+g_{0}, \tag{1}\]  
where \(g(x)\) is a primitive polynomial and the \(m\)-sequence generated has a period of \(n=2^{m}-1\). For instance, \(x^{5}+x^{3}+1\) is one of six usable primitive polynomials to generate \(m\)-sequences of length \(n=2^{5}-1=31\). The periodic autocorrelation function of \(m\)-sequences is  
\[R_{kk}(j)=\left\{ \begin{array}{c}n,j=0,\\ -1,1\leq j\ \leq n-1,\end{array} \right. \tag{2}\]  
where \(j\) denotes the number of cyclic shifts of the m-sequence. As \(m\) increases, the number of \(m\)-sequences of length \(n=2^{m}-1\) is enlarged. The lowest achievable cross-correlation between two different \(m\)-sequences is \(-1\). Moreover, due to the excellent autocorrelation properties, different offsets of the same \(m\)-sequence can also be used by different participants. The combinations of different primitive polynomials and cyclic shifts could provide a large number of secret keys. A set of Gold codes is constructed from a preferred pair of \(m\)-sequences, \(\mathbf{a}=[a_{1}a_{2}...a_{n}]\) and \(\mathbf{b}=[b_{1}b_{2}...b_{n}]\), by taking the modulo\(-2\) sum of \(\mathbf{a}\) with the \(n\) cyclically shifted versions of \(\mathbf{b}\) and vice versa. Thus, including the original sequences \(\mathbf{a}\) and \(\mathbf{b}\), a total of \(n+2\) Gold codes with period \(n=2^{m}-1\) and a cross-correlation as low as \(-1\) is generated. Regardless of \(m\)-sequences, Gold codes, or Hadamard codes, when the number of codes with a specified length is large enough, a subset of available secret keys could be chosen to accommodate all participants. In this case, data security is further improved. To fit with the characteristics of the Hadamard matrix, \(N\) is assumed to be power-of-2. The flowchart of secret embedding procedure is shown in Figure 2. Suppose the \(N\) individual secret messages \(S_{1}\), \(S_{2}\),... \(S_{N}\) are all \(L\)-bit long. After converting to an antipodal signal and multiplied by the secret key, every secret message will be spread to \(L\times N\)-bit long. Then, all the \(N\) sets of spread bits are added together to form the CDMA codeword with \(L\times N\) digits. Note that because of signal superimposition, the amplitude of a CDMA codeword is enlarged. Obviously, the value of a codeword digit lies on the range \([-N,+N]\), which can be represented as a number in the \((2N+1)\)-ary notational system. Let the original image \(I\) be a grayscale image with size \(H\times W\). The image is rearranged in the raster scan order into a one-dimensional sequence \(\{x_{n}\}\) of length \(H\times W\). Here, we assume that \(H\times W\) is divisible by \(N\) and \(L\times N\) equals \(H\times W\). In this case, the embedding capacity will reach the maximum value. Note that when \(N\) is not power-of-2 or \(H\times W\) cannot be divided by \(N\), the scheme is still applicable only with some capacity reduction. Figure 2: A flowchart of the secret embedding procedure. To embed a \((2N+1)\)-ary number into a grayscale pixel, we define a CDMA codeword mapping function \(f\) for the pixel value with modulo operation.