Hiding a Covert Digital Image by Assembling the RSA Encryption Method and the Binary Encoding Method

The Rivest-Shamir-Adleman (RSA) encryption method and the binary encoding method are assembled to form a hybrid hiding method to hide a covert digital image into a dot-matrix holographic image. First, the RSA encryption method is used to transform the covert image to form a RSA encryption data string.Then, all the elements of the RSA encryption data string are transferred into binary data. Finally, the binary data are encoded into the dot-matrix holographic image. The pixels of the dot-matrix holographic image contain seven groups of codes used for reconstructing the covert image. The seven groups of codes are identification codes, covert-image dimension codes, covert-image graylevel codes, pre-RSA bit number codes, RSA key codes, post-RSA bit number codes, and information codes. The reconstructed covert image derived from the dot-matrix holographic image and the original covert image are exactly the same.


Introduction
Image hiding methods can encode covert images in the space domain or in the spatial frequency domain.For spacedomain encoding cases, hidden covert images can be reconstructed without any distortion usually, but their hiding security is lower often.On the other hand, for spatial-frequencydomain encoding cases, their hiding security is higher often, but there is more or less distortion for reconstructed covert images usually.Because spatial-frequency-domain encoding cases cannot reconstruct exact covert images, this paper will focus on space-domain encoding cases only.Of course, both higher security and higher noise-attack resistance are discussed here.
Many methods for hiding covert images in the space domain have been proposed.Image-transform method [1][2][3][4], cellular automata method [5], chaotic sequence method [6], image-scrambling method [7,8], light separation method [9,10], histogram shifting method [11,12], and communication channel method [13] are some examples.All the methods can work well, but most of them can be applied to printed or digital images only, whereas holographic images have become very popular and they appear on credit cards and bills.Therefore, other methods for hiding covert images on holographic holograms are needed.This paper will propose a hybrid hiding method to satisfy the requirement.The proposed method transforms a covert image with the Rivest-Shamir-Adleman (RSA) encryption method and encodes the transformed data into a dot-matrix holographic image with the binary encoding method.
The RSA encryption method is widely used in electronic document security.The RSA encryption method needs keys , , and  to encode and decode data [14][15][16][17][18][19].The RSA encryption method usually uses very huge key , which is, more than 100 bits, for assuring enough high security, so it is troublesome work to use the method.This paper will assemble the RSA encryption method and the binary encoding method [20] to allow keys with only tens of bits to be used and enough high security is still assured.The RSA encryption method includes three steps.Firstly, it transforms a covert image to form a data string.Secondly, it transforms the data string to form a RSA encryption data string by using the standard RSA encryption method according to encryption keys.Finally, it transforms the RSA encryption data string to form an array.On the other hand, the binary encoding method uses binary data to denote all the element values of the RSA encryption string and encodes the binary data into a dot-matrix holographic image [21].The pixels of the covert image contain seven groups of binary codes used for decoding the RSA encryption string.The seven groups of codes are identification codes, covert-image dimension codes, covert-image graylevel codes, pre-RSA bit number codes, RSA key codes, post-RSA bit number codes, and information codes.The RSA encryption string can be decoded directly from the dot-matrix holographic image.
Because the proposed hybrid hiding method possesses two layers of security (one layer is from the RSA encryption method and the other layer is from the binary encoding method), it can protect covert images very well.Unauthorized people can hardly reconstruct covert images correctly, but authorized people can easily reconstruct covert images correctly.Most of all, covert image reconstruction does not cause image distortion.

