**Ji-Hwei Horng 1, Shuying Xu 2,\*, Ching-Chun Chang <sup>3</sup> and Chin-Chen Chang 2,4**


Received: 16 April 2020; Accepted: 9 May 2020; Published: 11 May 2020

**Abstract:** The massive Internet of Things (IoT) connecting various types of intelligent sensors for goods tracking in logistics, environmental monitoring and smart grid management is a crucial future ICT. High-end security and low power consumption are major requirements in scaling up the IoT. In this research, we propose an efficient data-hiding scheme to deal with the security problems and power saving issues of multimedia communication among IoT devises. Data hiding is the practice of hiding secret data into cover images in order to conceal and prevent secret data from being intercepted by malicious attackers. One of the established research streams of data-hiding methods is based on reference matrices (RM). In this study, we propose an efficient data-hiding scheme based on multidimensional mini-SuDoKu RM. The proposed RM possesses high complexity and can effectively improve the security of data hiding. In addition, this study also defines a range locator function which can significantly improve the embedding efficiency of multidimensional RM. Experimental results show that our data-hiding scheme can not only obtain better image quality, but also achieve higher embedding capacity than other related schemes.

**Keywords:** data hiding; multidimensional; embedding efficiency; mini-SuDoKu; security

### **1. Introduction**

We live in the information age in which no such immense amounts of digital information have ever before been consistently transmitted over open communication channels. As a consequence, information security has become a research hotspot. Today, there are two types of strategies for securing information against unauthorized access during transmission. The first type of methods encrypts data by cryptographic algorithms such as RSA [1], DES [2], elliptic-curve signcryption [3] and the blockchain-based solution [4]. However, the use of encryption would easily attract the attention of malicious attackers, causing them to intercept the encrypted data and subsequently use computers of sufficient power to break the encryption [5]. By contrast, the second type of methods hides secret data into cover images by steganographic algorithms and therefore conceals the existence of secret data [6]. After the recipient obtains the stego images, the secret data can be decoded through the corresponding algorithm. Steganographic methods can effectively prevent the interception of the secret data because they conceal the very fact that secret data exists. Indeed, this type of methods has attracted an increasing amount of research attention.

Most data-hiding schemes are performed in the following three domains: frequency domain [7,8], compression domain [9–12] and spatial domain [13–16]. Most developers are devoted to devise data-hiding schemes in the spatial domain due to its explicitness and convenience for implementations [17–19]. For spatial domain-based data-hiding schemes, reference matrices (RM), as a means of modifying pixels, can achieve low distortion and high embedding capacity. The concept of RM originated from the exploiting modification-direction (EMD) scheme proposed by Zhang and Wang [16] in 2006. Kim et al. proposed an improved version called EMD-2, which modifies the value of up to two pixels in a unit [14]. Compared to the original EMD scheme, this scheme improves the embedding capacity while ensuring the image quality. As another follow-up work, Chang et al. utilized SuDoKu tables as the RM [20]. In this scheme, each pixel pair in the cover image can hide a 9-ary binary secret data, which greatly increases the hiding capacity. Hong et al. [21] proposed a scheme that calculates the distance between pixels by the nearest Euclidean distance, which obtained even better image quality. Turtle shell-based RM is characterized by hexagon shaped shells and is able to hide 3 bits of secret information per pixel [22]. Liu et al. classified the locations on the turtle shell matrix into 16 situations to further improve the embedding capacity with the aid of a location table [23]. Jin et al. combined the data-hiding schemes of the turtle shell and swarm optimization algorithm to improve the visual quality of the image [24]. Our method is inspired by He et al.'s mini-SuDoKu matrix (MSM) [25]. More details of related works will be presented in the following section.

In this study, we propose a 3D RM based on the MSM. Using the 3D-MSM for data hiding can hide more secret data while ensuring image quality. The main contributions of this study are as follows: First, this study proposes a novel 3D reference matrix based on the MSM matrix. Second, it achieves good image quality and embedding capacity. Third, an efficient algorithm is devised to embed secret data. Finally, the proposed algorithm can be generalized to RM of arbitrary N dimensions.

