Nested Two-Layer RGB Based Reversible Image Steganography Method

In this study, a new reversible image steganography method based on Red-Green-Blue (RGB) which hides thecolored image into the colored images in two layers nested is proposed. The proposed method hides the 24-bitimage to be hidden by hiding two layers of data firstly in the resized version of the cover image with the LSBmethod, and then hides the resized cover image to the original cover image with the 4-bit method. The proposedmethod offers a secure communication environment as it hides the hidden image in two layers. When thirdparties extract data by using the LSB method, they only access the resized version of the cover image. The 4-bitmethod divides the image to be hidden into 8-bit segments. While the first 4 bits, which are the most importantbits of 8-bit data, are hidden directly, 4 bits that can be neglected with less significance are completed by roundingat approximate value through the method function. In this way, since the 8-bit data is reduced to 4-bits, themethod performs lossy hiding, but doubles the hiding capacity. Peak signal to noise ratio (PSNR), structuralsimilarity quality criterion (SSIM) and chi-square steganalysis method, which are frequently used in the literature,are used to measure the immunity level of the proposed method. When it is concealed at the same ratewith the LSB method and the proposed method, a higher measurement value is obtained in the PSNR imagecriterion, which is 1.2 dB, SSIM 0.0025, BER 0.0129 and NCC image criterion 0.00027. In additional, it wasshown that the proposed method achieved more successful results in chi-square steganalysis and histogramtests compared to the traditional LSB method.


Introduction
The security of the data transmitted in the present day is of the utmost importance especially in covid-19 coronavirus pandemic period, when only the technological communication channels are used and communication has become extremely significant. One of the most used techniques for the security of the transmitted data is encryption [15]. Encryption is often used today to secure data as it was in the past. In encryption, the presence of encrypted data is obvious and has an incomprehensible appearance. This makes the encrypted data vulnerable to all threats and attacks by third parties other than communication. Steganography, which is also adapted to today's technological possibilities and was used in the past for the transmission of hidden data without being aware of third parties, does not explicitly expose confidential data [6]. While two people communicate with the data hiding technique, it is very difficult for the third person to notice this communication. Since hidden data is not explicitly displayed, instead it is hidden inside an innocent cover. Thus, third parties other than communication cannot notice communication. The technique that hides data into the least significant bit, LSB (Least Significant Bit), which is one of the data hiding techniques, is frequently used [31].
The methods that follow the statistical traces left by the hiding process to discover and reveal the data hidden by the data hiding techniques are called steganalysis methods [6]. Steganalysis methods which are used to analyze hidden data target the cover medium which is the communication channel. Staganalysis methods that follow the traces of hiding in the data carrier cover environment are designed to prevent malicious use [7].
In steganography, the hidden message is hidden in a carrier medium and transmitted to the other party. On the other hand, after obtaining the carrier's environment, it extracts according to the hiding algorithm. For the actualization extraction process, the hiding algorithm must be known. Steganography methods are classified under four main titles according to the algorithm, hiding environment, security and retrieval features [6]. Steganography is divided into the bit and frequency space according to algorithm methods, image, sound, video and text according to hiding environments, durable and fragile according to security features, and reversible and non-reversible according to removal methods [6]. In the proposed method, bit space as the algorithm type, image as hiding medium and steganography method that does not require a carrier medium as extraction methods are used. The fact that the original cover file is not needed in the extraction method is called reversible and this is very important for the communication not to be noticed. It is also sufficient to transfer a single file to the other party for communication. In non-reversible methods, the original cover file and the stego file should be transmitted to the other party together. This may cause hidden data to be noticed. Steganography method is used for different purposes besides hiding data and these methods are called watermark [12]. A hidden mark that is not noticed in digital watermarking methods is added to digital multimedia data (image, video, sound and text) and remains hidden for the life of the content by marking it with a mark called watermark [9]. Watermarking methods are used in the content for purposes such as copyright protection, data validation, and data ownership control [9].
In bit space methods, the least important bit is used to hide data [6]. The data to be hidden in bit space methods are converted into two bits and hidden in the carrier environment. When the least significant bit of each byte of data in the carrier medium is changed, there is no change in the carrier image that can be perceived by the human eye. The bit space method is based on the data hiding in the resulting space by making use of neglecting the most insignificant bit. LSB method is the most commonly used method in the bit space method [23].
Another method that hides data by using bit space is the matching method [6]. In the matching method, as in the LSB method, the last bits are not directly changed. Instead, if the least significant bit does not have the same value as the bit to be hidden, the corresponding byte is increased or decreased by 1, and the same value does not change. The matching method was first proposed by Sharp [28]. Sharp [28] uses the key sequence to create random sequences in his proposed method. Sharp [28] encrypts hidden data by using the stego key array and hides it in the carrier medium. Mielikainen [22] develops the method proposed by Sharp [28] and does the hiding process according to the result of the function. According to the method, the carrier image is divided into pairs of pixels. The hidden information is hidden in two-bit groups. The first bit to be hidden is hidden directly to the last bit of the first pixel. The second bit is obtained by the conclusion of the hiding function of the last bits of the pixel pair. Chan [2] proposes a similar method by developing the method proposed by Mielikainen [22]. The method hides data from two consecutive pixels in the image by applying the XOR method on the LSB bit of the first pixel and the previous bit of the second pixel, as in the method proposed by Mielikainen. Tian [34] proposes a new reversible data hiding method by using the matching method. In his proposed method, Tian [34] hides data into the region by doubling the difference between the two pixels of the carrier image. Alatlar [1] develops the method proposed by Tian and hides the 3-bit data into the region by doubling the difference between four pixels. In the method they propose, Chang et al. [3] create the carrier image twice and hide the data in two images by using the module matrix and the direction of change. Lu et al. [18] propose an alternative method called camouflage pixels by developing the method proposed by Chang [3]. Ker [13] uses three pixels to hide two bits of data with 2/3 efficient hiding method. Wu and Tsai [41] propose a new method which hides data by the pixel difference between consecutive pixels. Wang et al. [38] improve the method proposed by Wu and Tsai [41] and hide data by the result of the module function of the difference between the two pixels. Fridrich and Soukal [8] propose a method that offers high data hiding capacity by using the hamming matrix. Kurtuldu and Arıca [16] hide the message data to be hidden in their work, which they call the image squares method, to the pixel group with the sequence closest to the message data to be hidden according to the sequences of the last bits of the block pixels. Doğan [4] proposes a method of data hiding based on the genetic algorithm by using chaotic maps. In another study, Doğan [5] proposes a reversible data hiding method based on the graphic block neighborhood level. Tuncer et al. [37] propose a new method of data hiding for binary images which is inspired by the minefield game.
There are many studies in the literature on watermarking methods. In another study, Tuncer [36] proposes a watermarking method for image authentication. Based on the pixel difference method proposed by Wu and Tsai [41], Prasad and Pal [25] develop a data hiding method for RGB-based images. Thiagarajan et al. [33] propose a new data hiding method based on bit space for RGB images. Hwang et al. [11] hide data by compressing the stego image lossily to reduce the image size. Yang & Wang [42] propose a smart pixel-adjustment block-based data hiding method for color images. Mandal & Das [20] propose a new data hiding method by using adaptive pixel value differencing. In his study, Swain [30] proposes adaptive pixel value differencing steganography by using both vertical and horizontal edges. Sneha et al. proposed an encryption algorithm based on chaos using Walsh-Hadamard transform and chaotic maps to encrypt images [29]. In addition, images were processed on a channel basis and two different chaotic maps called Arnold and Tent maps were used for encryption. Thakur et al. proposed a chaotic-based safe medical image watermarking approach in their study [32]. Their proposed method used non-subsampled contourlet transform (NSCT), redundant discrete wavelet transform (RDWT) and singular value decomposition (SVD) for imperceptibility and robustness. Ramasamy et al. proposed an advanced logistic map (ELM) method using chaotic maps and simple encryption techniques such as block scrambling, modified zigzag transformation for encryption phases, including permutation, diffusion, and key stream generation for secure transfer of images [27]. Tsai et al. proposed a reversible image hiding scheme based on histogram shifting for medical images [35]. Luo et al. They proposed a new reversible watermarking scheme that uses an interpolation technique that can embed large amounts of hidden data into images with imperceptible changes. [19]. In the Liu and Shan studies, Luo et al. They solved the problem of not being the opposite by improving their proposed study and proposed a reversible concealment method [17].
In this study, a new RGB-based reversible steganography method, which hides the colored image into the colored images in two layers, is proposed. The proposed method hides the 24-bit image to be hidden by hiding two layers of data firstly in the resized version of the cover image with the LSB method, and then hides the resized cover image to the original cover image with the 4-bit method. The proposed method offers a secure communication environment as it hides the hidden image in two layers. The novelty of the proposed method is that it provides a secure commu-Information Technology and Control 2021/2/50 nication environment as it hides the hidden image in two layers. The proposed method uses the 4-bit hiding method to hide the second layer. Therefore, data extraction from the second layer cannot be done without knowing the 4-bit method. The proposed method provides security in three stages. First, it hides data in a two-layer architecture. Secondly, by making 4-bit obfuscation to the second layer, the target obfuscates and made the decoding process difficult. Thirdly, instead of hiding the grayscale image, it hides the RGB image, making it difficult for third parties to decipher the proposed method. In section 2, the proposed method, in section 3, experimental studies to evaluate the performance of the proposed method and in section 4, the results are given.

