0% found this document useful (0 votes)
33 views65 pages

02 Hiding

Uploaded by

qusaidaqqa14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views65 pages

02 Hiding

Uploaded by

qusaidaqqa14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 65

Data Hiding: Watermarking &

Steganography(2)
ALGORITHMS
DR. KHALED W. MAHMOUD

1
1- Simple Visible Watermarking
 Letting fw denote the watermarked image, we can express it as a linear
combination of the unmarked image f and watermark w using
fw = (1 − ) f + w;  controls the relative visibility of the watermark and the image.
◦ If  is 1, the watermark is opaque and the underlying image is completely
hidden.
◦ As  approaches 0, more of the underlying image and less of the watermark is
seen.
◦ In general, 0 <  ≤ 1;
◦ The output is a set of floating point numbers.
Simpler form: fw = f + w
◦ The extraction formula is : fw- f

2
def embedding(c, w, alpha):
H1, W1 = w.shape visiblewmGray.py
wc = c.copy()
wc[0:H1, 0:W1] = np.round((1-alpha) * c[0:H1, 0:W1] + alpha * w)
# wc[0:H1, 0:W1] = np.round(c[0:H1, 0:W1] + alpha * w)
return wc

def extracting(wc, c, alpha):


w = wc-c
w = normalize(w)
return w.astype("uint8")

def normalize(m):
min1 = np.min(m)
max1 = np.max(m)
y = np.round((m-min1)/(max1-min1)*255)
return y

3
Alpha = 0.3
Try alpha = 0.01

To do Task: use the same


method to hide data into Blue
channel in RGB image

4
2- Simple Fragile Invisible Watermarking
 Because the least significant bits of an 8-bit image have virtually no effect on
our perception of the image, the watermark was inserted or “hidden” in its two
least significant bits.
(unsigned integer arithmetic )
◦ Dividing and multiplying by 4 sets the two least significant bits of f to 0,
◦ Dividing w by 64 shifts its two most significant bits into the two least significant bit positions,
◦ Adding the two results generates the LSB watermarked image.
 Extraction: By zeroing the most significant 6 bits of this image and scaling the
remaining values to the full intensity range, the watermark can be extracted.

5

EMBEDDING EXTRACTION
H1, W1 = a1.shape # a1 is the cover image image1 = Image.open(r'r.png')
H2, W2 = a2.shape # a2 is the watermark a5 = np.asarray(image1, dtype="uint8")
t = np.pad(a2, ((0, H1-H2), (0, W1-W2)), a5 = a5 & 3
constant_values=0) plt.imshow(a5, cmap="gray", vmin=0, vmax=3)
plt.axis('off')
a3 = ((a1 >> 2) << 2) | (t >> 6)
plt.show()
plt.imshow(a3, cmap="gray",vmin=0,vmax=255)
plt.axis('off'), plt.show()
a4 = Image.fromarray(a3)
a4.save("r.png")

6
+ = -

7

 Although lossy compression and decompression
preserved the important visual information in the
image, the fragile watermark was destroyed.
◦ If the image is compressed and decompressed using
lossy JPEG, the watermark is destroyed.
 Save the image as jpeg with quality factor = 50 and
rerun the code.

a4.save("r.jpg", quality=50, optimize=True)

8
DCT-based Invisible Robust Watermark
Watermarking in frequency domain

9

Where to embed the watermark signal?
 A watermark placed in the HF spectrum of an image can be easily eliminated with lossy
compression operation or any process that directly or indirectly performs low-pass
filtering.
◦ Watermarking in HF (perceptually insignificant regions of the image )  fragile watermark.
 A watermark placed in the LF spectrum of an image (perceptually significant regions of
the image ) will affect the perceptual fidelity
◦ The problem then becomes how to insert a watermark into the most perceptually significant
regions of the spectrum in a fidelity preserving fashion.
◦ Unintentional signal distortions due to compression or image manipulation, must leave the
perceptually significant spectral components intact, otherwise the resulting image will be
severely degraded.

10

Spread Spectrum Coding of a Watermark
 In spread spectrum communications:
◦ one transmits a narrowband signal over a much larger bandwidth such that the signal
energy present in any single frequency is undetectable.
 Similarly, in watermarking:
◦ The watermark is spread over very many frequency bins so that the energy in any
one bin is very small and certainly undetectable.
◦ A watermark that is well placed in the frequency domain of an image or a sound track
will be practically impossible to see or hear.
◦ The location of the watermark is not obvious robust against cropping