Theory
2.1.Reviewing the RSA Encryption Method.Assume that C is an  ×  2  -graylevel covert image for encoding, and assume that D is an  ×  matrix transformed by the RSA encryption method.For using the RSA encryption method, three keys (integers) are needed and the three keys are denoted by , , and .The key  is an integer formed by the multiplication of two unequal prime numbers  and ; that is, Let an integer  be formed by Then the key  should be an integer between 2 and , that is, 2 <  < , and the highest common factor of  and  is 1.The key  is derived when the remainder for the division ( × )/ equals 1; that is, where the symbol "mod" denotes the modulus-after-division operation.
The keys for the encoding and decoding are used as below.
(1) An integer s (before the RSA encoding) modulated by the RSA encryption must be smaller than .
(2) Another integer t (after the RSA encoding) is derived from the RSA encryption modulation of the integer s according to (3) The integer s can be derived from the RSA encryption modulation of the integer t according to  ≡   mod .
Equations (6a) and (6b) are an illustration to explain the RSA encryption processes for a 3 × 4 matrix.Equation (6a) is a matrix C before the RSA encoding and (6b) is a matrix D after the RSA encoding, where the keys , , and  = 55, 13, and 37).Every element  in C and its corresponding element  in D have the relationships as described by ( 4) and ( 5): To avoid using too many similar equations in this paper, an equation for plural uses is defined as where  is an integer; all  1 ,  2 , . .., and   are 0 or 1; and  0 is another integer.Identification codes are a set of private binary codes used to judge if the data hidden in the covert image is encoded with the binary encoding method or not.The bit amount of the codes has to be big enough, for example, 1111001111001010110000110000 with 28 bits.The codes locate at bits 1∼28 in the first row of the matrix T.
Covert-image dimension codes  and  are used to derive the size  ×  of the covert image, and they include two sets of ten binary codes.The parameter M is indicated by the first set of ten binary codes  1 ,  2 , . . .,  9 , and  10 .The relationship of  and  1 ∼ 10 is similar to (7), but every  has to be replaced by , and  0 = 3 and  = 10.The parameter  is indicated by the second set of ten binary codes  1 ,  2 , . . .,  9 , and  10 .The relationship of  and  1 ∼ 10 is similar to (7), but every  has to be replaced by , and  0 = 3 and  = 10.The codes locate at bits 29∼48 in the first row of the matrix T.
Covert-image graylevel codes are used to derive the parameter  corresponding to the 2  graylevels of the covert image.The parameter  is indicated by six binary codes  1 ,  2 ,  3 ,  4 ,  5 , and  6 .The relationship of  and  1 ∼ 6 is similar to (7), but every  has to be replaced by , and  0 = 1 and  = 6.The codes locate at bits 49∼54 in the first row of the matrix T.
Pre-RSA bit number codes are used to denote the number of bits  corresponding to every element of a data string for the RSA encryption process.The parameter  is indicated by six binary codes  1 ,  2 ,  3 ,  4 ,  5 , and  6 .The relationship of  and  1 ∼ 6 is similar to (7), but every  has to be replaced by , and  0 = 1 and  = 6.The codes locate at bits 55∼60 in the first row of the matrix T.
RSA key codes are used to denote the keys  and .Although three keys , , and  are needed for encoding and decoding data strings,  is needed for the encoding only.The key  is indicated by thirty-five binary codes  1 ,  2 , . . .,  34 , and  35 .The relationship of n and  1 ∼ 35 is similar to (7), but every  has to be replaced by , and  0 = 100 and  = 35.The codes locate at bits 61∼95 in the first row of the matrix T. The key  is indicated by thirty-five binary codes  1 ,  2 , . . .,  34 , and  35 .The relationship of d and  1 ∼ 35 is similar to (7), but every  has to be replaced by , and  0 = 2 and  = 35.The codes locate at bits 96∼130 in the first row of the matrix T.
Post-RSA bit number codes are used to specify the number of bits  corresponding to every element of the RSA encryption data string.The parameter a is indicated by six binary codes  1 ,  2 ,  3 ,  4 ,  5 , and  6 .The relationship of a and  1 ∼ 6 is similar to (7), but every  has to be replaced by a, and  0 = 2 and  = 6.The codes locate at bits 131∼136 in the first row of the matrix T.
Information codes are used to reconstruct the RSA encryption data string for decoding the covert image C.