The Proposed Method
The proposed method hides the 24-bit color image into two layers with two layers. While layer 1 is hidden with LSB method, layer 2 is hidden with 4-bit data hiding. The proposed method provides a safe environment with two layers to the hidden image.

Least Significant Bit Method
In bit space methods, the least significant bits are used to hide data [6]. The data to be hidden in the LSB method is converted into two bits and hidden in the carrier medium. When the least significant bit of each byte of data in the carrier medium is changed, there is no change in the carrier image that can be perceived by the human eye. The LSB method is based on hiding the data in the area created by making use of neglecting the most insignificant bit. LSB method is the most commonly used method in bit space methods [6].
In the LSB method, each bit of hidden data is hidden in the last bit in each byte of the carrier medium. In Figure 1, the internal structure of 1-byte data is shown and there are 8 bits in 1-byte. Each of these 8 bits has a different bit valences. The bits are numbered from 0 to 7 according to their valence. The value of one bit is obtained by multiplying the bit value by the bit number of 2. The 7th bit is called the most significant bit (MSB) because it is the highest-valued bit, and the 0 th bit is called the least significant bit (LSB) because it is the lowest-valued bit [24]. In Figure 2, the total of 1-byte data bit value is 1*2 7 + 1*2 6 + 0*2 5 + 1*2 4 + 1*2 3 + 1*2 2 + 0*2 1 + 0*2 0 = 220. Accordingly, while the bit value of the 7th bit is 128, the bit value of the 0th bit is 0. The bit number is called four bits of 7 to 4, the highest-valued bit group is the most significant digit (MSD), the four bits of 3 to 0 are the least-valued bit group, the least significant digit (LSD). The bit-value sum of the MSD bits is 208 while the bit-value sum of the LSD bits is 12. When the sum of the bit values is considered, the MSD bits are of high importance, while the LSD bits have a negligible low value.
In Figure 2, hiding 4 bits into 4-byte original data and extracting it from there with the LSB method is shown. Figure 2.a shows the data hiding process with the LSB method. In Figure 2.a, 8 bit binary contents of the original 4-byte data and corresponding decimal number values are given. The decimal number values of the original 4-byte are 149, 144, 69 and 212, respectively. The binary value of the 4-bit data to be hidden in Figure 2.a is 0100 2 . The LSB bits which are the last bit of each byte are shown. All bits from the 1 st bit to the 4 th bit are hidden in the last bits (LSB) of the original bytes respectively. As a result of hiding, stego 4 bytes in Figure 2.a occurs. The LSB bits varying to Stego 4 bytes are underlined. While the last bit of the 1 st byte of the original bytes is 1, the result of data hiding becomes 0. While the last bit of the 2 nd byte is 0, it is 1; while the last bit of the 3 rd byte is 0, the last bits of the 4 th and 0 th byte are not changed. As a result of hiding data with the LSB method, some bits change while some bits do not. As a result of the hiding, the value of Internal structure of 1-byte data Luo et al. They solved the problem of not being the opposite by improving their proposed study and proposed a reversible concealment method [17].
In this study, a new RGB-based reversible steganography method, which hides the colored image into the colored images in two layers, is proposed. The proposed method hides the 24-bit image to be hidden by hiding two layers of data firstly in the resized version of the cover image with the LSB method, and then hides the resized cover image to the original cover image with the 4-bit method. The proposed method offers a secure communication environment as it hides the hidden image in two layers. The novelty of the proposed method is that it provides a secure communication environment as it hides the hidden image in two layers. The proposed method uses the 4-bit hiding method to hide the second layer. Therefore, data extraction from the second layer cannot be done without knowing the 4-bit method. The proposed method provides security in three stages. First, it hides data in a two-layer architecture. Secondly, by making 4-bit obfuscation to the second layer, the target obfuscates and made the decoding process difficult. Thirdly, instead of hiding the grayscale image, it hides the RGB image, making it difficult for third parties to decipher the proposed method. In section 2, the proposed method, in section 3, experimental studies to evaluate the performance of the proposed method and in section 4, the results are given.

