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

Authors: Kuang Tsan Lin; Sheng Lih Yeh
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

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.


---

## Body

## 1. Introduction

Image hiding methods can encode covert images in the space domain or in the spatial frequency domain. For space-domain 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-frequency-domain 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–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 keysn, e, and d to encode and decode data [14–19]. The RSA encryption method usually uses very huge key n, 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.


## 2. Theory

### 2.1. Reviewing the RSA Encryption Method

Assume thatC is an M
×
N
2
g-graylevel covert image for encoding, and assume thatD is an M
×
N 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 n, e, and d. The key n is an integer formed by the multiplication of two unequal prime numbers p and q; that is,
(1)
n
=
p
×
q
.Let an integerr be formed by
(2)
r
=
(
p
-
1
)
×
(
q
-
1
)
.
Then the key e should be an integer between 2 and r, that is, 2
<
e
<
r, and the highest common factor of e and r is 1. The key d is derived when the remainder for the division (
e
×
d
)
/
r equals 1; that is,(3)
1
≡
(
e
×
d
)
mod
⁡
r
,
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 thann.
(2)
Another integer t (after the RSA encoding) is derived from the RSA encryption modulation of the integer s according to(4)
t
≡
s
e
mod
⁡
n
.
(3)
The integer s can be derived from the RSA encryption modulation of the integer t according to(5)
s
≡
t
d
mod
⁡
n
.Equations (6a) and (6b) are an illustration to explain the RSA encryption processes for a 3
×
4 matrix. Equation (6a) is a matrixC before the RSA encoding and (6b) is a matrixD after the RSA encoding, where the keys n, e, and d
=
55,13, and 37
). Every element s inC and its corresponding element t inD have the relationships as described by (4) and (5):(6a)
C
=
[
9
2
22
27
28
33
17
10
5
34
12
14
]
,
(6b)
D
=
[
14
52
22
37
18
33
7
10
15
34
12
49
]
.


### 2.2. The Hybrid Hiding Method

LetT be a P
×
Q matrix to encode an M
×
N covert imageC, and letH be a P
×
Q holographic image for hiding the matrixT. All the binary data encoded in the matrixT are binary codes and they are categorized into seven groups of codes, identification codes, covert-image dimension codes, covert-image graylevel codes, pre-RSA bit number codes, RSA key codes, post-RSA bit codes, and information codes. Identification codes are used to judge if the codes encoded in the matrixT belong to the binary encoding method or not; covert-image dimension codes M and N are used to denote the size of the covert image; covert-image graylevel codes 2
g are used to denote the graylevels of the covert image; pre-RSA bit number codes are used to denote the number of bits corresponding to every element of a data string before the RSA encryption; RSA key codes are used for the RSA encoding and decoding; and post-RSA bit number codes are used to denote the number of bits corresponding to every element of a data string after the RSA encryption. All the above six groups of codes are located at the first row of the matrixT. Information codes are used to denote the binary data encoded from the data string after the RSA encryption and they are located at the second to final rows of the matrixT.To avoid using too many similar equations in this paper, an equation for plural uses is defined as(7)
k
=
∑
i
=
1
T
k
i
·
2
i
-
1
+
k
0
,
where k is an integer; all k
1
,
k
2
,
…, and k
T are 0 or 1; and k
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 matrixT.Covert-image dimension codesM and N are used to derive the size M
×
N of the covert image, and they include two sets of ten binary codes. The parameterM is indicated by the first set of ten binary codes M
1
,
M
2
,
…
,
M
9, and M
10. The relationship of M and M
1~M
10 is similar to (7), but every k has to be replaced by M, and M
0
=
3 and T
=
10. The parameter N is indicated by the second set of ten binary codes N
1
,
N
2
,
…
,
N
9, and N
10. The relationship of N and N
1~N
10 is similar to (7), but every k has to be replaced by N, and N
0
=
3 and T
=
10. The codes locate at bits 29~48 in the first row of the matrixT.Covert-image graylevel codes are used to derive the parameterg corresponding to the 2
g graylevels of the covert image. The parameter g is indicated by six binary codes g
1
,
g
2
,
g
3
,
g
4
,
g
5, and g
6. The relationship of g and g
1~g
6 is similar to (7), but every k has to be replaced by g, and g
0
=
1 and T
=
6. The codes locate at bits 49~54 in the first row of the matrixT.Pre-RSA bit number codes are used to denote the number of bitsb corresponding to every element of a data string for the RSA encryption process. The parameter b is indicated by six binary codes b
1
,
b
2
,
b
3
,
b
4
,
b
5, and b
6. The relationship of b and b
1~b
6 is similar to (7), but every k has to be replaced by b, and b
0
=
1 and T
=
6. The codes locate at bits 55~60 in the first row of the matrixT.RSA key codes are used to denote the keysn and d. Although three keys n, e, and d are needed for encoding and decoding data strings, e is needed for the encoding only. The key n is indicated by thirty-five binary codes n
1
,
n
2
,
…
,
n
34, and n
35. The relationship ofn and n
1~n
35 is similar to (7), but every k has to be replaced by n, and n
0
=
100 and T
=
35. The codes locate at bits 61~95 in the first row of the matrixT. The key d is indicated by thirty-five binary codes d
1
,
d
2
,
…
,
d
34, and d
35. The relationship ofd and d
1~d
35 is similar to (7), but every k has to be replaced by d, and d
0
=
2 and T
=
35. The codes locate at bits 96~130 in the first row of the matrixT.Post-RSA bit number codes are used to specify the number of bitsa corresponding to every element of the RSA encryption data string. The parametera is indicated by six binary codes a
1
,
a
2
,
a
3
,
a
4
,
a
5, and a
6. The relationship ofa and a
1~a
6 is similar to (7), but every k has to be replaced bya, and a
0
=
2 and T
=
6. The codes locate at bits 131~136 in the first row of the matrixT.Information codes are used to reconstruct the RSA encryption data string for decoding the covert imageC.


