An Efficient Data-Hiding Scheme Based on Multidimensional Mini-SuDoKu

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.


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][10][11][12] and spatial domain [13][14][15][16]. Most developers are devoted to devise data-hiding schemes in the spatial domain due to its explicitness and convenience for implementations [17][18][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.

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.

Turtle Shell Matrix Data Hiding
In the turtle shell-based scheme proposed by Liu et al. [23], the turtle shell matrix M = m(i, j) 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(s i , s i+1 ), where s i indicates the i-th row, and s i+1 indicates the (i+1)-th column, and s i and s i+1 belong to {00,01,10,11}.
Next, the process of data hiding is described below. First, the original image is cut into pixel pairs (P i , P i+1 ), and the binary secret data stream is cut into two sub-streams s j and s j+1 , each of which contains a 2-bit binary number. Second, a pair of cover pixels (P i , P i+1 ) is applied to locate an element m(P i , P i+1 ) in the RM. After that, employ s j , s j+1 as coordinates to find the corresponding

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.  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.

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. 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.

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.

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

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.

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.

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 p xi , p yi , p zi is used to embed a secret segment of 6 digits s 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 ( . 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) s L j = d

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 dataembedding and extraction algorithm will be generalized to n-dimensional version. Some mechanisms for improving the time efficiency will also be presented.

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.

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 ( , , ), , , = 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 ( , , ) is used to embed a secret segment of 6 digits = . 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 = . 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) = . Finally, the pixel values are modified to the indices of the matched element. To improve the efficiency of outer layer embedding, we define a range locator function 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 be the pixel value and = ( , 4) as shown in Figure 7. We always apply the segment [0:1] of to embed secret digit = 0, while apply the segment [2:3] of to embed = 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 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.
The resulting offset matrix ∆ and range locator function for the entire axis are given in Equations (2) and (3), respectively. As shown in the figure, the basic structure obtained by combining the located ranges is (0: 1,2: 3,2: 3). Comparing with Figure 6, the basic structure obtained by applying = (110) to range locater coincides with the structure labeled 6 = (110) . This result demonstrates that the range locater can be treated as an efficient tool for the outer layer of embedding scheme.

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 , secret stream , secret key K Output: stego image Step 1: Construct the CMSM using the secret key K (details are given in Appendix A) (a) Apply the secret key K to initialize the random number generator; (b) Allocate an empty array of size 256 × 256 × 256 and divide it into blocks of size 2 × 2 × 2; (c) Fill in each block with random ordered 0 to 7, consecutively; Step 2: Group the cover pixels into triplets = ( , , ) = 1, 2, … , ( × )/3 ; Step 3: Segment secret digits = = = 1, 2, … , /6 ; Step 4: Locate , , , , , by applying Equation (2) and (3); Step 5: Search the matching element in the located basic structure; , , = 2 × +2 × +2 × ; Step 6: Record , , to stego image ; 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!) × × . 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!) × × , 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.

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) (a) Apply the secret key K to initialize the random number generator; (b) Allocate an empty array of size 256 × 256 × 256 and divide it into blocks of size 2 × 2 × 2; (c) Fill in each block with random ordered 0 to 7, consecutively; Step 2: Group the cover pixels into triplets P = p xi , p yi , p zi i = 1, 2, . . . , (H × W)/3 ; Step 3: Segment secret digits S = s j = d 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!) 128×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!) 16×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.

Secret Data Extraction
After receiving the stego image ′, 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 , secret key K Output: secret stream Step 1: Construct the CMSM using the secret key K (details are given in Appendix A) (a) Apply the secret key K to initialize the random number generator. (b) Allocate an empty array of size 256 × 256 × 256 and divide it into blocks of size 2 × 2 × 2.
(c) Fill in each block with random ordered 0 to 7, consecutively.

N-dimensional MSM (NMSM)
In this section, we introduce the construction of NMSM and the secret data-embedding and extraction algorithm, based on the NMSM. In addition, a fast algorithm for the inner embedding layer is proposed to improve the time efficiency.