The Proposed Method
The proposed method hides the 24-bit color image into two layers with two layers. While layer 1 is hidden with LSB method, layer 2 is hidden with 4-bit data hiding. The proposed method provides a safe environment with two layers to the hidden image.

Least Significant Bit Method
In bit space methods, the least significant bits are used to of 7 to 4, the highest-valued bit group is the most significant digit (MSD), the four bits of 3 to 0 are the least-valued bit group, the least significant digit (LSD). The bit-value sum of the MSD bits is 208 while the bit-value sum of the LSD bits is 12. When the sum of the bit values is considered, the MSD bits are of high importance, while the LSD bits have a negligible low value.

Figure 1
Internal structure of 1-byte data In Figure 2, hiding 4 bits into 4-byte original data and extracting it from there with the LSB method is shown. Figure 2.a shows the data hiding process with the LSB method. In Figure 2  Hiding and extracting data with LSB method a) Hiding data b) Extracting data bytes is 1, the result of data hiding becomes 0. While the last bit of the 2 nd byte is 0, it is 1; while the last bit of the 3 rd byte is 0, the last bits of the 4 th and 0 th byte are not changed. As a result of hiding data with the LSB method, some bits change while some bits do not. As a result of the hiding, the value of the original 1 st byte is changed from 149 to 148, the 2 nd byte is changed from 144 to 145, the 3 rd byte is changed from 69 to 68 and the 4 th byte is not changed. extracted as 0. Then the last bit of the 2 nd byte is extracted as 1, the last bit of the 3 rd byte is extracted as 0 and the last bit of the 4 th byte is extracted as 0. At the end of the process, 4-bit binary data is extracted as 01002. 1/8 of data can be hidden to an image with the LSB method. This is because there are 8 bits in each byte, and only 1 bit of data can be hidden in the last bit of each byte.

Figure 2
Hiding and extracting data with LSB method a) Hiding data b) Extracting data