The rest of this study is organized as follows: Section 2 briefly introduces two data-hiding algorithms based on reference matrices. Section 3 introduces the 3D MSM proposed in this study, presents the embedding process, and analyzes the time efficiency of the proposed algorithm. Section 4 compares the proposed scheme with other RM-based data-hiding schemes.

#### **2. Related Work**

Recent RM-based data-hiding schemes can be characterized into turtle shell-based schemes and SuDoKu-based schemes. In order to pave the way for our idea of multidimensional mini-SuDoKu RM, these two types of matrices are briefly reviewed.

#### *2.1. Turtle Shell Matrix Data Hiding*

 In the turtle shell-based scheme proposed by Liu et al. [23], the turtle shell matrix *M* = *<sup>m</sup>*(*i*, *<sup>j</sup>*)*i*,*j*∈{0,1,··· ,255} is consisted of a number of hexagons, called turtle shells, with a size of 256 × 256, as shown in Figure 1. The RM is filled with 8-ary digits, the incremental value of each row is always 1, while the incremental value of each column change of 2 and 3 in turn. Hence, each turtle shell structure in Figure 1 contains distinct values from 0 to 7. In order to further improve the hiding capacity, a location table is constructed as shown in Figure 2. The location table *T* contains all 16 possible situations of turtle shell in the RM. The 16 situations in the location table can be grouped into four categories, as shown in Figure 3. According to the characteristics of the RM, the set of values of elements matching location 1 and location 4 is always {1,3,5,7} and matching location 2 and location 3 is always {0,2,4,6}. Each location in the location table *T* can be represented by *T*(*si*,*si*+1), where *si* indicates the i-th row, and *si*+<sup>1</sup> indicates the (i+1)-th column, and *si* and *si*+<sup>1</sup> belong to {00,01,10,11}.

Next, the process of data hiding is described below. First, the original image is cut into pixel pairs (*Pi*, *Pi*+1), and the binary secret data stream is cut into two sub-streams *sj* and *sj*+1, each of which contains a 2-bit binary number. Second, a pair of cover pixels (*Pi*, *Pi*+1) is applied to locate an element *m*(*Pi*, *Pi*+1) in the RM. After that, employ - *sj*,*sj*+<sup>1</sup> as coordinates to find the corresponding *T* - *sj*,*sj*+<sup>1</sup> in the location table. Then, find the closest element, making *m*(*Pi* , *Pi*+<sup>1</sup> ) = *T* - *sj*,*sj*+<sup>1</sup> . Finally, modify the values of the pixel pair to embed it.

By taking relative location of a number in the turtle shell into account, this data-hiding scheme improves the embedding capacity of the original turtle shell scheme from 1.5 to 2. However, the image quality is degraded due to increase of embedding area.

**Figure 1.** Turtle shell reference matrix.

**Figure 3.** Four locations of elements in M.

#### *2.2. Mini SuDoKu Matrix-Based Data Hiding*

The SuDoKu is a matrix which contains nine 3 × 3 sub-matrices with numbers from 1 to 9. In addition, each number is used only once in each raw and each column. Inspired by the conventional SuDoKu, the mini-SuDoKu matrix (MSM) [25] was proposed.

As shown in Figure 4, the MSM is a matrix that contains 4096 4 × 4 submatrices, and each submatrix contains 4 basic structures. Each basic structure is filled with numbers from 0 to 3. In addition, the digits from 0 to 3 must occur just once in each row and each column of the submatrix.

**Figure 4.** Mini-SuDoKu reference matrix.