The Data-Embedding and Extraction Algorithm
To boost the efficiency of data embedding and extraction, the proposed secret data-embedding scheme can be generalized to an n-dimensional version. In the NMSM, a basic structure consists of 2 elements and 2 basic structures constitute a submatrix. An n-tuple pixel group can uniquely map to an element in the NMSM. Therefore, by applying the same embedding rule, we can hide n

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) (a) Apply the secret key K to initialize the random number generator. (b) Allocate an empty array of size 256 × 256 × 256 and divide it into blocks of size 2 × 2 × 2.
(c) Fill in each block with random ordered 0 to 7, consecutively.
Step 3: Extract the 3 LSBs by s L j = M p xi , p yi , p zi 2 .
Step 4: Extract the 3 MSBs by Step 5: Concatenate s j = s M j s L j .

N-Dimensional MSM (NMSM)
In this section, we introduce the construction of NMSM and the secret data-embedding and extraction algorithm, based on the NMSM. In addition, a fast algorithm for the inner embedding layer is proposed to improve the time efficiency.

The Data-Embedding and Extraction Algorithm
To boost the efficiency of data embedding and extraction, the proposed secret data-embedding scheme can be generalized to an n-dimensional version. In the NMSM, a basic structure consists of 2 n elements and 2 n basic structures constitute a submatrix. An n-tuple pixel group can uniquely map to an element in the NMSM. Therefore, by applying the same embedding rule, we can hide n MSBs with the label of basic structure and n LSBs with the element value. The pseudo codes for the NMSM-based embedding and extraction schemes are given as follows: The secret data-embedding algorithm based on the n-dimensional mini-SuDoKu matrix (NMSM) Input: cover image P, secret stream S, secret key K Output: stego image P Step 1: Construct the NMSM M using the secret key K (details are given in Appendix B); (a) Make an n-dimensional array of size 16 n , which consists of 8 n submatrix; (b) Repeat the array to obtain NMSM; Step 2: Group the cover pixels into P = p X(0)i , p X(1)i , . . . , p X(n−1)i i = 1, 2, . . . , (H × W)/n ; Step 3: Segment secret digits S = s j = d Step 5: Search the matching element in the located basic structure Step 6: Record p X(0)i , p X(1)i , . . . , p X(n−1)i to stego image P ; Step 7: Repeat Steps 4-6, until all secret digits are embedded. The secret data extraction algorithm based on the n-dimensional mini-SuDoKu matrix (NMSM) Input: stego image P , secret key K Output: secret stream S Step 1: Construct the NMSM by the same process as Step 1 of embedding; Step 2: Group the stego pixels into P = p X(0)i , p X(1)i , . . . , p X(n−1)i i = 1, 2, . . . , (H × W)/n ; Step 3: Extract the n LSBs by s L j = M p X(0)i , p X(1)i , . . . , p X(n−1)i 2 ; Step 4: Extract the n MSBs by s M j = mod(p X(n−1)i , 4)/2, mod(p X(n−2)i , 4)/2, . . . , mod(p X(0)i , 4)/2 ; Step 5: Concatenate s j = s M j s L j ; Step 6: Repeat Steps 3-5, until all secret digits are extracted.

Fast Algorithm for the Inner Layer of Embedding
As the MSM generalized to n-dimensions, the basic structure for embedding can be efficiently determined by the range locator. However, the searching process in the Step 5 of embedding algorithm becomes burdensome. To improve time efficiency of the inner embedding layer, we devise a fast algorithm to overcome this burden. Its key idea is to leverage the matrix operation supported by the MATLAB language. The pseudo code of the fast algorithm is given as follows: More precise pseudo code expressed in MATLAB instructions is given in Appendix C.
Fast Algorithm for the Inner Embedding Layer (details are given in Appendix C) Input: n LSBs of secret segment s L j , basic structure for embedding Output: stego pixel values p X(0)i , p X(1)i , . . . , p X(n−1)i (a) Construct an n-dimensional basic structure B with all elements valued with s L j ; (b) Using matrix operation to find the only matched element in both A and B; (c) Project the element to all axes and obtain the coordinates for embedding.