11
3- Cox Method
Embedding Algorithm
1. Compute the 2-D DCT of the image to be watermarked.
2. Locate its K largest coefficients, c1, c2 ,…, cK by magnitude.
3. Create a watermark by generating a K-element pseudo-random sequence of numbers, 1, 2 ,…,
K , taken from a Gaussian distribution with mean m=0 and variance σ2=1.
4. Embed the watermark from Step 3 into the K largest DCT coefficients from Step 2 using the
following equation: cwi = ci  (1+i) 1 ≤ i ≤ K for a specified constant  > 0 (that controls the
extent to which i alters ci )  exclude the DC.
5. Replace the original ci with the computed cwi.
6. Compute the inverse DCT of the result from Step 5.

12

 By employing watermarks made from pseudo-random numbers and spreading them
across an image’s perceptually significant frequency components,  can be made
small, reducing watermark visibility. At the same time, watermark security is kept high
because
1. The watermarks are composed of pseudorandom numbers with no obvious
structure,
2. The watermarks are embedded in multiple frequency components with spatial
impact over the entire 2-D image (so their location is not obvious)
3. Attacks against them tend to degrade the image as well (i.e., The image’s most
important frequency components must be altered to affect the watermarks).

13

To determine whether a particular image is a watermarked image
1. Compute the 2-D DCT of the image in question.
2. Extract the K DCT coefficients (in the positions corresponding to c1, c2,…, cK and
denote the coefficients as ĉ 1, ĉ 2,…, ĉ K
3. Compute watermark ̂1, ̂2 ,…, ̂K using
4. Measure the similarity of ̂1, ̂2 ,…, ̂K (from Step 3) and 1, 2 ,…, K using
correlation coefficient or Sim( , ) = ( .* ) / sqrt( .* ); where .* is the dot product
operator
5. Compare the measured similarity, to a predefined threshold, T, and make a binary
detection decision:

14
Remember
 Correlation Coefficient

15
Original
Original Received
Image
Image Image

DCT DCT

Determine Perceptually Significant


Regions
Watermark -
Original Extracted
Watermark Watermark

Inverse DCT

Similar
Watermarked
Image

16
… DCTCox.py
Embedding
def embedding(orgC, key):
orgwm = GaussianSeq(K, key)
H1, W1 = orgC.shape
dct_Org = dctn(orgC, norm="ortho").flatten()
index = np.argsort(-1*dct_Org) # -1 in order to sort Asecnding
dct_Org[index[1:K+1]] *= (1 + alpha * orgwm[0:K])
cw = idctn(dct_Org.reshape(H1, W1), norm="ortho").astype(np.uint8)
return cw

17

Extraction
def extraction(cw1, orgC):
dctOrg = dctn(orgC, norm="ortho").flatten()
indexOrg = np.argsort(-1*dctOrg)
dctw = dctn(cw1, norm="ortho").flatten()
extwm = np.zeros(K)
A = dctw[indexOrg[1:K+1]] - dctOrg[indexOrg[1:K+1]]
B = alpha * dctOrg[indexOrg[1:K+1]]
extwm[0:K] = A/B
return extwm

18

def similarity(extwm, key):
orgwm = GenGaussianSeq(K, key)
return dotProduct(orgwm, extwm)

def dotProduct(orgwm, extwm):


A = orgwm @ extwm
B = math.sqrt(extwm @ extwm)
return A/B
def GaussianSeq(K, key):
rng = np.random.default_rng (seed=key)
orgwm = rng.standard_normal(K)
return orgwm

19

 In order to check the similarities between def plotStat(key, extwm):
the extracted watermark and a list of stat = np.zeros(1000)
original watermarks, we generate 1000 for i in range(1000):
original random signals and compute the
test = GenGaussianSeq(K, i)
similarities between these signals and the
extracted watermark. stat[i] =
dotProduct(test,extwm)
 The threshold can be detected from the plt.plot(stat)
graph
plt.title(f"key={key}")
 The positive response due to the correct plt.show()
watermark is very much stronger than the return stat
response to incorrect watermarks,
suggesting that the algorithm has very low
false positive response rates.

20

Parameters:
 Alpha
◦ We can view  as a relative measure of how much one must alter the frequency
component to alter the perceptual quality of the work.
 Length of the Watermark
◦ In general, as the number of altered components are increased the extent to
which they must be altered decreases.
 Setting the detection threshold
◦ we wish to minimize both the rate of false negatives (missed detections) and false
positives (false alarms).

21
Cox’s Method: Experimental Results
 Exp1: Normal Run
◦ A watermark length of 1000 was used.
◦ We added the watermark to the image
by modifying 1000 of the more
perceptually significant components of
the image spectrum.
◦ More specifically, the 1000 largest
coefficients of the DCT (excluding the
DC term) were used.
◦ A scale factor of 0.1 was used.
◦ Key = 900
◦ Sim = 32.3
The DCT-based watermarking approach of the previous example is fairly resistant to watermark attacks

22

 Exp2: Image Scaling:
◦ We scaled the watermarked image to half of its original
size. In order to recover the watermark, the half-size
image was rescaled to its original dimensions
◦ fine detail has been lost in the scaling process.
◦ The response of the watermark detector to the original
watermarked image was 32.3, which compares to a
response of 13.7 for the rescaled version.
◦ While the detector response is down by over 50%, the
response is still well above random chance levels
suggesting that the watermark is robust to geometric
distortions.

23

 Exp3: Cropping
◦ only the central 50x50 of the image
remains.
◦ In order to extract the watermark from this
image, the missing portions of the image
were replaced with portions from the
original unwatermarked image.
◦ In this case, the response of the watermark
is 8.9. Once again, this is well above
random even though 75% of the data has
been removed.

24

 Attack by Watermarking Watermarked Images : i.e.,
the original image is watermarked, the watermarked image
is watermarked, etc.
◦ This attack is equivalent to adding noise to the frequency
bins containing the watermark.
◦ The figure, shows the response of the detector to 1000
randomly generated watermarks, which include the five
watermarks present in the image.
◦ Five spikes clearly indicate the presence of the five
watermarks and demonstrate that successive
watermarking does not unduly interfere with the process

25

 Attack by Collusion
◦ In a similar experiment, we took five separately watermarked images and averaged
them in order to simulate a simple collusion attack.
◦ the response of the detector to 1000 randomly generated watermarks, which include the
five watermarks present in the image is computed.
◦ Once again, five spikes clearly indicate the presence of the five watermarks and
demonstrate that simple collusion based on averaging a few images is an ineffective
attack.

26

 Try:
1. JPEG Coding Distortion with different quality
2. Gaussian filter with different size
3. Adding Noise

27
4- Modulating The Relative Size of Two
(or More) DCT Coefficients
 One popular method of encoding secret information in the frequency domain is
modulating the relative size of two (or more) DCT coefficients within one image block.
 During the encoding process, the sender splits the cover-image in 8×8 pixel blocks;
each block encodes exactly one secret message bit.
 Before the communication starts, both sender and receiver have to agree on the
location of 2 DCT coefficients, which will be used in the embedding process; (u1, v1)
and (u2, v2).
 The embedding process starts with selecting (maybe randomly) block bi which will be
used to code the ith message bit.
The purpose of randomly selected block is to prevent or discourage attackers from detecting
embedding locations by comparing different labeled images.

28
Which coefficients to be selected?
 The 2 coefficients should correspond to middle frequencies;
◦ this ensures that the information is stored in significant parts of the signal.
 Choose the DCT coefficients in such a way that the quantization values associated with
them in the JPEG compression algorithm are equal.
◦ in the quantization process both coefficients are divided by the same quantization
values. Their relative size will therefore only be affected in the rounding step.
◦ According to quantization table the coefficients (4,1) and (3,2) or (1,2) and (3,0) are
good candidates

 We can expect this method to be robust against JPEG compression.

29
… Absolute difference : |b(u1, v1)| - |b(u2, v2)|
 For each message bit i do the following:
◦ Specify the block b that will be used to embed bit i
◦ If i = 0 and the absolute difference between the two selected DCT coefficients > threshold,
then this block can be used to represent the 0 bit, otherwise modify the 2 coefficients until
the above condition is satisfied.
◦ If i = 1 and the absolute difference between the two selected DCT coefficients < -threshold,
then this block can be used to represent the 1 bit, otherwise modify the 2 coefficients until
the above condition is satisfied.
 The sender then performs an inverse DCT to map the coefficients back into the space
domain.

30
Notes
The higher threshold is, the more robust the algorithm will be against JPEG
compression, however, at the expense of image quality.

If the threshold and the location of the used DCT coefficients are chosen
properly, the embedding process will not degenerate the cover visibly.

We will use blue channel to embed secret message, Why?

31
How to Modify the DCT Coefficients?
 if i = 0: def increment_abs(x):
◦ |b(u1, v1)| - |b(u2, v2)| > thr return x + 1 if x >= 0 else x - 1
◦ |b(u1, v1)| = |b(u2, v2)| + thr def decrement_abs(x):
◦ If the above condition is not satisfied then if np.abs(x) <= 1:
modify the coefficients : return 0
else:
◦ coefs[u1, v1] = increment_abs(coefs[u1, v1])
return x - 1 if x >= 0 else x + 1
◦ coefs[u2, v2] = decrement_abs(coefs[u2, v2])
 if i =1:
◦ |b(u1, v1)| - |b(u2, v2)| > -thr
◦ |b(u1, v1)| = |b(u2, v2)| - thr
◦ If the above condition is not satisfied then modify the This
coefficients
process: should be repeated until the
◦ coefs[u1, v1] = decrement_abs(coefs[u1, v1]) condition is satisfied
◦ coefs[u2, v2] = increment_abs(coefs[u2, v2])

32

 To extract the hidden message
◦ All available blocks are DCT-transformed.
◦ By comparing the two coefficients of every block, the information can be restored.
◦ Return 0 if the absolute difference > 0 else return 1

33
Python Code Hints python -m pip install scikit-image

How to divide the cover image into blocks of 8x8?


from skimage.util import view_as_blocks
blocks = view_as_blocks(blue, block_shape=(n, n))
print(blocks.shape)  (#of blocks in the height
dimension, #of blocks in the width dimension, n, n)

How to select the block according to its index? 0 1 2 3


i = index // w 0 b0 b1 b2 b3
j = index % w 1 b4 b5 b6 b7
block = blocks[i, j]
2 b8 b9 b10 b11
image[i*n: (i+1)*n, j*n: (j+1)*n] = embed_bit(block, bit)

34

How to convert text to bin and vise versa?
def text_to_bin(text):
b = ''.join(np.binary_repr(ord(ch), width=8) for ch in text)
return np.array([int(i) for i in b])

def bin_to_text(res):
b = np.packbits(res)
return "".join(chr(i) for i in b)

How to convert double value to byte?


def double_to_byte(arr):
return np.round(np.clip(arr, 0, 255)).astype("uint8")

35

How to convert image to bin and vise versa?
def img_to_bin(im):
im = im.flatten()
b = ''.join(np.binary_repr(p, width=8) for p in im)
return np.array([int(i) for i in b])

def bin_to_img(res, H, W):


t = np.packbits(res)
return t.reshape(H, W)

Very important: go back to ZhaoSimpleText.py for complete detail

36
… ZhaoSimpleText.py

Original cover Stego cover


Hidden text : Khaled Walid Mahmoud

37
… ZhaoSimpleImage.py

+ =

Extracted Logo

38

 Perhaps the most important drawback of the system presented above is the fact that
embedding algorithm does not discard image blocks where the desired relation of the
DCT coefficients cannot be enforced without severely damaging the image data
contained in this specific block.
 Suggested Modification : mark a block as invalid for code embedding if too big
modifications to the block data are needed in order to embed a bit into this block.
 Zhao and Koch proposed a similar system which does not suffer from this drawback.
 They operate on quantized DCT coefficients and use the relations of 3 coefficients in a
block to store the information.
For more detail:
Zhao, J., and E. Koch, "Embedding Robust Labels into Images for Copyright Protection," in Proceedings of
the International Conference on Intellectual Property Rights for Information, Knowledge and New
Techniques, München, Wien: Oldenbourg Verlag, 1995, pp. 242–251.

39
5 – Jsteg, F3, F4 and F5 Algorithms
f5—a steganographic algorithm, high capacity despite better steganalysis by
andreas westfeld

40
The coefficient’s frequency of occurrence
decreases with increasing absolute value.

The difference between two bars of the


histogram in the middle is larger than on
the margin

The histogram of JPEG files contains more


odd than even coefficients (excluding 0).

41
Jsteg
 Jsteg embeds the message sequentially in the DCT coefficients of a given image.
 After quantization, Jsteg replaces the least significant bits (LSB) of the frequency
coefficients by the secret message.
 The embedding mechanism skips all coefficients with the values 0 or 1.

while data left to embed do


get next DCT coefficient from the cover image
if DCT != 0 and DCT != 1
get next LSB from message
replace DCT LSB with message LSB
end if
insert DCT into stego image
end while

42
Jsteg
Ci Binary Rep Two’s complement
-4 1111 1100
-3 1111 1101
 Encoding: replace LSB
-2 1111 1110 0000 0010 1111 1101 + 1
◦ Let Ci = -3,
-1 1111 1111
◦ Bi = 0  Ci = -4
0 0000 0000
◦ Bi = 1  Ci = -3
1 0000 0001
◦ Let Ci = 2,
2 0000 0010
◦ Bi = 0  Ci = 2
3 0000 0011
◦ Bi = 1  Ci = 3
4 0000 0100
 Extracting: get the LSB bit only

43
def increment_abs(x):
return x + 1 if x >= 0 else x - 1

def decrement_abs(x):

Jsteg Example
if np.abs(x) <= 1:
return 0
else:
return x - 1 if x >= 0 else x + 1

C -4 -3 -2 -1 0 1 2 3
B 1 0 1 0 0 1
C’ -3 -4 -1 -2 0 1 2 3
B’ 1 0 1 0 0 1

44
because Jsteg replaces bits and, thus, it
introduces a dependency between the value’s
frequency of occurrence, that only differ in
this bit position (here: LSB) such as -1 and -2
or 2 and 3

45
Jsteg
 The JSteg algorithm poses two significant limitations.
◦ First, the JSteg algorithm skips the coefficients with value 0 and 1. As a result, the
hiding capacity of the algorithm decreases significantly.
◦ Second, the JSteg algorithm can not preserve the shape of JPEG coefficients
histogram. Therefore, it can be detected by the first order statistics and chi2 test.

Jsteg algorithm is vulnerable to statistical attacks because it influences the DCT histogram of an image
perceptibly since it equalizes the number of pairs of coefficients.

46
First Order Statistic
 The first order statistic is the smallest sample value (i.e. the minimum), once the
values have been placed in order. For example, in the sample 9, 2, 11, 5, 7, 4 the first
order statistic is 2. In notation, that’s x(1) = 2.

Remember: The coefficient’s frequency of occurrence decreases with increasing absolute value.

47
Chi-square Test for JSteg
 Let ci be the histogram of JPEG coefficients.
 The assumption for a modified image after Jsteg is that adjacent frequencies c2i and c2i+1
are similar.
 We take the arithmetic mean:  expected distribution
 Let  observed distribution
 The difference between the distributions ni and ni∗ is given as
where:
◦ k is the number of different categories in the histogram minus one
◦ is chi-square
◦ ni is observed distribution
◦ ni∗ is expected distribution
If the assumption was correct then chi square will drop to 0.0

48
F3
 The algorithm F3 serves as a tutorial example. It differs in many respects from Jsteg:
1. Instead of overwriting bits, it decrements the coefficient’s absolute values in case
their LSB does not match —except coefficients with the value zero, where we can
not decrement the absolute value. Hence, we do not use zero coefficients
steganographically.
◦ The LSB of nonzero coefficients match the secret message after embedding.
2. F3 uses coefficients with the value 1.
3. F3 skips coefficients with value 0.

49
F3
3. Some embedded bits fall victim to shrinkage. Shrinkage accrues every time F3
decrements the absolute value of 1 and −1 producing a 0. The receiver cannot
distinguish a zero coefficient, that is steganographically unused, from a 0 produced
by shrinkage. It skips all zero coefficients. Therefore, the sender repeatedly embeds
the affected bit since he notices when he produces a zero.
◦ During the shrinkage process, F3 does not hide any message bits.
◦ This results an increase in number of 0’s during encoding and waste of capacity.

Shrinkage means to change without to embed sometimes

50
F3
Ci Binary Rep Two’s complement
-4 1111 1100
-3 1111 1101
 Encoding: |Ci|-1* sign(Ci)  if bi != LSB(Ci)
-2 1111 1110 0000 0010 1111 1101 + 1
◦ Let Ci = -3,
-1 1111 1111
◦ Bi = 0  Ci = -2  change
0 0000 0000
◦ Bi = 1  Ci = -3  No change
1 0000 0001
◦ Let Ci = 2,
2 0000 0010
◦ Bi = 0  Ci = 2  no Change
3 0000 0011
◦ Bi = 1  Ci = 1  change
4 0000 0100
 Extracting: get the LSB bit only

51
F3 Example
C -3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3 2 -2
B 1 0 1 1 0 1 0 1 0 - - - 0 1 0
C’ -3 -2 -1 0 1 2 3 -2 -1 0 0 0 2 2 1 -2
B’ 1 0 1 1 0 1 0 1 0 0 1 0

52
F3
 Like the JSteg algorithm, the F3 algorithm can not preserve the shape of JPEG coefficients
histogram. It can be easily detected by the first order statistics and chi2 test.

53
F3
 The histogram shows a relative surplus of even coefficients. This phenomenon results
from the repeated embedding after shrinkage.
 Shrinkage occurs only if we embed a zero bit. The repetition of these zero bits shifts
the (originally equalized) ratio of steganographic values in favor of the steganographic
zeroes. Hence, the F3 embedding process produces more even coefficients than odd.
 If we simply ignore the shrinkage, the superior number of even coefficients disappears.
Unfortunately the receiver gets only fragments of the message in this case.
 Therefore, if we embed more ones than zeroes (in a suitable ratio), the superior
number in the histogram disappears as well.  F4

Note: Embedding zeros will results in even number

54
F4
 The algorithm F4 eliminates weaknesses in one stroke by mapping negative
coefficients to the inverted steganographic value:
◦ even negative represent a steganographic one,
◦ odd negative represent zero;
◦ even positive represent a zero (as before with Jsteg and F3),
◦ odd positive represent one.

55
F4
 As in F3 algorithm, F4 skips the coefficient with value 0. However, F4 algorithm
◦ alters +1 to 0, while the hidden message bit is 0, and
◦ alters -1 to 0, while the message bit is 1.
 Like F3, during the shrinkage process, F4 does not hide any message bits.

56
F4
Ci Binary Rep Two’s complement
-4 1111 1100
-3 1111 1101
 Encoding:
-2 1111 1110 0000 0010 1111 1101 + 1
◦ If Ci < 0, |Ci|-1* sign(Ci)  if bi = LSB(Ci)
-1 1111 1111
◦ Let Ci = -3
◦ Bi = 1  Ci = -2  Change 0 0000 0000
◦ Bi = 0  Ci = -3  No change 1 0000 0001
◦ if Ci > 0, |Ci|-1* sign(Ci)  if bi != LSB(Ci) 2 0000 0010
◦ Let Ci = 2, 3 0000 0011
◦ Bi = 0  Ci = 2  No Change 4 0000 0100
◦ Bi = 1  Ci = 1  Change

Extracting:
• For positive numbers ==LSB.
• For negative numbers: flip(LSB)

57
F4 Example
C -3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3 -2
B 0 1 0 1 0 1 1 0 1 0 1 0
C’ -3 -2 -1 0 1 2 3 -2 -1 0 0 1 2 3 -1
B’ 0 1 0 1 0 1 1 0 1 0 1 0

58
F5
 In Jsteg, F3 and F4, changes resides at the start of the file
 In many cases, an embedded message does not require the full capacity (if it fits).
Therefore, a part of the file remains unused.
 To prevent attacks, the embedding function should use the carrier medium as regular
as possible. The embedding density should be the same everywhere.

59
F5
Permutative Straddling:
 Straddling is easy, if the capacity of the carrier medium is known exactly. However, we
can not predict the shrinkage for F4, because it depends on which bit is embedded in
which position. We merely can estimate the expected capacity.
 The straddling mechanism used with F5 shuffles all coefficients using a permutation
first. Then, F5 embeds into the permuted sequence.
 The permutation depends on a key derived from a password.
 F5 delivers the steganographically changed coefficients in its original sequence to the
Huffman coder.
 With the correct key, the receiver is able to repeat the permutation.
 The permutation has linear time complexity O(n).

60
F5

61
F5
 Matrix Encoding: F5 introduced matrix encoding as a new technique to improve the
embedding efficiency(1).
 For example, if we embed a very short message comprising only 217 bytes (1736 bits),
F4 changes 1157 places in the Expo image (because of shrinkage). F5 embeds the same
message using matrix encoding with only 459 changes, i. e. with an embedding
efficiency of 3.8 bits per change.

62
F5
 F5 steganography hides p number of bits by modifying one coefficient out of  = 2p - 1
coefficients of a JPEG image.
 F5 divides the set of coefficients C = [C1,C2, … Cn] into  subsets S = [S1,S2,…S ] each
Si have number of  coefficients 
 Example: if p = 4, then  = 15 and  = n/15

63

 The following example shows what
happened in detail. We want to embed
two bits x1, x2 in three modifiable bit
places a1, a2, a3 changing one place at
most. We may encounter these four
cases:
 In all four cases we do not change more
than one bit.
In this example, we would like to embed message of 2
bits in a block of 3 bits (exactly: 101)

For more detail about the algorithm refer to the reference: F(1) 5—a steganographic algorithm, high
capacity despite better steganalysis by andreas westfeld

64
65

You might also like