An Improved Data Hiding in Encrypted Images

: Nowadays in digital world, safeguarding information is an important phase in transmitting messages and doing trades. The increasing growth of computer networks has caused a lot of changes in life style, occupational activities and organizations. Thus, data security has been one of the essential issues in this area. By connecting a local network to global network, outsiders are likely to have access to the organizations’ data. One of the most important challenges about propagating information on internet is to assure inaccessibility of unauthorized people to sensitive information. Various solutions including restricting the use of internet, encoding the data and establishing security have been suggested. To fulfill the security requirements for a safe transaction, operations such as encoding, hiding, etc. are used. Today information is of great importance either in military area or in commercial one. Hence one of the basic needs is to maintain information for transmitting or storing them. Having access to coded information is not possible for unauthorized people and only those having password can decode and use them. Encoding the information is based on the knowledge related to that. On the one hand, hiding is also one of the effective techniques for keeping information since host information is clear and a hidden message may not be discovered. In this study, a new technique is presented for hiding information in encoded images which minimized the error of the previous techniques. In addition, previous techniques have never pointed out to noisy environments and one of the advantages of the introduced technique was to eliminate noise.


Introduction
Encoding has a long history and the first application of it dates to 4000 past years in ancient Egypt.
In encoding, transmitting message or information is not done in hiding manner but rather storing information or transmitting message is known. However, only authorized individuals are allowed to retrieve the main information. On the contrary in hiding technique, sending a hidden message is carried out in hiding manner and no one is informed of this except receiver and sender. [9] In encoding, the content of a text is converted in letter by letter form and in some cases bit by bit and the purpose is to convert the content of a text not the linguistic structure of it. Coding is a conversion process in which a word is replaced by another word or symbol and the linguistic structure of the text is converted.
With the advent of computers and their computational power, encoding knowledge entered the area of computer science and this caused three key changes in encoding issues: (1) High computational power provided an opportunity for creating more effective and complicated for encoding. (2) Encoding techniques found different applications.
(3) Previously, encoding was mainly done using alphabets on text data. The advent of computers made encoding done on different information according to bits. Encoding algorithm refers to any algorithm or mathematical function which is used in encoding protocols due to having the required features in encoding. Encoding algorithm is a comprehensive concept and it is not necessary to use every algorithm of this classification directly for encoding. [12] Only the application of encoding is important.
In communications world, the first question is about illegal propagation of digital products. One of the primary ways to preserve the owners' rights is using encoding. It may be said that encoding is the most common way to protect digital products and it has faced a lot of advances. Some products are encoded by sender (manufacturer) before delivery and password is only given to legal purchasers of digital products. Then the coded file becomes available through internet for the public. Frauds are not able to use a file without having private password but authorized user can decode and use data by having password.
Fractal term was first developed by Mandelbrot in 1970. He derived this term from Latin word "Fractus" which means a stone broken in an irregular form. [2] Fractal in its wide definition discusses about processes or shapes which have scalable features. Fractal shapes have a feature that if we change the scale for them, we will obtain a similar shape. Natural and real examples of fractals include human lungs, trees, clouds, mountains and the leaves of some trees like fern. Another definition is based on fractal dimension. On this basis, fractal is a shape that has a non-integer dimension. It means we may have a shape whose dimension is between 1 and 2.
Fractals are mathematical geometrical concepts which have been of interest by the scientists of other sciences during recent years and after Bnoite Mandelbrot worked on them and their applications have been demonstrated in physics, chemistry, biology, geology and medicine. [7]

Well Known Fractals
A) Contour fractal The simplest type of fractal is contour fractal. Consider a line segment 1 in length. Divide it into three equal parts and eliminate the middle part. Now we have two line segments and their length is one third of initial length. Next, repeat this operation for each remaining line segments. Divide each line segment into three parts and eliminate the middle part. You can write a computer program that can perform these operations sequentially. If we perform these operations many times (computers cannot perform this), we will obtain a form called contour. [3] If we look at the whole shape, we will see a structure which is infinite. If we look at the left or right side of the shape, we will see a structure which is again infinite and at the same time it is quite similar to the whole shape.

C) Koch fractal
One of the types of fractals was developed by Helg Fon Koch in 1904. Consider an equilateral triangle. Divide each side into three parts and then substitute two sides in the middle side. If we repeat this in the same way, we will obtain a very beautiful shape called Koch Curve. [11]