Experimental Results
In the following, the experimental results of the proposed scheme will be presented and compared with the related works. As shown in Figure 10, this study uses eight standard 512 × 512 grayscale images and four standard 512 × 512 true color images as the cover image P for secret data embedding. All experiments are implemented with MATLAB R2017b. Figure 11 shows the twelve stego images obtained by applying the two-layered hiding scheme based on the CMSM.
Sensors 2020, 20, x FOR PEER REVIEW 11 of 19  The stego images look like the cover images and cannot be distinguished by human eyes. The peak signal-to-noise ratio (PSNR) is used to measure the quality of a stego image. Its calculation is given by Equation (4). In the equation, P and P represent the cover image and the stego image, respectively, H and W represent their height and width and (m, n) represents the coordinate of the pixel.
In addition, we also use structural similarity index (SSIM) to measure the similarity between a cover image and its corresponding stego image. Let P and P represent the cover image and the stego image, respectively, the SSIM of the two images can be obtained according to Equation (5), where µ P is the average of P, µ P is the average of P , σ 2 P is the variance of P, σ 2 P is the variance of P and σ PP is the covariance of P and P . In addition, c 1 and c 2 are constants used to maintain stability and can be obtained by Equations (6) and (7), respectively, where L is the dynamic range of pixel values, k 1 = 0.01, k 2 = 0.03. SSIM(P, P ) = (2µ P µ P + c 1 )(2σ PP + c 2 ) Embedding capacity (EC) is another important issue in the image steganography. It is used to measure the maximum amount of secret data that can be embedded in an image by a data-hiding scheme. Since EC is dependent on the image size, we further define the embedding rate (ER) to express the average number of secret bits that each pixel can embed. ER is defined as (8), where ||S|| represents the total amount of secret data embedded in the entire stego image. Table 1 shows the experimental results of the grayscale images. In our hiding scheme, three cover pixels are applied to embed a secret segment of six digits. Therefore, the ER measure is 6 bits/3 pixels = 2 bits/pixel, the embedding capacity for an applied grayscale cover image is therefore 512 × 512 × 2 = 524,288 bits as shown in the Under full embedding, the proposed scheme achieves a high image quality of PSNR = 46.37 dB and SSIM = 0.9923 in average. The quality of stego image is irrelevant to features of the cover image. For the true color images, each pixel consists of three channels, including red, green and blue. Each of the three channels is represented by one byte. By mapping the three bytes (r, g, b) of a pixel into the CMSM, we can hide a secret segment of six bits by applying the proposed embedding algorithm. Therefore, the embedding capacity of an applied true color image is 512 × 512 × 6 = 1,572,864 bits. The PSNR and SSIM of the true color stego images are very close to the experimental values of grayscale images as shown in Table 2.  Table 3 compares the PSNR of different reference matrices under the same EC. As shown in Table 3, Xie et al.'s scheme has the lowest average PSNR at 41.87 dB. The average PSNR of the proposed scheme is 46.37 dB, which is nearly 4 dB higher than the average PSNR of the Xie et al.'s scheme. Moreover, compared with the other two schemes, our scheme also achieves the highest PSNR with the same EC. It can be seen that the proposed scheme outperforms the related works. In order to further understand the performance of our scheme, it is compared with three other schemes [19,22,23] based on the SuDoKu reference matrix. As shown in Table 4, the EC of the Chang et al.'s scheme is 393,216 bits, and its average PSNR is 44.83 dB. Regardless of the EC or image quality, the proposed scheme outperforms the Chang et al.'s scheme. Comparing with the other two schemes, although their image quality are better than the proposed scheme, their embedding capacity are far lower than our scheme. Therefore, it can be concluded that the overall performance of the proposed scheme is better than the SuDoKu-based data-hiding schemes. In addition, we also compare the proposed CMSM-based scheme with the 3D SuDoKu-based scheme. As shown in Table 5, the average PSNR of the scheme proposed by Xia et al. is 41.31 dB, while the average PSNR of our scheme is 5 dB higher than their scheme. Based on the same frame structure of using 3D reference matrix, our scheme has a relatively small modification of pixel values under the same EC. Our scheme is inspired by the He et al.'s scheme. Except for expanding the 2D mini-SuDoKu to a 3D CMSM, our scheme effectively improved the complexity of reference matrix and efficiently reduced the computation time. As shown in Table 6, although our scheme has no advantage over the He et al.'s scheme in terms of EC and PSNR. However, the improvement in time consumption (TC) is obvious. As discussed in Section 2.2, to achieve a translation invariant property for minimizing the distortion of pixel value modification, the mini-SuDoKu has to repeat a same basic 4 × 4 submatrix. This severely damages the complexity of a reference matrix. In our scheme, in spite of CMSM or NMSM, each basic structure is a completely random permutation of 2 n distinct numbers. The possible combinations of a CMSM is an enormous figure. In the construction of NMSM, referring to Section 3.2.1, we even truncate the size of a randomly generated array and make the whole NMSM by repetition to reduce computational load. The key difference with the He et al.'s scheme is the design of range locator. It releases the constraint on the diversity of reference matrix. An additional benefit of the range locator is that the basic structure for embedding can be efficiently located without applying a time-consuming searching process. The cooperation of range locater in the outer embedding and the matrix operation in the inner embedding frees the hiding scheme from intensive loops of searching. According to the experimental data in Table 6, the required embedding time is less than half of the compared scheme.