### 2.3. Encoding Processes

The processes to encode theM
×
N covert imageC into the P
×
Q holographic imageH are explained below.(
1
) Set a binary-data arrayR with 1
×
Q elements. The elements ofR 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 ofR not copied from the six groups of codes are all set as 0.(
2
) The elements of the M
×
N covert imageC are copied to form the elements (from the left side to the right side) of a stringA with M
×
N elements from the first row to the last row (the first priority) and from the left side to the right side (the second priority).(
3
) Decompose every elementA(k) ofA into g (because the covert image possesses 2
g graylevels) binary codes c
i
(
k
)
(
i
=
0
,
1
,
…
,
g
-
1
) according to
(8)
A
(
k
)
=
∑
i
=
0
g
-
1
c
i
(
k
)
×
2
i
.(
4
) Create a binary-data stringB with M
×
N
×
g elements according to
(9)
B
(
i
+
g
×
(
k
-
1
)
)
=
c
i
(
k
)
,
where 1
≤
k
≤
M
×
N and 0
≤
i
≤
g
-
1.(
5
) Create a data stringE with M
×
N
×
g
/
b elements from the M
×
N
×
g elements of the binary-data stringB (allb bits of binary data are used to form an element of the data string for the RSA encryption) according to(10)
E
(
k
)
=
∑
m
′
=
1
b
B
(
b
×
(
k
-
1
)
+
m
′
)
×
2
b
-
m
′
,
where 1
≤
k
≤
M
×
N
×
g
/
b.(
6
) Transform the data stringE with M
×
N
×
g
/
b elements to a data stringF with M
×
N
×
g
/
b elements by using (4) with the keys n and e.(
7
) Decompose every elementF(k) ofF intoa binary codes f
i
(
k
)
(
i
=
0
,
1
,
…
,
a
-
1
) (alla bits of binary data are used to denote every element of the RSA encryption data string) according to
(11)
F
(
k
)
=
∑
i
=
0
a
-
1
f
i
(
k
)
×
2
i
,
where 1
≤
k
≤
M
×
N
×
g
×
a
/
b.(
8
) Create a binary-data stringG with M
×
N
×
g
×
a
/
b elements according to
(12)
G
(
i
+
g
×
(
k
-
1
)
)
=
f
i
(
k
)
,
where 1
≤
k
≤
M
×
N
×
g
/
b and 0
≤
i
≤
a
-
1.(
9
) Copy all of the M
×
N
×
g
×
a
/
b binary elements ofG (from the left side to the right side) to form a (
P
-
1
)
×
Q binary-data matrixS (from the first row to the last row and from the left side to the right side). Since the amount M
×
N
×
g
×
a
/
b of the elements ofG is smaller than (
P
-
1
)
×
Q, there are (
P
-
1
)
×
Q
-
M
×
N
×
g
×
a
/
b elements inS not copied from the elements ofG. The values of these extra elements are all set as 0.(
10
) Combine the 1
×
Q binary-data arrayR and the (
P
-
1
)
×
Q binary-data matrixS to form a P
×
Q binary-data matrixT. The first row ofT comes fromR, and the other rows ofT come fromS.(
11
) Hide the P
×
Q binary-data matrixT into the P
×
Q dot-matrix holographic imageH with the specified grating dot feature [21].Equations (13a)–(13i) illustrate an example of the encoding processes. The binary-data arrayR with 1
×
6 elements is shown in (13a), the covert matrixC is shown in (13b), the data stringA is shown in (13c), the binary-data stringB is shown in (13d), the data stringE is shown in (13e), the RSA encryption data stringF with the keys (
n
,
e
)
=
(
55,13
) is shown in (13f), the binary-data stringG is shown in (13g), the binary-data matrixS is shown in (13h), and the binary-data matrixT is shown in (13i):(13a)
R
=
[
0
1
0
1
0
1
]
,
(13b)
C
=
[
2
7
3
6
]
,
(13c)
A
=
[
2
7
3
6
]
,
(13d)
B
=
[
0
1
0
1
1
1
0
1
1
1
1
0
]
,
(13e)
E
=
[
5
13
14
]
,
(13f)
F
=
[
15
8
49
]
,
(13g)
G
=
[
0
0
0
0
1
1
1
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
1
]
,
(13h)
S
=
[
0
0
0
0
1
1
1
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
1
0
0
0
0
0
0
]
,
(13i)
T
=
[
0
1
0
1
0
1
0
0
0
0
1
1
1
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
1
0
0
0
0
0
0
]
.