Encoding Processes.
The processes to encode the  ×  covert image C into the  ×  holographic image H are explained below.
(1) Set a binary-data array R with 1 ×  elements.The elements of R are copied from identification codes (for the first range), covert-image dimension codes (for the second range), covert-image graylevel codes (for the third range), pre-RSA bit number codes (for the fourth range), RSA key codes (for the fifth range), and post-RSA bit number codes (for the sixth range), whereas the other elements of R not copied from the six groups of codes are all set as 0.
(2) The elements of the  ×  covert image C are copied to form the elements (from the left side to the right side) of a string A with  ×  elements from the first row to the last row (the first priority) and from the left side to the right side (the second priority).
(5) Create a data string E with ××/ elements from the  ×  ×  elements of the binary-data string B (all b bits of binary data are used to form an element of the data string for the RSA encryption) according to where 1 ≤  ≤  ×  × /.( 6) Transform the data string E with ××/ elements to a data string F with ××/ elements by using (4) with the keys  and .
(7) Decompose every element F(k) of F into a binary codes   () ( = 0, 1, . . .,  − 1) (all a bits of binary data are used to denote every element of the RSA encryption data string) according to where 1 ≤  ≤  ×  ×  × /.( 8) Create a binary-data string G with  ×  ×  × / elements according to where 1 ≤  ≤  ×  × / and 0 ≤  ≤  − 1. ( 9) Copy all of the  ×  ×  × / binary elements of G (from the left side to the right side) to form a (−1)× binarydata matrix S (from the first row to the last row and from the left side to the right side).Since the amount  ×  ×  × / of the elements of G is smaller than ( − 1) × , there are ( − 1) ×  −  ×  ×  × / elements in S not copied from the elements of G.The values of these extra elements are all set as 0.
(10) Combine the 1 ×  binary-data array R and the ( − 1)× binary-data matrix S to form a × binary-data matrix T. The first row of T comes from R, and the other rows of T come from S. (11) Hide the  ×  binary-data matrix T into the  ×  dot-matrix holographic image H with the specified grating dot feature [21].
Equations (13a)-(13i) illustrate an example of the encoding processes.The binary-data array R with 1 × 6 elements is shown in (13a), the covert matrix C is shown in (13b), the data string A is shown in (13c), the binary-data string B is shown in (13d), the data string E is shown in (13e), the RSA encryption data string F with the keys (, ) = (55, 13) is shown in (13f), the binary-data string G is shown in (13g), the binary-data matrix S is shown in (13h), and the binary-data matrix T is shown in (13i): 2.4.Decoding Processes.The processes for reconstructing the covert image C * from the dot-matrix holographic image H are explained below.
(1) Determine every element T(, ) of the  ×  binarydata matrix T from every grating dot feature of the  ×  dot-matrix holographic image H according to the specified grating dot feature.
(2) Check the identification codes located at bits 1∼28 in the first row of T to judge whether the covert image H * contains codes encoded by the binary encoding method or not.
(3) According to the codes located at bits 29-136 in the first row of T decode the parameters , , , , , , and .
(4) Copy the first  ×  ×  × / elements in the second to final rows (from the top to the bottom and from the left side to the right side) of T to form the  ×  ×  × / elements (from the left side to the right side) of the binary-data string G.
(5) Create the data string F with  ×  × / elements from the elements of the  ×  ×  × / binary-data matrix G according to where 1 ≤  ≤  ×  × /.
(6) Transform the data string F with ××/ elements to a data string E with  ×  × / by using (5) with the keys n and d.
(8) Create a data string A with  ×  elements from the elements of the  ×  ×  binary-data matrix B according to where 1 ≤  ≤  × . ( 9) Create the × matrix C from the data string A with  ×  elements according to where 1 ≤  ≤  and 1 ≤  ≤ .=1   ⋅2 −1 +1).The 55th to 60th elements (the fourth range) in R are specified as the pre-RSA bit number codes.Because the selected pre-RSA bit number b in this case is four, the codes are 000011 (i.e., 4 = ∑ 6 =1   ⋅ 2 −1 + 1).The 61st to 130th elements (the fifth range) in R are specified as the RSA key codes for the keys n and d.Because the key n both for the encoding and decoding is set as 247, the 61st to 130th elements in R are 00000000000000000000000000010010011 (i.e., 247 = ∑ 35 =1   ⋅ 2 −1 + 100).Because the key e for the encoding is set as 11, the key d for the decoding must equal 59.Therefore, the 96th to 130th elements in R are 00000000000000000000000000000111001 (i.e., 59 = ∑ 35 =1   ⋅ 2 −1 + 2).The 131st to 136th elements (the sixth range) in the first row of R are the post-RSA bit number codes.Because the selected post-RSA bit number a used in this case is eight, the 131st to 136th elements in the first row of R are 000110 (i.e., 8 = ∑ 6 =1   ⋅ 2 −1 + 2).The 137th to 256th elements in the first row of R are all set as 0.