Time Efficiency Comparison
To investigate the time efficiency of the proposed algorithm, we try to compare the time consumption of the proposed algorithm with the traditional approach. Although we present the three-dimensional (3D) CMSM and the n-dimensional (n−D) NMSM, our approach can also be de-generalized back to two-dimensional (2D) and one-dimensional (1D) version.
This experiment uses 8 typical grayscale images for testing and compares the proposed algorithm with a traditional one. A computer with a Dual i7-920 CPU and 8 GB memory is adopted for the experiment. The tic and toc commands in MATLAB are used to record the time cost in seconds. As shown in Table 7, due to the large number of loops used in the search step of the traditional algorithm, it takes significantly longer time to embed secret data. As the dimension rises, the time consumption increases rapidly. On the other hand, our algorithm has consistent performance as the dimension rises. Note that, as the dimension rises, the complexity of the reference matrix increases and thus the security level raises. Table 7. Comparison of time efficiency between the proposed scheme and traditional algorithm.

Conclusions
This study introduces an efficient multidimensional secret data-embedding scheme based on the mini SuDoKu matrix. In the proposed scheme, a CMSM RM with high complexity is first constructed to guarantee the security, and then a range locator function and the matrix operation are adopted to enhance the embedding efficiency. The reference matrix is further expanded to multidimension in order to obtain even higher embedding capacity and, meanwhile, still preserve good security and efficiency. The proposed scheme is compared with state-of-the-art RM-based data-hiding schemes and the experimental results show that the proposed scheme achieved higher than 46 dB in terms of the image quality and two bits per pixel in terms of the embedding capacity. In addition, the time consumption of the proposed algorithm is less than half of the traditional approach and keeps consistency as the dimension and security level raises. It is shown that the proposed scheme is advantageous in both embedding efficiency and security compared to the original mini-SuDoKu matrix.
We also provide a set of true color test images to demonstrate that the proposed scheme performs equal well to multi-channel images. By leveraging CMSM, each pixel of three-color channels-i.e., R, G, and B-can exactly match with the requirement of embedding a secret segment of data. The flexibility in dimension of RM meets the diverse data structure of cover media in the future word of massive IoT. The algorithm utilizes an array of unique value s L j to compare with the basic structure for embedding A using the function ismember(). As a result, the unique '1' in the array C indicates the location of s L j in A. By projecting the summations to each axis can obtain the index of the corresponding axis. Thus, the values of stego pixels are determined.