4-bit Data Hiding Method
The main motivation for the development of the 4-bit data hiding method is that the small tone changes that occur in the pixels in 24-bit color images with RGB color coding do not create perceptible distortions in the general view of the picture. Small changes in the colored picture to be hidden based on this principle do not cause any change in the image of the picture transmitted to the other person which can be perceived by the human eye. In the hidden image, each pixel contains 3 bytes of information: Red (1-byte), Green (1-byte), Blue (1-byte) channels [14]. Each channel has 8 bits of information. While hiding, the first 4 bits, which are the most important bits of the 8-bit data in each channel, are hidden with the LSB method, while the less important 4 bits that can be neglected are not hidden and are rounded up by the function. In the 4-bit data hiding method, the picture can be hidden inside the picture. The losses resulting from the extraction of the hidden picture are not in a way that can greatly affect the picture obtained. Since 4-bit hiding hides the first 4 bits with the LSB method, 1-byte hides a significant part of the data without loss. In Figure 8, the images hidden and extracted with the suggested method are given. The proposed method hides in the 2nd layer with the 4-bit method. As can be seen in Figure 8, there are no visible changes in the hidden image.
In Figure 3, hiding and extracting 8 bits to 4-byte original data with 4-bit data hiding method is shown. Unlike the LSB method, the 4-bit method hides 8 bits of data in 4 bytes, and accordingly, the 4-bit method can hide twice the data according to the LSB method. Figure 3.a shows the data hiding process with the 4-bit method. In Figure 3.a, the 8bit binary content of the original 4-byte data and the corresponding decimal number values are given. The binary value of the 8-bit data to be hidden in Figure 3.a is 110101112. LSB bits, the last bit of each byte, are shown. MSD bits from 1 st to 4 th bits are hidden to the last bits (LSB) of the original bytes respectively. LSD bits, which are 4-bit between 5 th and 8 th bit, are directed to the function. As a result of hiding, stego in Figure 3.a consists of (a) Data Hiding (b) Data Extracted the original 1 st byte is changed from 149 to 148, the 2 nd byte is changed from 144 to 145, the 3 rd byte is changed from 69 to 68 and the 4 th byte is not changed. Figure 2.b shows data extraction by using the LSB method. From the last bits of the stego 4 bytes, hidden data is extracted from the 1 st byte respectively. Firstly, the last bit of the 1 st byte is extracted as 0. Then the last bit of the 2 nd byte is extracted as 1, the last bit of the 3 rd byte is extracted as 0 and the last bit of the 4 th byte is extracted as 0. At the end of the process, 4-bit binary data is extracted as 0100 2 . 1/8 of data can be hidden to an image with the LSB method. This is because there are 8 bits in each byte, and only 1 bit of data can be hidden in the last bit of each byte.

4-bit Data Hiding Method
The main motivation for the development of the 4-bit data hiding method is that the small tone changes that occur in the pixels in 24-bit color images with RGB color coding do not create perceptible distortions in the general view of the picture. Small changes in the col-ored picture to be hidden based on this principle do not cause any change in the image of the picture transmitted to the other person which can be perceived by the human eye. In the hidden image, each pixel contains 3 bytes of information: Red (1-byte), Green (1-byte), Blue (1-byte) channels [14]. Each channel has 8 bits of information. While hiding, the first 4 bits, which are the most important bits of the 8-bit data in each channel, are hidden with the LSB method, while the less important 4 bits that can be neglected are not hidden and are rounded up by the function. In the 4-bit data hiding method, the picture can be hidden inside the picture. The losses resulting from the extraction of the hidden picture are not in a way that can greatly affect the picture obtained. Since 4-bit hiding hides the first 4 bits with the LSB method, 1-byte hides a significant part of the data without loss. In Figure 8, the images hidden and extracted with the suggested method are given. The proposed method hides in the 2nd layer with the 4-bit method. As can be seen in Figure 8, there are no visible changes in the hidden image. In Figure 3, hiding and extracting 8 bits to 4-byte original data with 4-bit data hiding method is shown. Unlike the LSB method, the 4-bit method hides 8 bits of data in 4 bytes, and accordingly, the 4-bit method can hide twice the data according to the LSB method. Figure 3.a shows the data hiding process with the 4-bit method. In Figure 3.   Then the last bit of the 2 nd byte is extracted as 1, the last bit of the 3 rd byte is extracted as 0 and the last bit of the 4 th byte is extracted as 1. At the end of the process, the MSD bits 1101 2 of the hidden 8-bit are extracted. The remaining 4-bit LSD bits are extracted via the function. According to the range value, the function returns 4-bit data. Accordingly, 4-bit data is returned when the range value 1 is 0010 2 , 2 is 0110 2 , 3 is 1010 2 and 4 is 1110 2 . LSD bits are less important in 4-bit data hiding which is completed by the function with approximate value. According to four different range values, the secret data has 215 decimal values, and the data that extracted has a value of 210 when the range value is 1, 214 when it is 2, 218 when it is 3, and 222 when it is 4. In all range values, values close to hidden data are obtained. The closest value is 214 with 1 difference when the range value is 2. The image hidden by the method suggested in Figure 8 has been removed with four different range values. The images extracted in Figure 8 were analyzed with image criteria and the results are given in Table 1. When the results were examined, more successful results were obtained than the image criteria when the range value was 2. In general, it gives the most successful result when the range value is 2 in the subtraction process in all images. This is be-

Figure 3
Hiding and extracting data with 4-bit data hiding method a) Hiding data b) Extracting data 4 bytes. Stego LSB bits varying in 4 bytes are underlined. As a result of hiding of the first byte from the original bytes, no data change occurred. While the last bit of the 2 nd byte is 0, it is 1, the last bit of the 3 rd byte is 1, it is 0 and the last bit of the 4 th byte is 0, it is 1. There have been 3 bit changes in the 8-bit data hiding process.
value of 2, and because it is the middle value, the byte value extracted in the 4-bit suppression function contains the value closest to the original byte value.

Hiding and Extracting Data with the Proposed Method
The proposed method hides the 24-bit (a) Data Hiding (b) Data Extracted cause range value is the middle value of 2, and because it is the middle value, the byte value extracted in the 4-bit suppression function contains the value closest to the original byte value.

Hiding and Extracting Data with the Proposed Method
The proposed method hides the 24-bit color0020image into the 24-bit color image with nested two lay-

Figure 4
Hiding and extracting data with the proposed method a) Hiding data b) Extracting data ers. The two layers provide a safe environment for the hidden image.
The 90x90x3 hidden image is hidden into the 512x512x3 size Lena image of the method suggested in Figure 4 and extracted from it. The proposed method hides the hidden image in two layers. In Figure 4.a, firstly, the hidden image in 90x90x3 size is hidden in resized cover image 2 (Layer 1) which is 0.35 resized version of the original cover image by 4-bit hiding meth-disappear.