The data-hiding scheme using MSM is briefly described as follows: First, the original image is cut into pixel pairs (*pk*, *pk*<sup>+</sup>1). The secret data stream is cut into four-bit substreams *sgd* = {*s*4*d*−3,*s*4*d*−2,*s*4*d*−1,*s*4*d*}, and then we divide *sgd* into three groups, i.e., *B*<sup>1</sup> = *s*4*d*−3*s*4*d*−2, *B*<sup>2</sup> = *s*4*d*−1, *B*<sup>3</sup> = *s*4*d*. Thus, *B*<sup>1</sup> is a quaternary digit from 0 to 3 and *B*2/*B*<sup>3</sup> is a bit of 0 or 1. Second, take the pixel pair as coordinates and locate *MSM*(*pk*, *pk*<sup>+</sup>1) in the MSM. Then, a 4 × 4 candidate block *G* is determined by (1). Find the element *MSM*(*pk* , *pk*<sup>+</sup><sup>1</sup> ) within *G* satisfying *m*(*pk* , *pk*<sup>+</sup><sup>1</sup> ) = *B*1, *mod*- *p k* , 2 = *B*<sup>2</sup> and *mod*- *p k*+1 , 2 = *B*3. Finally, modify the pair (*pk*, *pk*<sup>+</sup>1) to (*pk* , *pk*<sup>+</sup><sup>1</sup> ). We can embed the secret data and get the stego image by repeating these steps.

$$G = \begin{cases} \begin{array}{c} \text{MSM}(0:3,0:3), \text{ if } p\_k \le 1 \text{ and } p\_{k+1} \le 1; \\ \text{MSM}(0:3,p\_{k+1}-2:p\_{k+1}+1), \text{ if } p\_k \le 1 \text{ and } 1 < p\_{k+1} < 255; \\ \text{MSM}(0:3252:255), \text{ if } p\_k \le 1 \text{ and } p\_{k+1} = 255; \\ \text{MSM}(p\_k-2:p\_k+1,0:3), \text{ if } 1 < p\_k < 255 \text{ and } p\_{k+1} \le 1; \\ \text{MSM}(p\_k-2:p\_k+1,p\_{k+1}-2:p\_{k+1}+1), \text{ if } 1 < p\_k < 255 \text{ and } 1 < p\_{k+1} < 255; \\ \text{MSM}(p\_k-2:p\_k+1,p\_{k+1},252:255), \text{ if } 1 < p\_k < 255 \text{ and } p\_{k+1} = 255; \\ \text{MSM}(252:255,0:3), \text{ if } p\_k = 255 \text{ and } p\_{k+1} \le 1; \\ \text{MSM}(252:255,p\_{k+1}-2:p\_{k+1}+1), \text{ if } p\_k = 255 \text{ and } 1 < p\_{k+1} < 255; \\ \text{MSM}(252:255,252:255), \text{ otherwise} \end{array} \tag{1}$$

The mini-SuDoKu matrix suffers from the problem of low security level. There are too many constraints on the construction rules. Each row, each column and each basic structure of size 2 × 2 must contain distinct values of 0 to 3. To obtain a better PSNR (peak signal to noise ratio) performance, the candidate block for a regular element is defined as *MSM*(*pk* − 2 : *pk* + 1, *pk*<sup>+</sup><sup>1</sup> − 2 : *pk*<sup>+</sup><sup>1</sup> + 1). The two axial ranges of the candidate block do not always coincide with an original 4×4 submatrix. To satisfy the translational invariant requirement for embedding, the whole MSM should repeat the same 4 × 4 submatrix. In addition, the candidates of embedding should satisfy *mod*- *p k* , 2 = *B*<sup>2</sup> and *mod*- *p k*+1 , 2 = *B*3. An example grouping of embedding candidates for different combinations of *B*<sup>2</sup> and *B*<sup>3</sup> is shown in Figure 5. The elements in the same group also should contain all values of 0 to 3. These requirements severely restrict the variety of the MSM and thus threaten the security of data hiding.

**Figure 5.** Candidates of embedding for different combinations of *B*<sup>2</sup> and *B*3.

#### **3. The Proposed Scheme**

In this section, we will introduce the proposed cubic mini-SuDoKu matrix and a two-layered data-hiding scheme based on the proposed matrix. Then, the matrix and its corresponding data-embedding and extraction algorithm will be generalized to n-dimensional version. Some mechanisms for improving the time efficiency will also be presented.

#### *3.1. Cubic Mini-SuDoKu Matrix (CMSM)*

In this study, we propose a two-layered hiding scheme based on a cubic mini-SuDoKu matrix. By leveraging the proposed cubic mini-SuDoKu matrix, the proposed data-hiding scheme can embed secret data with an efficient way and produce stego images of good visual quality.

#### 3.1.1. Construction of the Cubic Mini-SuDoKu Matrix

The cubic mini-SuDoKu matrix is a 256 × 256 × 256 matrix that contains 64 × 64 × 64 sub-cubes of size 4 × 4 × 4. Each sub-cube contains eight basic structures of size 2 × 2 × 2. The basic structures are labeled with bold Arabic numerals as shown in Figure 6. Elements of each basic structure are randomly assigned with distinct values of 0 to 7. The resulting RM is denoted as *M*(*x*, *y*, *z*), *x*, *y*, *z* = 0, 1, ... , 255.

Before embedding, secret data and cover image should be prepared. Binary secret stream is divided into segments of 6 digits each, while the pixels of the cover image are grouped into triplets. A set of three pixels in a triplet - *pxi*, *pyi*, *pzi* is used to embed a secret segment of 6 digits *sj* = - *dj* 5*dj* 4*dj* 3*dj* 2*dj* 1*dj* 0 . First, the values of the three cover pixels are applied as the coordinates to locate a reference element in the 3D RM. Then, a two-layered embedding scheme is executed. The outer layer is to obtain a matched basic structure by using the three most significant bits (3 MSBs) of secret segment *s<sup>M</sup> <sup>j</sup>* <sup>=</sup> - *dj* 5*dj* 4*dj* 3 . Subsequently, the inner layer of embedding is to find an element within the obtained basic structure with a value matching the three least significant bits (3 LSBs) *sL <sup>j</sup>* <sup>=</sup> - *dj* 2*dj* 1*dj* 0 . Finally, the pixel values are modified to the indices of the matched element.

**Figure 6.** Architecture of cubic matrix.

To improve the efficiency of outer layer embedding, we define a range locator function *G* to identify the precise searching range for each direction of axis. By combining ranges of all axes, the basic structure matching the 3 MSBs can be determined.

Let *p* be the pixel value and *w* = *mod*(*p*, 4) as shown in Figure 7. We always apply the segment [0:1] of *w* to embed secret digit *d* = 0, while apply the segment [2:3] of *w* to embed *d* = 1. To meet this constraint and minimize the modification distortion, we choose the nearest formal segment to embed. For convenience, we define a range front matrix Δ to record the offset values from the current pixel to the range front of embedding. In the case of *d* = 0, the offset is −2 for *mod*(*p*, 4) = 2; +1 for *mod*(*p*, 4) = 3; 0 and −1 for *mod*(*p*, 4) = 0 and 1, respectively. In the case of *d* = 1, the offset is −2 for *mod*(*p*, 4) = 0; +1 for *mod*(*p*, 4) = 1; 0 and −1 for *mod*(*p*, 4) = 2 and 3, respectively. The resulting offset matrix Δ and range locator function *G* for the entire axis are given in Equations (2) and (3), respectively.

**Figure 7.** Illustration of incremental value Δ for different situations.

$$
\Delta = \begin{bmatrix}
\mathbf{0} & \mathbf{-1} & \mathbf{-2} & \mathbf{+1} \\
& \mathbf{-2} & \mathbf{+1} & \mathbf{0} & \mathbf{-1}
\end{bmatrix} \tag{2}
$$

$$
G(p,d) = \begin{cases}
& [0:1], \text{ if } p = 0 \text{ and } d = 0; \\
& [2:3], \text{ if } p = 0 \text{ and } d = 1; \\
& [252:253], \text{ if } p = 255 \text{ and } d = 0; \\
& [254:255], \text{ if } p = 255 \text{ and } d = 1; \\
& [p':p'+1] \text{ with } p' = p + \Delta(d, \text{mod}(p, 4)), \text{ if } 1 \le p \le 254.
\end{cases} \tag{3}
$$

Figure 8 illustrates an example of combining ranges of three axes. Assuming the cover triplet is - *pxi*, *pyi*, *pzi* = (2, 3, 2) and the 3 MSBs of the secret segment to be embedded is *sM <sup>j</sup>* = - *dj* 5*dj* 4*dj* 3 = (110)2. By applying the range locater, the embedding range of each axis can be determined independently as *G* - *pxi*, *<sup>d</sup><sup>j</sup>* 3 = *G*(2, 0) = [2 + Δ(0, 2) : 2 + Δ(0, 2) + 1] = [0:1], *G* - *pyi*, *<sup>d</sup><sup>j</sup>* 4 = *G*(3, 1) = [3 + Δ(1, 3) : 3 + Δ(1, 3) + 1] = [2:3] and *G* - *pzi*, *<sup>d</sup><sup>j</sup>* 5 = *G*(2, 1) = [2 + Δ(1, 2) : 2 + Δ(1, 2) + 1] = [2:3]. As shown in the figure, the basic structure obtained by combining the located ranges is *M*(0 : 1, 2 : 3, 2 : 3). Comparing with Figure 6, the basic structure obtained by applying *sM <sup>j</sup>* = (110)<sup>2</sup> to range locater coincides with the structure labeled 6= (110)2. This result demonstrates that the range locater can be treated as an efficient tool for the outer layer of embedding scheme.

**Figure 8.** Locating the basic structure for embedding by combining ranges of three axes.

### 3.1.2. Secret Data Embedding

As mentioned in the previous subsection, the proposed data-embedding scheme is composed of two hiding layers. The outer layer uses the 3 MSBs to locate the nearest formal basic structure for embedding. The inner layer seeks to find the element with a value matching the 3 LSBs and embeds the 6 digits in total by modifying the pixel values. The details of secret data embedding are as follows:

The secret data-embedding algorithm based on the cubic mini-SuDoKu matrix (CMSM) Input: cover image *P*, secret stream *S*, secret key *K*

Output: stego image *P* Step 1: Construct the CMSM *M* using the secret key *K* (details are given in Appendix A)


Step 2: Group the cover pixels into triplets *P* = - *pxi*, *pyi*, *pzi <sup>i</sup>* <sup>=</sup> 1, 2, ... , (*<sup>H</sup>* <sup>×</sup> *<sup>W</sup>*)/3 ;

Step 3: Segment secret digits *S* = *sj* = - *dj* 5*dj* 4*dj* 3*dj* 2*dj* 1*dj* 0 *<sup>j</sup>* <sup>=</sup> 1, 2, ... , *<sup>L</sup>*/6 ;