### 2.4. Decoding Processes

The processes for reconstructing the covert imageC
* from the dot-matrix holographic imageH are explained below.(
1
) Determine every element T
(
i
,
j
) of the P
×
Q binary-data matrixT from every grating dot feature of the P
×
Q dot-matrix holographic imageH according to the specified grating dot feature.(
2
) Check the identification codes located at bits 1~28 in the first row ofT to judge whether the covert imageH* contains codes encoded by the binary encoding method or not.(
3
) According to the codes located at bits 29
–
136 in the first row ofT decode the parameters M
,
N
,
g
,
n
,
d
,
b, and a.(
4
) Copy the first M
×
N
×
g
×
a
/
b elements in the second to final rows (from the top to the bottom and from the left side to the right side) ofT to form the M
×
N
×
g
×
a
/
b elements (from the left side to the right side) of the binary-data stringG.(
5
) Create the data stringF with M
×
N
×
g
/
b elements from the elements of the M
×
N
×
g
×
a
/
b binary-data matrixG according to
(14)
F
(
k
)
=
∑
m
′
=
1
a
G
(
a
×
(
k
-
1
)
+
m
′
)
×
2
a
-
m
′
,
where 1
≤
k
≤
M
×
N
×
g
/
b.(
6
) Transform the data stringF with M
×
N
×
g
/
b elements to a data stringE with M
×
N
×
g
/
b by using (5) with the keysn andd.(
7
) Decompose every elementE(k) ofE intob binary codes h
i
(
k
)
(
i
=
0
,
1
,
…
,
a
-
1
) according to
(15)
E
(
k
)
=
∑
i
=
0
b
-
1
h
i
(
k
)
×
2
i
and form a binary-data matrixB with M
×
N
×
g elements according to
(16)
B
(
i
(
b
-
1
)
+
k
)
=
h
i
(
k
)
,
where 0
≤
k
≤
a
-
1.(
8
) Create a data stringA with M
×
N elements from the elements of the M
×
N
×
g binary-data matrixB according to
(17)
A
(
k
)
=
∑
m
′
=
1
g
B
(
g
×
(
k
-
1
)
+
m
′
)
×
2
g
-
m
′
,
where 1
≤
k
≤
M
×
N.(
9
) Create the M
×
N matrixC from the data stringA with M
×
N elements according to
(18)
C
(
i
,
j
)
=
A
(
(
i
-
1
)
×
N
+
j
)
,
where 1
≤
i
≤
M and 1
≤
j
≤
N.