Figure 4
Hiding and extracting data with the proposed method a) Hiding data b) Extracting data With the 4-bit lossy hiding method, only MSD bits are hidden, and LSD bits are completed by the function at approximate value. When 4-bit hiding is done in the 2 nd layer, the hidden image inside the 1 st layer causes the MSD bits to be lost. With the LSB method, 1/8 capacity is obtained.
Third parties who listen to the communication between the two parties can access the image in layer 2 instead of the hidden image when they extract data by using the LSB method to decipher the communication. Thus, it is more difficult to reach the true hidden image. as a result of the 1st hiding is hidden in the Cover 1 image. The resulting Stego 1 image is converted from the binary number system to the decimal number system and a nested hidden Stego Image is obtained due to this conversion.

Figure 5
Flow charts of the proposed method a) data hiding b) data extraction In the method proposed in Figure 5.b, the flow diagram of data extraction from stego image is given. Data extraction was performed with the method suggested in Figure 4.b. There are two images hidden inside each other in 512x512x3 stego image. In the extraction process, first, the lossless data is extracted from the 2 nd layer, 512x512x3 stego image by using the LSB method and 180x80x3 1 st hidden image (Layer 2) is obtained. Secondly, the lossy 90x90x3 2 st hidden image is extracted from the 2 nd layer by 4-bit method. Thus, the real hidden image is extracted. Third parties who listen to the communication between the two parties can access the image in layer 2 instead of the hidden image when they extract data by using the LSB method to decipher the communication. Thus, it is more difficult to reach the true hidden image.
Flow charts of the two-layer data hiding method proposed in Figure 5 are given. According to the data hiding flow chart of the data hiding method proposed in Figure 5.a, Cover Image 1 (Layer 2) and hidden image Stego Image 1 is selected and converted from decimal number to binary number. Then, by using LSB method, Stego Image 1 (Layer 2) hidden image is extracted and Hidden 1 (Layer 1) is obtained. Hidden 2 as lossy, is extracted from the Hidden 1 image with 4-bit method.
Since Hidden 2 is extracted as binary, Hidden Image is obtained by converting it to decimal number system.
Data hiding capacities are visualized with LSB and the recommended method and are given in Figure 6. A 24bit colored Cover image with dimensions of 512x512x3 in Figure 6.a can be hidden by LSB method with 24 images ( 512 512 are selected first. Later Cover Image 1 is reduced by 35% to obtain Cover Image 2 (Layer 1). Then, it is converted from Cover 1, Cover 2 and Hidden decimal number system to binary number system respectively. The hidden image is hidden in the Cover 2 image via 4-bit.
The image of Stego 2 formed as a result of the 1st hiding is hidden in the Cover 1 image. The resulting Stego 1 image is converted from the binary number system to the decimal number system and a nested hidden Stego Image is obtained due to this conversion.
In the method proposed in Figure 5.b, the flow diagram of data extraction from stego image is given. First, Figure 6 Comparison of data hiding capacities with LSB and the proposed method 45 is ignored, the computational complexity is found to be 77n. Considering the computational complexity, it is seen that the proposed method has low computational complexity and high performance as an algorithm.

Figure 6
Comparison of data hiding capacities with LSB and the proposed method

Experimental Studies
In order to measure the performance of data hiding methods, image criteria and steganalysis methods are used. Lena, Pepper, Baboon, Jet, Flower, Car, resistance of the proposed method to steganalysis algorithms.
In order to measure the distortions in the cover images, the mean square error (MSE) given in Equation 2 and  Data hiding capacities are visualized with LSB and the recommended method and are given in Figure 6. A 24bit colored Cover image with dimensions of 512x512x3 in Figure 6.a can be hidden by LSB method with 24 images ( 512 512 The algorithm of the proposed method. Computational complexity is calculated as 77n+45. In Big O notation, since constant numbers are ignored, when the constant 45 is ignored, the computational complexity is found to be 77n. Considering the computational complexity, it is seen that the proposed method has low computational complexity and high performance as an algorithm.

Experimental Studies
In order to measure the performance of data hiding methods, image criteria and steganalysis methods are used. Lena  in as the 1st security layer. Since this layer was not found in the previous study, there is no data. The security layer hides the hidden image as a secret. According to MSE, PSNR, SSIM, UQI, BER and NCC values, the security layer is successfully hidden. In Figure 8.c and i, the original hidden image Jet image method, then the first layer is hidden to the second layer with the LSB method. Since data is hidden to the last layer with the LSB method, PSNR values are close to the LSB method, but the proposed method gives more successful results. When 1 bpp data is hidden in the Lena image, 52.16 dB PSNR value is obtained in
In order to measure the distortions in the cover images, the mean square error (MSE) given in Equation 2 and the peak signal noise ratio (PSNR) quality criteria given in Equation 3 are used. In Equation 2, m and n represent line and column information of images; O represents original cover image; S represents the stego image. After the MSE value is calculated, the next step is PSNR calculation. PSNR is an image criterion that measures the similarity ratio between the cover image and the stego image. In Equation 3, MAX is the maximum value that a pixel can take and it is usually 255. SSIM quality criteria are given in Equation 4. In SSIM quality criterion, quality index is calculated by taking into consideration the similarities between X and Y vector. In Equation 4, X represents the original carrier image and Y represents the data hidden image. In order to show the sizes of the hidden data, the unit of bits per pixel (bpp) given in Equation 5 is used. The number of bits per pixel in Equation 5 is calculated by the ratio of the number of bits used in the hiding process in the image to the total number of bits in the image. Equation of UQI image criterion, which makes quality analysis between two images, is given in Equation 6. In Equation 7, the definition equation of NCC image criterion analyzing the original image and the stego image is given.
In order to show the sizes of the hidden data, the unit of bits per pixel (bpp) given in Equation 5 is used. The number of bits per pixel in Equation 5 is calculated by the ratio of the number of bits used in the hiding process in the image to the total number of bits in the image. Equation of UQI image criterion, which makes quality analysis between two images, is given in Equation 6. In Equation 7, the definition equation of NCC image criterion analyzing the original image and the stego image is given.
the image in Figure 8.h is obtained in the extraction operation with the frequently used LSB method. To extract the hidden image, the hidden image should be extracted from the image in Figure 8.h by knowing the correct hiding algorithm. Thus, the 2nd security layer is created in this way. In Figure 8.i, j, k and 1, the original hidden images in the size of 90x90x3 are given which are extracted from the extracted image 1 in Figure 8.h lossily with the values of range 1, 2, 3 and 4, respectively. Depending on the range values, extraction operations are performed with different bit interval values. The four images recovered in Figure  8.i, j, k, and l do not show any visible differences, except for image distortion caused by loss of data hiding. All extracted images have the same appearance as the original hidden image.
The RGB histograms of original and stego images are given in Figure 8.d and m. When two histograms are examined, it is seen that data hiding does not make a noticeable change in the cover image. Histograms of the resized cover image and extracted image 1 are given in Figure 8.e and n. When the two histograms are examined, there is no difference in the histograms of the image hidden and the image extracted. In Figure  8.f and Figure 8.o, p, q, and r, 90x90x3 hidden Jet image and histograms of the lossy extracted images from 1 with the values of range 1, 2, 3 and 4, respectively, are given. When the histograms are examined, since the hiding process is hidden with 4bit loss, the histograms of the extracted images have similarities and differences with the histogram of the hidden image. Histograms in all range values also have minor differences. Although histograms perform the same movements as the histogram of the hidden (2) In order to show the sizes of the hidden data, the unit of bits per pixel (bpp) given in Equation 5 is used. The number of bits per pixel in Equation 5 is calculated by the ratio of the number of bits used in the hiding process in the image to the total number of bits in the image. Equation of UQI image criterion, which makes quality analysis between two images, is given in Equation 6. In Equation 7, the definition equation of NCC image criterion analyzing the original image and the stego image is given.
the image in Figure 8.h is obtained in the extraction operation with the frequently used LSB method. To extract the hidden image, the hidden image should be extracted from the image in Figure 8.h by knowing the correct hiding algorithm. Thus, the 2nd security layer is created in this way. In Figure 8.i, j, k and 1, the original hidden images in the size of 90x90x3 are given which are extracted from the extracted image 1 in Figure 8.h lossily with the values of range 1, 2, 3 and 4, respectively. Depending on the range values, extraction operations are performed with different bit interval values. The four images recovered in Figure  8.i, j, k, and l do not show any visible differences, except for image distortion caused by loss of data hiding. All extracted images have the same appearance as the original hidden image.
The RGB histograms of original and stego images are given in Figure 8.d and m. When two histograms are examined, it is seen that data hiding does not make a noticeable change in the cover image. Histograms of the resized cover image and extracted image 1 are given in Figure 8.e and n. When the two histograms are examined, there is no difference in the histograms of the image hidden and the image extracted. In Figure  8.f and Figure 8.o, p, q, and r, 90x90x3 hidden Jet image and histograms of the lossy extracted images from 1 with the values of range 1, 2, 3 and 4, respectively, are given. When the histograms are examined, since the hiding process is hidden with 4bit loss, the histograms of the extracted images have similarities and differences with the histogram of the hidden image. Histograms in all range values also have minor differences. Although histograms perform the same movements as the histogram of the hidden (3) In order to show the sizes of the hidden data, the unit of bits per pixel (bpp) given in Equation 5 is used. The number of bits per pixel in Equation 5 is calculated by the ratio of the number of bits used in the hiding process in the image to the total number of bits in the image. Equation of UQI image criterion, which makes quality analysis between two images, is given in Equation 6. In Equation 7, the definition equation of NCC image criterion analyzing the original image and the stego image is given.
the image in Figure 8.h is obtained in the extraction operation with the frequently used LSB method. To extract the hidden image, the hidden image should be extracted from the image in Figure 8.h by knowing the correct hiding algorithm. Thus, the 2nd security layer is created in this way. In Figure 8.i, j, k and 1, the original hidden images in the size of 90x90x3 are given which are extracted from the extracted image 1 in Figure 8.h lossily with the values of range 1, 2, 3 and 4, respectively. Depending on the range values, extraction operations are performed with different bit interval values. The four images recovered in Figure  8.i, j, k, and l do not show any visible differences, except for image distortion caused by loss of data hiding. All extracted images have the same appearance as the original hidden image.
The RGB histograms of original and stego images are given in Figure 8.d and m. When two histograms are examined, it is seen that data hiding does not make a noticeable change in the cover image. Histograms of the resized cover image and extracted image 1 are given in Figure 8.e and n. When the two histograms are examined, there is no difference in the histograms of the image hidden and the image extracted. In Figure  8.f and Figure 8.o, p, q, and r, 90x90x3 hidden Jet image and histograms of the lossy extracted images from 1 with the values of range 1, 2, 3 and 4, respectively, are given. When the histograms are examined, since the hiding process is hidden with 4bit loss, the histograms of the extracted images have similarities and differences with the histogram of the hidden image. Histograms in all range values also have minor differences. Although histograms perform the same movements as the histogram of the hidden (4) In order to show the sizes of the hidden data, the unit of bits per pixel (bpp) given in Equation 5 is used. The number of bits per pixel in Equation 5 is calculated by the ratio of the number of bits used in the hiding process in the image to the total number of bits in the image. Equation of UQI image criterion, which makes quality analysis between two images, is given in Equation 6. In Equation 7, the definition equation of NCC image criterion analyzing the original image and the stego image is given.
90x90x3 size Jet hidden image in Figure 8.c is hidden the image in Figure 8.h is obtained in the extraction operation with the frequently used LSB method. To extract the hidden image, the hidden image should be extracted from the image in Figure 8.h by knowing the correct hiding algorithm. Thus, the 2nd security layer is created in this way. In Figure 8.i, j, k and 1, the original hidden images in the size of 90x90x3 are given which are extracted from the extracted image 1 in Figure 8.h lossily with the values of range 1, 2, 3 and 4, respectively. Depending on the range values, extraction operations are performed with different bit interval values. The four images recovered in Figure  8.i, j, k, and l do not show any visible differences, except for image distortion caused by loss of data hiding. All extracted images have the same appearance as the original hidden image.
The RGB histograms of original and stego images are given in Figure 8.d and m. When two histograms are examined, it is seen that data hiding does not make a noticeable change in the cover image. Histograms of the resized cover image and extracted image 1 are given in Figure 8.e and n. When the two histograms are examined, there is no difference in the histograms of the image hidden and the image extracted. In Figure  8.f and Figure 8.o, p, q, and r, 90x90x3 hidden Jet image and histograms of the lossy extracted images from 1 with the values of range 1, 2, 3 and 4, respectively, are given. When the histograms are examined, since the hiding process is hidden with 4bit loss, the histograms of the extracted images have similarities and differences with the histogram of the hidden image. Histograms in all range values also have minor differences. Although histograms perform the same movements as the histogram of the hidden image, the frequency ranges are sparse as there is lossy (5) In order to show the sizes of the hidden data, the unit of bits per pixel (bpp) given in Equation 5 is used. The number of bits per pixel in Equation 5 is calculated by the ratio of the number of bits used in the hiding process in the image to the total number of bits in the image. Equation of UQI image criterion, which makes quality analysis between two images, is given in Equation 6. In Equation 7, the definition equation of NCC image criterion analyzing the original image and the stego image is given.
90x90x3 size Jet hidden image in Figure 8.c is hidden the image in Figure 8.h is obtained in the extraction operation with the frequently used LSB method. To extract the hidden image, the hidden image should be extracted from the image in Figure 8.h by knowing the correct hiding algorithm. Thus, the 2nd security layer is created in this way. In Figure 8.i, j, k and 1, the original hidden images in the size of 90x90x3 are given which are extracted from the extracted image 1 in Figure 8.h lossily with the values of range 1, 2, 3 and 4, respectively. Depending on the range values, extraction operations are performed with different bit interval values. The four images recovered in Figure  8.i, j, k, and l do not show any visible differences, except for image distortion caused by loss of data hiding. All extracted images have the same appearance as the original hidden image.
The RGB histograms of original and stego images are given in Figure 8.d and m. When two histograms are examined, it is seen that data hiding does not make a noticeable change in the cover image. Histograms of the resized cover image and extracted image 1 are given in Figure 8.e and n. When the two histograms are examined, there is no difference in the histograms of the image hidden and the image extracted. In Figure  8.f and Figure 8.o, p, q, and r, 90x90x3 hidden Jet image and histograms of the lossy extracted images from 1 with the values of range 1, 2, 3 and 4, respectively, are given. When the histograms are examined, since the hiding process is hidden with 4bit loss, the histograms of the extracted images have similarities and differences with the histogram of the hidden image. Histograms in all range values also have minor differences. Although histograms perform the same movements as the histogram of the hidden image, the frequency ranges are sparse as there is lossy (6) Number of Hidden Bit  (7) 90x90x3 size Jet hidden image in Figure 8.c is hidden in the original Lena cover image of 512x512x3 size in Figure 8.a by the proposed hiding method. In the proposed data hiding process, it is first converted to the size of 180x180x3 in Figure 8.b by resizing the cover image in Figure 8.a by 35.15%. Then, the hidden image in Figure 8.c is first hidden to the resized cover image in Figure 8.b lossily by 4-bit hiding method. Afterwards, the image of Figure 8.c and the hidden image of Figure 8.b are hidden in the cover image in Figure 8.a without any loss by LSB method. As a result of hiding, stego Lena image is given in Figure  8.g. As a result of data extraction with the proposed method, 180x180x3 size extracted image 1, which is recovered by LSB method, is given in Figure 8.h. The extracted image is the same as the original cover image. In this way, the 1st security layer is created. If the hiding process is discovered by third parties, only 90x90x3 size Jet hidden image in Figure 8.c is hidden in the original Lena cover image of 512x512x3 size in Figure 8.a by the proposed hiding method. In the proposed data hiding process, it is first converted to the size of 180x180x3 in Figure 8.b by resizing the cover image in Figure 8.a by 35.15%. Then, the hidden image in Figure 8.c is first hidden to the resized cover image in Figure 8.b lossily by 4-bit hiding method. Afterwards, the image of Figure 8.c and the hidden image of Figure 8.b are hidden in the cover image in Figure 8.a without any loss by LSB method. As a result of hiding, stego Lena image is given in Figure 8.g. As a result of data extraction with the proposed method, 180x180x3 size extracted image 1, which is recovered by LSB method, is given in Figure 8.h. The extracted image is the same as the original cover image. In this way, the 1st security layer is created. If the hiding process is discovered by third parties, only the image in Figure  8.h is obtained in the extraction operation with the frequently used LSB method. To extract the hidden image, the hidden image should be extracted from the image in Figure 8.h by knowing the correct hiding algorithm. Thus, the 2nd security layer is created in this way. In Figure 8.i, j, k and 1, the original hidden images in the size of 90x90x3 are given which are extracted from the extracted image 1 in Figure 8.h lossily with the values of range 1, 2, 3 and 4, respectively. Depending on the range values, extraction operations are performed with different bit interval values. The four images recovered in Figure 8.i, j, k, and l do not show any visible differences, except for image distortion caused by loss of data hiding. All extracted images have the same appearance as the original hidden image. The RGB histograms of original and stego images are given in Figure 8.d and m. When two histograms are examined, it is seen that data hiding does not make a noticeable change in the cover image. Histograms of the resized cover image and extracted image 1 are given in Figure 8.e and n. When the two histograms are examined, there is no difference in the histograms of the image hidden and the image extracted. In Figure  8.f and Figure 8.o, p, q, and r, 90x90x3 hidden Jet image and histograms of the lossy extracted images from 1 with the values of range 1, 2, 3 and 4, respectively, are given. When the histograms are examined, since the hiding process is hidden with 4-bit loss, the his- Histograms in all range values also have minor differences. Although histograms perform the same movements as the histogram of the hidden image, the frequency ranges are sparse as there is lossy hiding. The results show that the original hidden image is hidden by 2 layers of security and the hidden image is successfully obtained as a result of the extraction process.
Image quality index results of the proposed method and the previous study [6] to compare the original, stego Lena images in Figure 8 and extracted images with different range values with the original image are given in  Figure 8.c and i, the original hidden image Jet image security layer in the size of 90x90x3 is hidden in Figure 8.  Figure 9. In the tests, data was hidden at rates between 0 -1bpp for all images. In Figure 9, when data is hidden in Lena The graphics showing the SSIM values according to the data capacity with the method recommended for the test images and the LSB method are given in Figure 10. In Figure 10, when 1bpp data is hidden in Lena Figure 10, the recommended method has obtained more successful results than the LSB method. According to the SSIM value, the proposed method increased by 0.0008 in the Lena image.
Chi-square steganalysis graphics of stego images, which are formed by hiding 1 bpp data to the original test images with the LSB method and the proposed method, are given in Figure 11. When the graphs in Figure 11 are examined, the original test images in Lena  PSNR values of previous study [6] and LSB method proposed according to hidden data capacity a) Lena

Figure 10
SSIM values of previous study [6] and   SSIM values of previous study [6] and LSB method proposed according to hidden data capacity a) Lena