Step 4: Locate *M* - *G* - *pxi*, *<sup>d</sup><sup>j</sup>* 3 , *G* - *pyi*, *<sup>d</sup><sup>j</sup>* 4 , *G* - *pzi*, *<sup>d</sup><sup>j</sup>* 5 by applying Equations (2) and (3);

Step 5: Search the matching element in the located basic structure;

$$\mathcal{M}(p'\_{xi'}p'\_{yi'}p'\_{zi}) = \left(2^2 \times d\_2^j + 2^1 \times d\_1^j + 2^0 \times d\_0^j\right);$$

Step 6: Record *p xi*, *p yi*, *p zi* to stego image *P* ;

Step 7: Repeat Steps 4–6, until all secret digits are embedded.

In the embedding algorithm, we use a secret key *K* to initialize the random number generator. Each basic structure is stored with a random permutation of 0 to 7. The number of different CMSM is (8!) <sup>128</sup>×128×128. To reduce the computational load of the matrix, we can produce a randomly generated matrix of size, for example, 16 × 16 × 16 and repeat it to obtain a 256 × 256 × 256 CMSM. The number of different permutations is (8!) <sup>16</sup>×16×16, which is still much secure than the 2D mini-SuDoKu version [23]. By sharing the initialization key for the random number generator, the receiver can reconstruct the CMSM using the same rule.