## 2.1. Reviewing the RSA Encryption Method

Assume thatC is an M
×
N
2
g-graylevel covert image for encoding, and assume thatD is an M
×
N 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 n, e, and d. The key n is an integer formed by the multiplication of two unequal prime numbers p and q; that is,
(1)
n
=
p
×
q
.Let an integerr be formed by
(2)
r
=
(
p
-
1
)
×
(
q
-
1
)
.
Then the key e should be an integer between 2 and r, that is, 2
<
e
<
r, and the highest common factor of e and r is 1. The key d is derived when the remainder for the division (
e
×
d
)
/
r equals 1; that is,(3)
1
≡
(
e
×
d
)
mod
⁡
r
,
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 thann.
(2)
Another integer t (after the RSA encoding) is derived from the RSA encryption modulation of the integer s according to(4)
t
≡
s
e
mod
⁡
n
.
(3)
The integer s can be derived from the RSA encryption modulation of the integer t according to(5)
s
≡
t
d
mod
⁡
n
.Equations (6a) and (6b) are an illustration to explain the RSA encryption processes for a 3
×
4 matrix. Equation (6a) is a matrixC before the RSA encoding and (6b) is a matrixD after the RSA encoding, where the keys n, e, and d
=
55,13, and 37
). Every element s inC and its corresponding element t inD have the relationships as described by (4) and (5):(6a)
C
=
[
9
2
22
27
28
33
17
10
5
34
12
14
]
,
(6b)
D
=
[
14
52
22
37
18
33
7
10
15
34
12
49
]
.


## 2.2. The Hybrid Hiding Method

LetT be a P
×
Q matrix to encode an M
×
N covert imageC, and letH be a P
×
Q holographic image for hiding the matrixT. All the binary data encoded in the matrixT are binary codes and they are categorized into seven groups of codes, identification codes, covert-image dimension codes, covert-image graylevel codes, pre-RSA bit number codes, RSA key codes, post-RSA bit codes, and information codes. Identification codes are used to judge if the codes encoded in the matrixT belong to the binary encoding method or not; covert-image dimension codes M and N are used to denote the size of the covert image; covert-image graylevel codes 2
g are used to denote the graylevels of the covert image; pre-RSA bit number codes are used to denote the number of bits corresponding to every element of a data string before the RSA encryption; RSA key codes are used for the RSA encoding and decoding; and post-RSA bit number codes are used to denote the number of bits corresponding to every element of a data string after the RSA encryption. All the above six groups of codes are located at the first row of the matrixT. Information codes are used to denote the binary data encoded from the data string after the RSA encryption and they are located at the second to final rows of the matrixT.To avoid using too many similar equations in this paper, an equation for plural uses is defined as(7)
k
=
∑
i
=
1
T
k
i
·
2
i
-
1
+
k
0
,
where k is an integer; all k
1
,
k
2
,
…, and k
T are 0 or 1; and k
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 matrixT.Covert-image dimension codesM and N are used to derive the size M
×
N of the covert image, and they include two sets of ten binary codes. The parameterM is indicated by the first set of ten binary codes M
1
,
M
2
,
…
,
M
9, and M
10. The relationship of M and M
1~M
10 is similar to (7), but every k has to be replaced by M, and M
0
=
3 and T
=
10. The parameter N is indicated by the second set of ten binary codes N
1
,
N
2
,
…
,
N
9, and N
10. The relationship of N and N
1~N
10 is similar to (7), but every k has to be replaced by N, and N
0
=
3 and T
=
10. The codes locate at bits 29~48 in the first row of the matrixT.Covert-image graylevel codes are used to derive the parameterg corresponding to the 2
g graylevels of the covert image. The parameter g is indicated by six binary codes g
1
,
g
2
,
g
3
,
g
4
,
g
5, and g
6. The relationship of g and g
1~g
6 is similar to (7), but every k has to be replaced by g, and g
0
=
1 and T
=
6. The codes locate at bits 49~54 in the first row of the matrixT.Pre-RSA bit number codes are used to denote the number of bitsb corresponding to every element of a data string for the RSA encryption process. The parameter b is indicated by six binary codes b
1
,
b
2
,
b
3
,
b
4
,
b
5, and b
6. The relationship of b and b
1~b
6 is similar to (7), but every k has to be replaced by b, and b
0
=
1 and T
=
6. The codes locate at bits 55~60 in the first row of the matrixT.RSA key codes are used to denote the keysn and d. Although three keys n, e, and d are needed for encoding and decoding data strings, e is needed for the encoding only. The key n is indicated by thirty-five binary codes n
1
,
n
2
,
…
,
n
34, and n
35. The relationship ofn and n
1~n
35 is similar to (7), but every k has to be replaced by n, and n
0
=
100 and T
=
35. The codes locate at bits 61~95 in the first row of the matrixT. The key d is indicated by thirty-five binary codes d
1
,
d
2
,
…
,
d
34, and d
35. The relationship ofd and d
1~d
35 is similar to (7), but every k has to be replaced by d, and d
0
=
2 and T
=
35. The codes locate at bits 96~130 in the first row of the matrixT.Post-RSA bit number codes are used to specify the number of bitsa corresponding to every element of the RSA encryption data string. The parametera is indicated by six binary codes a
1
,
a
2
,
a
3
,
a
4
,
a
5, and a
6. The relationship ofa and a
1~a
6 is similar to (7), but every k has to be replaced bya, and a
0
=
2 and T
=
6. The codes locate at bits 131~136 in the first row of the matrixT.Information codes are used to reconstruct the RSA encryption data string for decoding the covert imageC.