Experiments
After that, create the 57344 (= 64×64×7/4×8) binary-data string G by encoding the 1 × 7168 modified RSA encryption data string F. Then copy the binary-data elements of G to form the 255 × 256 binary-data matrix S. Because the matrix S contains 65280 (= 255 × 256) elements and the binary-data string G only contains 57344 elements, the values of the extra 7936 elements of S are all set as 0. The 256 × 256 binary-data matrix T combined from the 1 × 256 binary-data string R and the 255 × 256 binary-data matrix S is shown in Figure 3. Figure 4 shows a dot-matrix holographic image (composed of many grating dots) created by a two-beam writer (Sparkle) [22].The holographic image is used to hide the binary-data The grating dot pitch is about 63.5 m.The size of the holographic image is about 16.2 mm × 16.2 mm.The grating dots in the same column or row should be in a line for a dot-matrix hologram without hiding binary data, whereas the grating dots in the same column are in two separated lines for the dot-matrix hologram in Figure 4.The grating dots in the right line are used to denote the datum "1" and the grating dots in the left line are used to denote the datum "0".The distance between the two lines is about 15 m.All  the grating dots on the hologram in Figure 4 correctly hide the data in the binary-data matrix T for Figure 3. =1   ⋅ 2 −1 + 3) and they are encoded at the 29th to 38th elements in R; the dimension codes for N are also 0001111101 and they are encoded at the 39th to 48th elements in R. The 49th to 54th elements in R are specified as the covert-image graylevel codes.Since the parameter g of the covert image used in this case is one (i.e., 2 = 2 1 ), the codes are 000000 (i.e., 1 = ∑ 6 =1   ⋅ 2 −1 + 1).The 55th to 60th elements (the fourth range) in R are specified as the pre-RSA bit number codes.Because the selected pre-RSA bit number b in this case is eight, the 55th to 60th elements in R are 000111 (i.e., 8 = ∑ 6 =1   ⋅ 2 −1 + 1).The 61st to 130th elements in R are specified as the RSA key codes for the keys n and d.
Because the key n is set as 323, the 61st to 130th elements in R are 00000000000000000000000000011011111 (i.e., 323 = ∑ 35 =1   ⋅ 2 −1 + 100).Because the key e is set as 23, the key d must equal 263.Therefore, the 96th to 130th elements in R are 00000000000000000000000000100000101 (i.e., 263 = ∑ 35 =1   ⋅ 2 −1 + 2).The 131st to 136th elements in the first row of R are the post-RSA bit number codes.Because the selected post-RSA bit number a used in this case is ten, the 131st to 136th elements in the first row of R are 001000 (i.e., 10 = ∑ 6 =1   ⋅ 2 −1 + 2).The 137th to 256th elements in the first row of R are all set as 0.
After that, create the 20480 (= 128×128×1/8×10) binarydata string G by encoding the 1×4096 RSA encryption data string F. Then copy the binary-data elements of G to form the 255×256 binary-data matrix S. Because the matrix S contains 65280 (= 255 × 256) elements and the binary-data string G only contains 20480 elements, the values of the extra 44800 elements of S are all set as 0. The 256×256 binary-data matrix T combined from the 1 × 256 binary-data string R and the 255 × 256 binary-data matrix S is shown in Figure 6.The dotmatrix holographic image H for this case is shown in Figure 7, almost the same as that in Figure 4. Some of the grating dots at the left-upper corner of the dot-matrix holographic image H are shown in Figure 8.All the grating dots on the holographic image correctly hide the data in the binary-data matrix T for Figure 6.The original covert image C and the reconstructed covert image C * derived from the holographic image H are exactly the same.
The above-mentioned processes for encoding the covert image C can be concluded as follows:

Discussions
The values of  0 ,  0 ,  0 ,  0 ,  0 , and  0 are determined according to the idea of a designer and no reasons are needed.Because these values are uncertain for unauthorized people, the binary encoding method has high security.
The proposed hiding method is only demonstrated for clearness and simplification in this paper.If higher security is needed for the hiding method, more complex processes can be used, for example, changing the specified code positions in R, changing the length of selected bit number codes, or changing the values of  0 ,  0 ,  0 ,  0 ,  0 , and  0 .
The security of the proposed method depends on both the RSA encryption and the binary encoding method.For the RSA encryption, a very big  is not necessary for the proposed method because private RSA keys unknown for unauthorized people are used (normal RSA encryption methods use public keys known by everyone).For the binary encoding method, it is difficult to decode codes because many uncertain parameters (for unauthorized people) are used.Both the RSA encryption and the binary encoding method have high security, so the security of the proposed method is high.
The direct calculation for  ≡   mod  is not accepted by a computer usually because the number   is too huge.Therefore, a calculation accepted by a computer is needed.A simple method is to multiply  2 with  and do the modulusafter-division operation with n for d-1 times; that is,  ≡ (((( 2 mod ) × ) × (mod ) ×) mod , . . ., ) mod .

Conclusions
The proposed hiding method combines the RSA encryption method and the binary encoding method to encrypt a covert image C into a dot-matrix holographic image H.The RSA encryption method uses the covert image C to form a RSA

Figure 1
Figure 1 is used as the covert images, where Figure 1(a) is a 64 × 64 128-graylevel image and Figure 1(b) is a 128 × 128 binary image.Figure 2 shows a 256 × 256 256-graylevel image used as the host image for two simulations.The first experiment for encoding the covert image in Figure1(a) by assembling the modified RSA encryption method and the binary encoding method to form a holographic image H is shown below.The elements in the 1 × 256 binary-data string R are firstly determined, where R is used to encode identification codes, covertimage dimension codes, covert-image graylevel codes, pre-RSA bit number codes, RSA key codes, and post-RSA bit number codes.The first to 28th elements (the first range) in R are specified as the identification codes, and they are set as 1111001111001010110000110000.The 29th to 48th elements (the second range) in R are specified as the covertimage dimension codes.Since the size of the covert image

Figure 4 :
Figure 4: Dot-matrix holographic image H for hiding the binarydata matrix T for Figure 1(a).

Figure 5 :
Figure 5: Some grating dots at the upper-right corner of the dotmatrix holographic image H for Figure 1(a).
Figure 5 shows some of the grating dots at the upper-right corner of the dot-matrix holographic image.The original covert image C and the reconstructed covert image C * derived from the holographic image H are exactly the same.The second experiment for encoding Figure 1(b) is shown below.The first to 28th elements in R are also specified as the identification codes, and they are set as 1111001111001010110000110000.The 29th to 48th elements in R are specified as the covert-image dimension codes.Since the size of the covert image in Figure 1(b) is 128 × 128, the dimension codes for M are 0001111101 (i.e., 128 = ∑ 10

( 1 )
use C, , and  to form G and R; (2) use G and R to form T; and (3) hide T to form H. On the other hand, the processes for reconstructing C * can be concluded as follows: (1) derive T from H; (2) use T to form G and R; and (3) use n, d, G, and R to form C * .Since the reconstruction possesses are the reversed version of the encoding processes, the former are not demonstrated here.

Figure 7 :
Figure 7: Dot-matrix holographic image H for hiding the binarydata matrix T for Figure 1(b).

Figure 8 :
Figure 8: Some grating dots at the upper-left corner of the dotmatrix holographic image H for Figure 1(b).