In the following, three examples are used to further explain the secret data-embedding process as shown in Figure 9. Assume the three triplets are {(1, 1, 2),(1, 3, 2),(1, 5, 2)}, which will be used to hide the secret segments {(001010)2,(101010)2,(000000)2}.

For the triplet (1,1,2) as shown by the purple submatrix in Figure 9a, the secret data *sj* = - *dj* 5*dj* 4*dj* 3*dj* 2*dj* 1*dj* 0 = (001010)<sup>2</sup> is to be hidden. First, use triplet (1,1,2) and 3 MSBs *s<sup>M</sup> <sup>j</sup>* = (001)<sup>2</sup> to locate the basic structure *G* - *pxi*, *<sup>d</sup><sup>j</sup>* 3 = *G*(1, 1) = [1 + Δ(1, 1) : 1 + Δ(1, 1) + 1] = [2:3], *G* - *pyi*, *<sup>d</sup><sup>j</sup>* 4 = *G*(1, 0) = [1 + Δ(0, 1) : 1 + Δ(0, 1) + 1] = [0:1], *G* - *pzi*, *<sup>d</sup><sup>j</sup>* 5 = *G*(2, 0) = [2 + Δ(0, 2) : 2 + Δ(0, 2) + 1] = [0:1], and *M* - *G* - *pxi*, *<sup>d</sup><sup>j</sup>* 3 , *G* - *pyi*, *<sup>d</sup><sup>j</sup>* 4 , *G* - *pzi*, *<sup>d</sup><sup>j</sup>* 5 <sup>=</sup> *<sup>M</sup>*(2 : 3, 0 : 1, 0 : 1). Then, *<sup>M</sup>*(2, 1, 1) <sup>=</sup> 22 <sup>×</sup> <sup>0</sup> <sup>+</sup> 21 <sup>×</sup> <sup>1</sup> <sup>+</sup> <sup>2</sup><sup>0</sup> <sup>×</sup> 0 = 2 can be found in the located basic structure and record (2, 1, 1) to stego image *P* .