## 2.3. Encoding Processes

The processes to encode theM
×
N covert imageC into the P
×
Q holographic imageH are explained below.(
1
) Set a binary-data arrayR with 1
×
Q elements. The elements ofR 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 ofR not copied from the six groups of codes are all set as 0.(
2
) The elements of the M
×
N covert imageC are copied to form the elements (from the left side to the right side) of a stringA with M
×
N elements from the first row to the last row (the first priority) and from the left side to the right side (the second priority).(
3
) Decompose every elementA(k) ofA into g (because the covert image possesses 2
g graylevels) binary codes c
i
(
k
)
(
i
=
0
,
1
,
…
,
g
-
1
) according to
(8)
A
(
k
)
=
∑
i
=
0
g
-
1
c
i
(
k
)
×
2
i
.(
4
) Create a binary-data stringB with M
×
N
×
g elements according to
(9)
B
(
i
+
g
×
(
k
-
1
)
)
=
c
i
(
k
)
,
where 1
≤
k
≤
M
×
N and 0
≤
i
≤
g
-
1.(
5
) Create a data stringE with M
×
N
×
g
/
b elements from the M
×
N
×
g elements of the binary-data stringB (allb bits of binary data are used to form an element of the data string for the RSA encryption) according to(10)
E
(
k
)
=
∑
m
′
=
1
b
B
(
b
×
(
k
-
1
)
+
m
′
)
×
2
b
-
m
′
,
where 1
≤
k
≤
M
×
N
×
g
/
b.(
6
) Transform the data stringE with M
×
N
×
g
/
b elements to a data stringF with M
×
N
×
g
/
b elements by using (4) with the keys n and e.(
7
) Decompose every elementF(k) ofF intoa binary codes f
i
(
k
)
(
i
=
0
,
1
,
…
,
a
-
1
) (alla bits of binary data are used to denote every element of the RSA encryption data string) according to
(11)
F
(
k
)
=
∑
i
=
0
a
-
1
f
i
(
k
)
×
2
i
,
where 1
≤
k
≤
M
×
N
×
g
×
a
/
b.(
8
) Create a binary-data stringG with M
×
N
×
g
×
a
/
b elements according to
(12)
G
(
i
+
g
×
(
k
-
1
)
)
=
f
i
(
k
)
,
where 1
≤
k
≤
M
×
N
×
g
/
b and 0
≤
i
≤
a
-
1.(
9
) Copy all of the M
×
N
×
g
×
a
/
b binary elements ofG (from the left side to the right side) to form a (
P
-
1
)
×
Q binary-data matrixS (from the first row to the last row and from the left side to the right side). Since the amount M
×
N
×
g
×
a
/
b of the elements ofG is smaller than (
P
-
1
)
×
Q, there are (
P
-
1
)
×
Q
-
M
×
N
×
g
×
a
/
b elements inS not copied from the elements ofG. The values of these extra elements are all set as 0.(
10
) Combine the 1
×
Q binary-data arrayR and the (
P
-
1
)
×
Q binary-data matrixS to form a P
×
Q binary-data matrixT. The first row ofT comes fromR, and the other rows ofT come fromS.(
11
) Hide the P
×
Q binary-data matrixT into the P
×
Q dot-matrix holographic imageH with the specified grating dot feature [21].Equations (13a)–(13i) illustrate an example of the encoding processes. The binary-data arrayR with 1
×
6 elements is shown in (13a), the covert matrixC is shown in (13b), the data stringA is shown in (13c), the binary-data stringB is shown in (13d), the data stringE is shown in (13e), the RSA encryption data stringF with the keys (
n
,
e
)
=
(
55,13
) is shown in (13f), the binary-data stringG is shown in (13g), the binary-data matrixS is shown in (13h), and the binary-data matrixT is shown in (13i):(13a)
R
=
[
0
1
0
1
0
1
]
,
(13b)
C
=
[
2
7
3
6
]
,
(13c)
A
=
[
2
7
3
6
]
,
(13d)
B
=
[
0
1
0
1
1
1
0
1
1
1
1
0
]
,
(13e)
E
=
[
5
13
14
]
,
(13f)
F
=
[
15
8
49
]
,
(13g)
G
=
[
0
0
0
0
1
1
1
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
1
]
,
(13h)
S
=
[
0
0
0
0
1
1
1
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
1
0
0
0
0
0
0
]
,
(13i)
T
=
[
0
1
0
1
0
1
0
0
0
0
1
1
1
1
0
0
0
0
1
0
0
0
0
0
1
1
0
0
0
1
0
0
0
0
0
0
]
.


