- Else if ðd ¼ 2
n
Þ; P
s
1
¼ P
1
þ 1; P
s
n
¼ P
n
þ 1; P
s
i
¼ P
i
; i ¼ 2; 3; ...;
n 1.
- Else if ð0 < d < 2
n
Þ, transform d to binary ðb
n
b
n1
...b
0
Þ
2
.
For ði ¼ n; i P 1; i Þ
{ifðb
i
¼¼ 0 and b
i1
¼¼ 1) P
s
i
¼ P
i
þ 1;
else if ðb
i
¼¼ 1 and b
i1
¼¼ 0Þ P
s
i
¼ P
i
1;
else P
s
i
¼ P
i
}
- Else d
0
¼ 2
nþ1
d, transform d
0
to binary ðb
n
b
n1
...b
0
Þ
2
Forði ¼ n; i P 1; i Þ
{if(b
i
¼¼ 0 and b
i1
¼¼ 1) P
s
i
¼ P
i
1;
else if ðb
i
¼¼ 1 and b
i1
¼¼ 0Þ P
s
i
¼ P
i
þ 1;
else P
s
i
¼ P
i
}
(4) Outputs n stego-pixels: P
s
1
; P
s
2
; ...; P
s
n
.
Extracting phase: Input n stego-pixels P
s
1
; P
s
2
; ...; P
s
n
; Output:
the n þ 1 bits secret s.
(1) The decimal secret s
ð10Þ
can be extracted by:
s
ð10Þ
¼ f
s
GEMD
¼½
P
n
i¼1
P
s
i
ð2
i
1Þðmod2
nþ1
Þ.
(2) Transform s
ð10Þ
into n þ 1 bits secret s.
Scheme 1 (GEMD) embeds a secret of n þ 1 bits into n stego-
pixels. It has higher embedding capacity than EMD. The following
Scheme 2 (RGEMD) is extended from GEMD that embed a 2n bits
secret into n stego-pixels.
Scheme 2: RGEMD
Embedding phase: Input: n cover-pixels P
1
; P
2
; ...; P
n
, a secret s
of 2n bits; Output: n stego-pixels P
s
1
; P
s
2
; ...; P
s
n
.
(1) Divide s into first n þ 1 bits secret s
ðnþ1Þ
and last n 1 bits
secret s
ðn1Þ
.
(2) Embedding s
ðnþ1Þ
into n cover-pixels using Scheme 1 , and
generates n stego-pixels P
s
1
; P
s
2
; ...; P
s
n
.
(3) s
ðn1Þ
¼ðb
n2
b
n3
...b
0
Þ
2
for(i ¼ n 2; i P 1; i )
{if(P
s
iþ2
P P
iþ2
and P
s
iþ1
6 P
iþ1
)
P
s
iþ2
¼ P
s
iþ2
1; P
s
iþ1
¼ P
s
iþ1
þ 2; P
s
1
¼ P
s
1
þ 1;
else
P
s
iþ2
¼ P
s
iþ2
þ 1; P
s
iþ1
¼ P
s
iþ1
2; P
s
1
¼ P
s
1
1;}
(4) Outputs n stego-pixels: P
s
1
; P
s
2
; ...; P
s
n
.
Extracting phase: Input n stego-pixels P
s
1
; P
s
2
; ...; P
s
n
; Output:
the 2n bits secret s.
(1) The decimal secret s
ðnþ1Þ
ð10Þ
of the first n þ 1 bits of s can be
extracted by s
ðnþ1Þ
ð10Þ
¼ f
s
GEMD
¼½
P
n
i¼1
P
s
i
ð2
i
1Þmod2
nþ1
.
Transform s
ðnþ1Þ
ð10Þ
into n þ 1 bits binary secret s
ðnþ1Þ
.
(2) The last n 1 bits secret s
ðn1Þ
¼ðb
n2
b
n3
...b
0
Þ of s can be
extracted from the LSBs of P
s
i
; i ¼ n; n 1; ...; 2.
For (i ¼ n; i P 2; i )
b
i2
¼ LSBðP
s
i
Þ
(3) The 2n bits secret s ¼ s
ðnþ1Þ
ks
ðn1Þ
.
Notice that Scheme 1 (GEMD) can embed n þ 1 bits secret into
n stego-pixels, Scheme 2 (RGEMD) can embed 2n bits secret into n
stego-pixels. Here we extend Scheme 2 to a Partial RGEMD
Scheme (Scheme 3) which embeds any tðn þ 1 < t < 2nÞ bits
secret into n stego-pixels. The Partial RGEMD can make a trade
of the number of embedded secret bits for the visual quality of
stego-image.
Scheme 3: Partial RGEMD
Embedding phase: Input: n cover-pixels P
1
; P
2
; ...; P
n
, a secret s
of t; ðn þ 1 < t < 2nÞ bits; Output: n stego-pixels P
s
1
; P
s
2
; ...; P
s
n
.
(1) Divide s into first n þ 1 bits secret s
ðnþ1Þ
and last t n 1
bits secret s
ðtn1Þ
.
(2) Embedding s
ðnþ1Þ
into n cover-pixels using Scheme 1, and
outputs n stego-pixels P
s
1
; P
s
2
; ...; P
s
n
.
(3) s
ðtn1Þ
¼ðb
tn2
b
tn3
...b
0
Þ
2
for(i ¼ t n 2; i P 1; i )
{if (P
s
iþ2
P P
iþ2
and P
s
iþ1
6 P
iþ1
)
P
s
iþ2
¼ P
s
iþ2
1; P
s
iþ1
¼ P
s
iþ1
þ 2; P
s
1
¼ P
s
1
þ 1;
else
P
s
iþ2
¼ P
s
iþ2
þ 1; P
s
iþ1
¼ P
s
iþ1
2; P
s
1
¼ P
s
1
1;}
(4) Outputs n stego-pixels: P
s
1
; P
s
2
; ...; P
s
n
.
Extracting phase: Input n stego-pixels P
s
1
; P
s
2
; ...; P
s
n
; Output:
the t bits secret s .
(1) The decimal secret s
ðnþ1Þ
ð10Þ
of the first n þ 1 bits in s can be
extracted by s
ðnþ1Þ
ð10Þ
¼ f
s
GEMD
¼½
P
n
i¼1
P
s
i
ð2
i
1Þmod2
nþ1
.
Transform s
ðnþ1Þ
ð10Þ
into n þ 1 bits binary secret s
ðnþ1Þ
.
(2) The last t n 1 bits secret s
ðtn1Þ
¼ðb
tn2
b
tn3
...b
0
Þ
2
can be extracted from the LSBs of
P
s
i
; i ¼ t n; t n 1; ...; 2.
For (i ¼ t n; i P 2; i )
b
i2
¼ LSBðP
s
i
Þ
(3) The t bits secret s ¼ s
ðnþ1Þ
ks
ðtn1Þ
.
3. Proposed scheme
In most PSIS schemes, the shadows are noise-like images
which would cause suspicious of attackers during transmission.
This problem can be solved by combining PSIS and steganography
together which embed a secret image into meaningful image
shadows. In this part, we adopt the approaches of GEMD and
RGEMD to embed secret image in PSIS scheme, and propose a
new ðk; nÞ PSIS Scheme with meaningful shadow images. The
approaches of GEMD and RGEMD can resist RS detection and
have higher embedding capacity than EMD. This part is divided
into two subsections. In first subsection we construct the scheme;
the properties of proposed Scheme is analyzed in second
subsection.
3.1. ðk; nÞ PSIS with meaningful shadows
In order to describe our Scheme clearly, we first introduce two
auxiliary algorithms. Let s be a secret and
Q
i
¼ðP
i
; P
i
Þ; i ¼ 1; 2; ...; n be n cover-shadows where each cover-
shadow Q
i
consists of two pixels P
i
and P
i
. We propose Algorithm
1 to embed the secret s into this n cover-shadows. The following
Algorithm 1 takes s and Q
i
; i ¼ 1; 2; ...; n as input, and outputs n
stego-shadows Q
s
i
; i ¼ 1; 2; ...; n, each stego-shadow also consists
of two pixels.
768 Y.-X. Liu et al. / J. Vis. Commun. Image R. 55 (2018) 766–777