For the second example of (1,3,2) as shown by the red submatrix in Figure 9b, the secret data *sj* = - *dj* 5*dj* 4*dj* 3*dj* 2*dj* 1*dj* 0 = (101010)<sup>2</sup> is to be hidden. First, use triplet (1,3,2) and 3 MSBs *s<sup>M</sup> <sup>j</sup>* = (101)<sup>2</sup> to locate the basic structure *G* - *pxi*, *<sup>d</sup><sup>j</sup>* 3 = *G*(1, 1) = [1 + Δ(1, 1) : 1 + Δ(1, 1) + 1] = [2:3], *G* - *pyi*, *<sup>d</sup><sup>j</sup>* 4 = *G*(3, 0) = [3 + Δ(0, 3) : 3 + Δ(0, 3) + 1] = [4:5], *G* - *pzi*, *<sup>d</sup><sup>j</sup>* 5 = *G*(2, 1) = [2 + Δ(1, 2) : 2 + Δ(1, 2) + 1] = [2:3], and *M* - *G* - *pxi*, *<sup>d</sup><sup>j</sup>* 3 , *G* - *pyi*, *<sup>d</sup><sup>j</sup>* 4 , *G* - *pzi*, *<sup>d</sup><sup>j</sup>* 5 <sup>=</sup> *<sup>M</sup>*(2 : 3, 4 : 5, 2 : 3). Then, *<sup>M</sup>*(3, 4, 2) <sup>=</sup> 22 <sup>×</sup> <sup>0</sup> <sup>+</sup> 21 <sup>×</sup> <sup>1</sup> <sup>+</sup> <sup>2</sup><sup>0</sup> <sup>×</sup> 0 = 2 can be found in the located basic structure and record (3, 4, 2) to stego image *P* .