## 2.4. Decoding Processes

The processes for reconstructing the covert imageC
* from the dot-matrix holographic imageH are explained below.(
1
) Determine every element T
(
i
,
j
) of the P
×
Q binary-data matrixT from every grating dot feature of the P
×
Q dot-matrix holographic imageH according to the specified grating dot feature.(
2
) Check the identification codes located at bits 1~28 in the first row ofT to judge whether the covert imageH* contains codes encoded by the binary encoding method or not.(
3
) According to the codes located at bits 29
–
136 in the first row ofT decode the parameters M
,
N
,
g
,
n
,
d
,
b, and a.(
4
) Copy the first M
×
N
×
g
×
a
/
b elements in the second to final rows (from the top to the bottom and from the left side to the right side) ofT to form the M
×
N
×
g
×
a
/
b elements (from the left side to the right side) of the binary-data stringG.(
5
) Create the data stringF with M
×
N
×
g
/
b elements from the elements of the M
×
N
×
g
×
a
/
b binary-data matrixG according to
(14)
F
(
k
)
=
∑
m
′
=
1
a
G
(
a
×
(
k
-
1
)
+
m
′
)
×
2
a
-
m
′
,
where 1
≤
k
≤
M
×
N
×
g
/
b.(
6
) Transform the data stringF with M
×
N
×
g
/
b elements to a data stringE with M
×
N
×
g
/
b by using (5) with the keysn andd.(
7
) Decompose every elementE(k) ofE intob binary codes h
i
(
k
)
(
i
=
0
,
1
,
…
,
a
-
1
) according to
(15)
E
(
k
)
=
∑
i
=
0
b
-
1
h
i
(
k
)
×
2
i
and form a binary-data matrixB with M
×
N
×
g elements according to
(16)
B
(
i
(
b
-
1
)
+
k
)
=
h
i
(
k
)
,
where 0
≤
k
≤
a
-
1.(
8
) Create a data stringA with M
×
N elements from the elements of the M
×
N
×
g binary-data matrixB according to
(17)
A
(
k
)
=
∑
m
′
=
1
g
B
(
g
×
(
k
-
1
)
+
m
′
)
×
2
g
-
m
′
,
where 1
≤
k
≤
M
×
N.(
9
) Create the M
×
N matrixC from the data stringA with M
×
N elements according to
(18)
C
(
i
,
j
)
=
A
(
(
i
-
1
)
×
N
+
j
)
,
where 1
≤
i
≤
M and 1
≤
j
≤
N.


## 3. Experiments