Fractal Applications
Fractals have many applications in different sciences. Some of them are: (1) In processing signal, fractals are used for compressing images.

Fractal Geometry
In the first half of 20 th century, mathematical objects were considered strange objects which did not have any important application. Mandelbrot was one of the first mathematicians who recognized such strange objects and founded their mathematical root. Mandelbrot used the term fractal for those objects which were analogous at all scales. [3] He has defined fractal in his well-known book "The fractal geometry of nature" published in 1982.

Euclidean Dimensions
The figure below shows a line, square and cubic which have been divided into parts. The table below shows the relationship between topology (D) and measurement unit and the number of lines, cubic and squares (N). [13] In general, the relationship between N, L and D is expressed by this formula: By obtaining log of the two sides of Eq. -1, the formula below is obtained: In Euclidean geometry, curves include the finite number of segment lines which are one-dimensional. However, using Euclidean dimension is not suitable for fractal curves.

Fractal Coding Algorithm
In fractal compression, an image is defined by a set of compact plane conversions which describe analogous sections of an image. Fractal coding is based on mathematical results of Iteration Fractal Systems (IFS). [14] By introducing iteration function systems, fractal compression became more real. In this technique, we first divide the image into blocks in dimensions N×N which do not overlap each other. Each block is called Range Block or briefly R Block. We consider blocks with dimensions 2N×2N on the image and call these blocks Domain Block or briefly D Block. On the contrary to R blocks, D blocks overlap each other. After determining these blocks, we find a D block for each R block based on a set of plane conversions in order that collage error would be minimal in the following equation.
We can convert a square by eight methods using rotation and inversion to another square. The figure below shows these eight conversions for a square in dimensions 2×2 and its pixels are marked with numbers 1, 2, 3, 4.

Fig. 7. Eight plane conversions obtained by rotation and inversion.
Since the number of pixels for each D block is four times the number of pixels for each R block, we need to make each D block equal to R block in size using interpolation. W conversion in Eq. 3 is a combination of geometric conversions and brightness.
According to Eq. (4), one pixel in coordinates of grey surface was scaled using geometric conversion parameters and then is replaced by some parameters. The value of it is scaled based on resolution parameter and then is transmitted by brightness parameter. Reducing Eq. 3 has two meanings: first is finding an appropriate D block and second is finding suitable resolution and brightness for W conversion in Eq. (4): Therefore to obtain fractal conversion for each range blocks from domain blocks, we seek a block that the converted form of it or itself equals to that block after adjusting brightness, resolution and equality in size [10] and in this way, each image block is expressed in terms of another block in the same image and as a result, the entire image is a conversion of the same image. Each of these conversions includes the following components that have to be stored.
A) The center of range block B) The number of first point in domain block C) Parameters regarding the conversion of a range to its corresponding domain which includes 6 real numbers a, b, c, d, e, f. Such parameters are determined as follows. In general, encoding information inside a coded image is better than encoding in an intact image since hackers are likely to decode a coded image at first and thus, there will be less possibility to hack hidden information. To encode an image, there are different techniques which were explained briefly in the first chapter. [8] Since the main goal of this paper is to hide and retrieve information with the least error, encoding has been carried out by a random bit string and we will discuss about it in this section.

Converting an Image into Bit String
The original image is J that has M×N pixel and every pixel contains eight bits. To encode this image, we first convert its pixels into bits so that a bit string in length M×N×8 is obtained. Such conversion is obtained from Eq. 5.
In the above equation, , represents the value of pixels in position i, j and , represents Vth bit in that pixel.

Encoding by a Random Bit String
After converting an image into bit, a random bit string having the same length of bits resulting from ȷ image is produced and we represent it by , . Encoding is done by XOR between two bit strings and it is shown in the equation below: , , , , represents the vth bit in i, j which has been encoded. The operator represents XOR. To convert this bit string into coded pixels, Eq. 7 is used. ' , represents the value of pixels in coded image that are in position i, j.
By putting pixels next to each other, the coded image ' is obtained.