Figure 11
Chi-square steganalysis graphs of original, recommended and data-hidden test images with LSB methods a) Lena b) Peppers c) Baboon d) Jet e) Flower f) Car g) Mountain h) Motorbike Table 2 Analysis values of the image criteria of the LSB method and proposed with Original and Stego test images  Table 2 Analysis values of the image criteria of the LSB method and proposed with Original and Stego test images Since the limit of the proposed method hides data in two layers to increase security, its data hiding capacity is lower than the LSB method. The proposed method lossy hides the hidden image to the second layer. The purpose here is to increase the capacity and make less data changes in the cover image. The use of the proposed method is a threat to the validity of the method if the hidden image contains sensitive information, especially if it is not suitable for lossy transmission in images containing small text.
The proposed method may work for grayscale images.
In the grayscale images, data can be concealed from there without any change in the dimensions given in the article. There is no situation to change the results. The proposed method is designed to be used both in 24-bit RGB color images and 8-bit grayscale images.
Consequently, according to all these experimental results, the proposed method manages to hide data with high reliability by making minimal changes in the cover image. The proposed method obtains higher PSNR and SSIM values compared to the previous study [6] and LSB method. The proposed method obtained values close to the results of the original images in all test images in the chi-square steganalysis attack and successfully passed through the chi-square attacks. In addition, the proposed method hides two layers of data. Accordingly, third parties trying to extract data with the standard LSB method will only get the original resized image from the image, where the data is hidden. Thus, accessing the original hidden image becomes two times more difficult. In order to extract the real hidden image, they need to know the 4-bit hiding algorithm. According to all these results, it is seen that the proposed method can hide data securely. The proposed method has its advantages and disadvantages. Advantages: 1 The proposed method hides 24-bit color image to 24-bit color image. The method provides two layers of secure data hiding. This feature makes it difficult to reach the hidden image of the proposed method and increased its security.

Conclusions
In this study, a new two-layer and reversible data hiding method is proposed, which hides the 24-bit color image in a 24-bit color image. The proposed method has obtained more successful imperceptibility values than traditional LSB methods and the previous study [6]. According to the tests performed, when the LSB method and the proposed method are hidden at the same rate, the PSNR image criterion, which is 1.2 dB, SSIM 0.0025, BER 0.0129 and NCC image criterion, has a higher measurement value of 0.00027. According to the tests carried out, the proposed method obtains more successful PSNR and SSIM values compared to the previous study [6] and LSB. The proposed method hides the hidden image to the resized version of the cover image with the LSB method by hiding two layers of data, and then hides the resized cover image to the original cover image with the 4-bit method. It has increased security by hiding the hidden image in two intertwined cover images. When third parties extract data by using the LSB method, they can only access the resized version of the cover image. Also, since the proposed data hiding method is reversible, it does not need the original image in the extraction process.