Figure1 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.Covert images for simulations. (a) A64
×
64 128-graylevel image; (b) a 128
×
128 binary image.
(a)
(b)Figure 2
256
×
256 256-graylevel image used for the covert image.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 imageH is shown below. The elements in the 1
×
256 binary-data stringR are firstly determined, whereR is used to encode identification codes, covert-image 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) inR are specified as the identification codes, and they are set as 1111001111001010110000110000. The 29th to 48th elements (the second range) inR are specified as the covert-image dimension codes. Since the size of the covert image in Figure 1(a) is 64
×
64, the dimension codes forM are 0000111101 (i.e., 64
=
∑
i
=
1
10
M
i
·
2
i
-
1
+
3) and they are encoded at the 29th to 38th elements inR. The dimension codes forN are also 0000111101 and they are encoded at the 39th to 48th elements inR. The 49th to 54th elements (the third range) inR are specified as the covert-image graylevel codes. Since the parameterg of the covert image used in this case is seven (i.e., 128
=
2
7), the codes are 000110 (i.e., 7
=
∑
i
=
1
6
g
i
·
2
i
-
1
+
1). The 55th to 60th elements (the fourth range) inR are specified as the pre-RSA bit number codes. Because the selected pre-RSA bit numberb in this case is four, the codes are 000011 (i.e., 4
=
∑
i
=
1
6
b
i
·
2
i
-
1
+
1). The 61st to 130th elements (the fifth range) inR are specified as the RSA key codes for the keysn andd. Because the keyn both for the encoding and decoding is set as 247, the 61st to 130th elements inR are 00000000000000000000000000010010011 (i.e., 247
=
∑
i
=
1
35
n
i
·
2
i
-
1
+
100). Because the keyefor the encoding is set as 11, the keyd for the decoding must equal 59. Therefore, the 96th to 130th elements inR are 00000000000000000000000000000111001 (i.e., 59
=
∑
i
=
1
35
d
i
·
2
i
-
1
+
2). The 131st to 136th elements (the sixth range) in the first row ofR are the post-RSA bit number codes. Because the selected post-RSA bit numbera used in this case is eight, the 131st to 136th elements in the first row ofR are 000110 (i.e., 8
=
∑
i
=
1
6
a
i
·
2
i
-
1
+
2). The 137th to 256th elements in the first row ofR are all set as 0.After that, create the57344
(
=
64
×
64
×
7
/
4
×
8
) binary-data stringG by encoding the 1
×
7168 modified RSA encryption data stringF. Then copy the binary-data elements ofG to form the 255
×
256 binary-data matrixS. Because the matrixS contains 65280 (
=
255
×
256
) elements and the binary-data stringG only contains 57344 elements, the values of the extra 7936 elements ofS are all set as 0. The 256
×
256 binary-data matrixT combined from the 1
×
256 binary-data stringR and the 255
×
256 binary-data matrixS 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-dataT for the covert image in Figure 1(a). The holographic image is on a Shipley 1813 photoresist plate and it contains 256
×
256 grating dots. All the grating dots have the same grating pitch of 1 μm, but they have different grating orientations. The relation between the orientation θ
(
i
,
j
) (measured from the x-axis) of a grating dot and the gray value H
(
i
,
j
) of a corresponding image pixel in Figure 2 is
(19)
θ
(
i
,
j
)
=
H
(
i
,
j
)
-
128
1000
×
18
0
°
.Figure 3
Binary-data matrixT for Figure 1(a).Figure 4
Dot-matrix holographic imageH for hiding the binary-data matrixT for Figure 1(a).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 matrixT for Figure 3. Figure 5 shows some of the grating dots at the upper-right corner of the dot-matrix holographic image. The original covert imageC and the reconstructed covert image C
* derived from the holographic imageH are exactly the same.Figure 5
Some grating dots at the upper-right corner of the dot-matrix holographic imageH for Figure 1(a).The second experiment for encoding Figure1(b) is shown below. The first to 28th elements inR are also specified as the identification codes, and they are set as 1111001111001010110000110000. The 29th to 48th elements inR 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 forM are 0001111101 (i.e., 128
=
∑
i
=
1
10
M
i
·
2
i
-
1
+
3) and they are encoded at the 29th to 38th elements inR; the dimension codes forN are also 0001111101 and they are encoded at the 39th to 48th elements inR. The 49th to 54th elements inR are specified as the covert-image graylevel codes. Since the parameterg of the covert image used in this case is one (i.e., 2
=
2
1), the codes are 000000 (i.e., 1
=
∑
i
=
1
6
g
i
·
2
i
-
1
+
1). The 55th to 60th elements (the fourth range) inR are specified as the pre-RSA bit number codes. Because the selected pre-RSA bit numberb in this case is eight, the 55th to 60th elements inR are 000111 (i.e., 8
=
∑
i
=
1
6
b
i
·
2
i
-
1
+
1). The 61st to 130th elements inR are specified as the RSA key codes for the keysn andd. Because the keyn is set as 323, the 61st to 130th elements inR are 00000000000000000000000000011011111 (i.e., 323
=
∑
i
=
1
35
n
i
·
2
i
-
1
+
100). Because the keye is set as 23, the keyd must equal 263. Therefore, the 96th to 130th elements inR are 00000000000000000000000000100000101 (i.e., 263
=
∑
i
=
1
35
d
i
·
2
i
-
1
+
2). The 131st to 136th elements in the first row ofR are the post-RSA bit number codes. Because the selected post-RSA bit numbera used in this case is ten, the 131st to 136th elements in the first row ofR are 001000 (i.e., 10
=
∑
i
=
1
6
a
i
·
2
i
-
1
+
2). The 137th to 256th elements in the first row ofR are all set as 0.After that, create the 20480(
=
128
×
128
×
1
/
8
×
10
) binary-data stringG by encoding the 1×4096 RSA encryption data stringF. Then copy the binary-data elements ofG to form the 255×256 binary-data matrixS. Because the matrixS contains 65280
(
=
255
×
256
) elements and the binary-data stringG only contains 20480 elements, the values of the extra 44800 elements ofS are all set as 0. The 256
×
256 binary-data matrixT combined from the 1
×
256 binary-data stringR and the 255
×
256 binary-data matrixS is shown in Figure 6. The dot-matrix holographic imageH 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 imageH are shown in Figure 8. All the grating dots on the holographic image correctly hide the data in the binary-data matrixT for Figure 6. The original covert imageC and the reconstructed covert image C
* derived from the holographic imageH are exactly the same.Figure 6
Binary-data matrixT for Figure 1(b).Figure 7
Dot-matrix holographic imageH for hiding the binary-data matrixT for Figure 1(b).Figure 8
Some grating dots at the upper-left corner of the dot-matrix holographic imageH for Figure 1(b).The above-mentioned processes for encoding the covert imageC can be concluded as follows: (
1
) useC, n, and e to formG andR; (
2
) useG andR to formT; and (
3
) hideT to formH. On the other hand, the processes for reconstructingC* can be concluded as follows: (
1
) deriveT fromH; (
2
) useT to formG andR; and (
3
) usen,d,G, andR to formC*. Since the reconstruction possesses are the reversed version of the encoding processes, the former are not demonstrated here.