For the third triplet (1,5,2) as shown by the green submatrix in Figure 9c, the secret data *sj* = - *dj* 5*dj* 4*dj* 3*dj* 2*dj* 1*dj* 0 = (000000)<sup>2</sup> is to be hidden. First, use triplet (1,5,2) and 3 MSBs *s<sup>M</sup> <sup>j</sup>* = (000)<sup>2</sup> to locate the basic structure *G* - *pxi*, *<sup>d</sup><sup>j</sup>* 3 = *G*(1, 0) = [1 + Δ(0, 1) : 1 + Δ(0, 1) + 1] = [0:1], *G* - *pyi*, *<sup>d</sup><sup>j</sup>* 4 = *G*(5, 0) = [5 + Δ(0, 5) : 5 + Δ(0, 5) + 1] = [4:5], *G* - *pzi*, *<sup>d</sup><sup>j</sup>* 5 = *G*(2, 0) = [2 + Δ(0, 2) : 2 + Δ(0, 2) + 1] = [0:1], and *M* - *G* - *pxi*, *<sup>d</sup><sup>j</sup>* 3 , *G* - *pyi*, *<sup>d</sup><sup>j</sup>* 4 , *G* - *pzi*, *<sup>d</sup><sup>j</sup>* 5 <sup>=</sup> *<sup>M</sup>*(0 : 1, 4 : 5, 0 : 1). Then, *<sup>M</sup>*(1, 4, 1) <sup>=</sup> 22 <sup>×</sup> <sup>0</sup> <sup>+</sup> 21 <sup>×</sup> <sup>0</sup> <sup>+</sup> <sup>2</sup><sup>0</sup> <sup>×</sup> 0 = 0 can be found in the located basic structure and record (1, 4, 1) to stego image *P* .

(**b**) **Figure 9.** *Cont.*

(**c**)

**Figure 9.** Examples of data hiding with cubic mini-SuDoKu matrix (CMSM). (**a**) Hide (001010)<sup>2</sup> into cover triplet (1, 1, 2); (**b**) Hide (101010)<sup>2</sup> into cover triplet (1, 3, 2); (**c**) Hide (000000)<sup>2</sup> into cover triplet (1, 5, 2).

#### 3.1.3. Secret Data Extraction

After receiving the stego image *P* , the recipient first groups the stego pixels into triplets. Then, the secret segments can be obtained by mapping the triplets into the CMSM. For a located element, its corresponding secret segment includes the 3 MSBs determined by the label of basic structure it belongs to and the 3 LSBs determined by its value. The details of the extraction process are provided as follows:

The secret data extraction algorithm based on the cubic mini-SuDoKu matrix (CMSM) Input: stego image *P* , secret key *K*

Output: secret stream *S* Step 1: Construct the CMSM *M* using the secret key *K* (details are given in Appendix A)


Step 2: Group the stego pixels into triplets *P* = *<sup>p</sup> xi*, *p yi*, *p zi <sup>i</sup>* <sup>=</sup> 1, 2, ... , (*<sup>H</sup>* <sup>×</sup> *<sup>W</sup>*)/3 .

Step 3: Extract the 3 LSBs by *sL <sup>j</sup>* = ! *M p xi*, *p yi*, *p zi*" 2 . Step 4: Extract the 3 MSBs by

$$s\_{\mathbf{j}}^M = \left(d\_{5'}^{\mathbf{j}}, d\_{4'}^{\mathbf{j}}, d\_3^{\mathbf{j}}\right) = \left(\bmod(p'\_{xi'}.4)/2, \bmod(p'\_{yi'}.4)/2, \bmod(p'\_{xi'}.4)/2\right).$$

$$\underset{\underline{\underline{\underline{\underline{\underline{\mathcal{X}}}}},s}{}}{\text{Step 5: Concatenate }s\_{\underline{j}}} = s\_{\underline{j}}^{\mathcal{M}} s\_{\underline{j}}^{L}$$

. Step 6: Repeat Steps 3–5, until all secret digits are extracted.