Finding a Block Pair by Homomorphism
To encode information which is in the form of bit string, two pixel blocks of the coded image are required. These two blocks can be selected as adjacent, however to enhance hiding operation, these two blocks are selected as nonadjacent as far as possible. [5] Homomorphism and finding the pair of blocks are performed both after and before hiding (in receiver and transmitter respectively). Since hiding three cheap bits changes some pixels of the image, the effect of variations in these three bits shall be cancelled to select equal pairs in the receiver and transmitter. [1] For this reason, three variable bits (three cheap bits) are considered as " 0 " . The resultant image is -. Next, this image is divided into blocks having the same size b×b. In order that blocks can have the greater images, it is better b to be multiples of 4.
Then the block in position p,q is called as . /,0 . Next, the processes of finding nonadjacent block pairs are presented below: (1) The values of pixels in block . -,-are placed in a new block called 1.
O=d > H rI S Where d > and rI are the means of R and D respectively and they are two numbers.
(4) The difference between the converted form of block D called 1 3 KL MN O 1 PQ RSTURQQR MV: The distance between the subsequent blocks and block 1 is calculated according to processes 1 to 4. For the third block this is calculated up to M×N that and it is known as X -,Y to X [,\ .
(5) The values of X /,0 are arranged in an ascending order and the location of the first obtained value represents a block which has the least variance with block 1. (6) By cancelling this block pair from the photo blocks -, processes 1 to 6 continue until each block finds its own underlying pair. The flowchart for the suggested discussions is shown in below.

Fig. 8. Homomorphism.
After block pairs were identified by the introduced method in the previous stage, now we can hide a bit in each block pair of the image J ' . Assume that block (1, 1) is corresponding to (p, q). Each block is randomly divided into two sets.
All processes shall be repeated on transmitter's side to extract hidden information on receiver's side. We must first identify block pairs using homomorphism and then deal with information extraction using smoothness equation after decoding the image . Since the smoothness level of one of the two blocks, which had been paired before, is reduced, an equation of smoothness has been used to extract hidden bits.
In general, assume that block (p, q) is corresponding to (i, j).
The difference between ^_ ' /,0 and ^_ ' , is obtained using the equations: One of the important points in sending the image containing information is noise. [6] If the transmitted image reaches the receiver with noise, information extraction and retrieval of the original image face some problems and error is maximized. In addition to transmitting image in an environment without noise, transmittance is also investigated in noisy environment so that noise is added to the resultant image after hiding information in a coded image.
In most of the suggested methods, the effect of noise on the transmitted image was not regarded in hiding data in the image. Due to the adjacency of the two sets in which a bit is hidden, the possibility for attacking and finding a hidden bit will be high. For this reason, a set of pixels needed for embedding bits is selected as non-adjacent for having a safer hiding using homomorphism. [4]

Result
To extract information, the entire image must be encoded in one place. Given discussions we mentioned in chapter 4, this method requires that each block is compared with all developed blocks in the image to find its own pair. If a part of the image is decoded, bits of that part can be retrieved. This causes the effect of encoding to be positive on hiding in the suggested method. By having a robust code, information extraction is generally prevented. For example, assume that only x block (a small value with respect to the number of image blocks) cannot be decoded. In such circumstances, regardless of retrieval error, only x bit from the main bit string cannot be retrieved for the previous introduced methods, however we can retrieve hidden bit from the rest of blocks. In the suggested method, information extraction faces some problems given that each block is dependent on all the remaining blocks for finding its own pair and even it is sometimes impossible to extract a correct bit.
In the previous methods, the study of results has been carried out on 4 images Lena, Baboon, sailboat, Splash. To compare in a better way, these photos are used here. They are shown in Fig. 8. The first image shows Lena which has been encoded by a random bit string. The second image shows the same coded image after hiding in the transmitter and decoding and extracting information in the receiver. The block size is chosen 16 (b=16). By this size, a hidden bit string is completely and correctly extracted and the original image is retrieved. The diagram of bit error with respect to the size of blocks for the suggested method is shown in the figure below. The important point in the two figures above is that the size of blocks is 4 at the beginning while it is 8 for the suggested methods.
The figure below shows an example of comparison for minimizing error of this method compared to the previous methods. This diagram is related to the image Lena and white blocks indicate those blocks which have faced an error in extracting bit strings.

Conclusion
In this study, a new method is introduced for hiding information. in coded images which minimized error from the previous methods up to an acceptable level. Moreover, the For Gosse noise, the suggested method reduces error well but for pepper and salt noise, error is sometimes reduced and occasionally it is increased compared to the former methods. The reason is that pepper and salt noise changes the amount of pixels with a specific density into maximal and minimal. This change not only produces error while extracting data but also causes blocks not to find their own pairs. As a result, these blocks cause to produce error in two ways and the latter error is not produced for the previous methods.