## 4. Discussions

The values ofM
0
,
N
0
,
g
0
,
n
0
,
d
0, and a
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 inR, changing the length of selected bit number codes, or changing the values of M
0
,
N
0
,
g
0
,
n
0
,
d
0, and a
0.The security of the proposed method depends on both the RSA encryption and the binary encoding method. For the RSA encryption, a very bign 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 fors
≡
t
d
mod
⁡
n is not accepted by a computer usually because the number t
d is too huge. Therefore, a calculation accepted by a computer is needed. A simple method is to multiply t
2 with t and do the modulus-after-division operation withn ford-1 times; that is,(20)
s
≡
(
(
(
(
t
2
mod
⁡
n
)
×
t
)
×
(
mod
⁡
n
)
×
t
(
(
t
2
mod
⁡
n
)
×
t
)
)
mod
⁡
n
,
…
,
(
(
(
(
t
2
mod
⁡
n
)
×
t
)
)
mod
⁡
n
.


## 5.  Conclusions

The proposed hiding method combines the RSA encryption method and the binary encoding method to encrypt a covert imageC into a dot-matrix holographic imageH. The RSA encryption method uses the covert imageC to form a RSA encryption data string. The binary encoding method encodes the RSA encryption data string into binary codes and encodes the binary codes into the dot-matrix holographic imageH. The reconstructed covert image C
* can be decoded directly from the dot-matrix holographic imageH. Furthermore, there is no distortion for the decoding work of the covert image.



---

*Source: 603659-2014-03-13.xml*