by: Thenaa Ali Kadhum 1

Using
Fractals in
Information Hiding
by
Thenaa Ali Kadhum
supervised by
Dr. Nadia M. G.
by: Thenaa Ali Kadhum 2
??What is a fractal

high visual complexity,
while having very low
information contents.

Fractal geometry seems to
better describe Nature than
the traditional one.

generated by transformed
copies of parts of
themselves .

Self-similar on all resolution
levels Can be described
using the formalism of the
iterated function systems
theory ..
by: Thenaa Ali Kadhum 3
Fractals in nature
Fractals are useful for representing natural shapes such as
.trees, coastlines, mountains, terrain and clouds
Magnification of these things reviews smaller self-similar
.copies of the entire image
by: Thenaa Ali Kadhum 4
Definitions

metric space

Cauchy sequence

complete metric spaces

Compact sets

bounded sets

є − ball

Hausdorff metric

Hausdorff distance

transformation on the space X

Affine transformation

fixed point

Contraction Mappings

Iterated Function Systems

the attractor

condensation transformation

The collage theorem
by: Thenaa Ali Kadhum 5
:Examples
Koch Curve: subdivide each segment of K
n

into three equal parts, and replace the
middle part with a bump in the shape of an
.equilateral triangle
by: Thenaa Ali Kadhum 6
by: Thenaa Ali Kadhum 7
:Generating the fractals
The Deterministic Algorithm

The Random Iteration Algorithm
by: Thenaa Ali Kadhum 8
The Deterministic Algorithm
Let {X; w
1
, w
2
...w
n
) be an IFS. Choose any compact
set B
o
⊂ R
2
. Then compute successively
B
n+1
= union (w
i
(B
n
)) for i = 1... , n
This sequence {B
n
} will converge to the attractor of
.the IFS
by: Thenaa Ali Kadhum 9
The Random Iteration Algorithm
.i) Initialize: x=0, y=0)
. (ii) For n=1 to 2500, do steps (iii)-(vii)
iii) Choose k to be one of the numbers 1, 2 , . . .,)
,m, with probability P
iv) Apply the transformation W, to the point (x,y) to)
obtain
.v) Set (x,y) equal to the new point: x=z, z=y)
.(vi) If n > 10, plot (x,y)
.vii) Loop)
by: Thenaa Ali Kadhum 10
Chapter two
:Cryptography and hiding information
Information hiding represents a class of processes
used to embed data into various forms of media
such as image, audio, or text. The embedded
data should be invisible to human observer.
Steganography and digital watermarking are two
. "areas referred to as "information hiding
by: Thenaa Ali Kadhum 11
:Cryptography
Cryptography is the study of methods of
sending information in disguised form so
that only the intended recipients can
remove the disguise and read the
.message
The message that to be send is called
plaintext and the disguised message is
.called the cipher text
by: Thenaa Ali Kadhum 12
:Steganography
The word steganography comes from the Greek word
"stegein", "grajein" which literally means "covered writing
."
It conceals a message where that is the object of the
communication. For example, sending an image hidden
.in other image
Information hiding represents a class of processes used to
embed data into various forms of media such as image,
.audio, or text
.The embedded data should be invisible to human observer
by: Thenaa Ali Kadhum 13
The end result in steganography
isa stego image
The end result in cryptography is
the cipher text
In steganography the enemy is
not allowed to even detect that
there is a second secret message
.present
In cryptography the enemy is
allowed to detect, intercept and
modify messages without being
able to violate certain security
premises guaranteed by a
.cryptosystem
seeks to make the very presence
of the message undetectable and
is usually used in conjunction
with cryptography by hiding a
previously encrypted message. In
other words it is about
concealing the message very
.existence
is concerned with disguising the
content of a message, the plain
text, but makes no effort at
concealing the resulting cipher
text. In other words it is about
protecting the content of a
.message
Steganography Cryptography
by: Thenaa Ali Kadhum 14
:Some types of steganography
:Technical steganography )1
This type uses scientific methods, to hide a message such as, the
.use of invisible ink, or microdots, and other size- reduction methods

:Linguistic steganography )2
this type hides the message in the carrier in some non_obvious ways
.and is further categorized as Semagrams or open codes

:Semagrams )3
Semagrams hide information by the use of symbols or signs. A text
Semagrams hides a message by modifying the appearance of the
carrier text, such as subtle changes in font size or type, adding extra
.spaces, or different flourishes in letters or handwritten text

Covered or concealment )4 :
Ciphers hide a message openly in the carrier medium so that it can be
recovered by anyone who knows the secret for how it was
.concealed
by: Thenaa Ali Kadhum 15
PRESIDENT'S EMBARGO RULING SHOULD"
HAVE IMMEDIATE NOTICE. GRAVE
SITUATION AFFECTING INTERNATIONAL
LAW. STATEMENT FORESHADOWS RUIN OF
MANY NEUTRALS. YELLOW JOURNALS
UNIFYING NATIONAL EXCITEMENT
".IMMENSELY
The German Embassy in Washington, DC, sent
these messages in telegrams to their
. headquarters in Berlin during World War I
By reading the first character of every word in
the first message will yield the following hidden
:text
."PERSHING SAILS FROM N.Y. JUNE 1"
Example for null ciphers
by: Thenaa Ali Kadhum 16

This cube is a common mean of
RGB. It's to represent a given
color by the relative intensity of
its three components colors-red,
green, and blue-each with their
own axis.

The absence of all colors yields
black, the intersection of the zero
point at the three-color axes.

red +blue +no green= magenta.

Cyan = green + blue no red.

green + red + no blue = yellow.

White is the presence of all three
colors.
Steganography's common Carriers:
by: Thenaa Ali Kadhum 17
:The least significant bit
The least significant bit term comes from the
numeric significance of the bits in a byte.
The high-order or most significant bit is the
one with the highest arithmetic value (i.e.,
2
7
=128), whereas the low-order or least
significant bit is the one with the
lowest arithmetic value (i.e., 2
0
=1).
Embedding the data:
requires two files:
The first : the cover image, the innocent-looking image, holds the hidden
information.
The second : message or the information to be hidden.
by: Thenaa Ali Kadhum 18
Algorithms
: Embedding algorithm
Embedding process: least
significant bit
substitution
for i= 1, …l(c ) do
s
i
←c
i
end for
for i= 1, …l( c ) do
compute index j
i
, where to
store i th message bit
s
i
←c
i
↔m
i
end for
:Extraction algorithm
Extracting process: least
significant bit substitution
for i= 1, …l(m) do
compute index j
i
, where to
store ith message bit
mi ←LSB(c
ji
(
end for
by: Thenaa Ali Kadhum 19
:Example2
Consider a palette with
four colors: white, red,
blue, and green which
have the palette
:position entries of
and (10)2 ,(01)1 ,(00)0
. 3(11) respectively
The values, of four
adjacent pixels, with
colored white, white,
blue, and blue
.(10 10 00 00)
We will try and hide the
decimal number 10
represented in binary
.as 1010
by: Thenaa Ali Kadhum 20
The resulting raster is: 01 00 11 10, which corresponds to red, white,
.green, and blue
Figure 2.5 red, white, green, and blue blocks of colors
These large changes between the figures "2.3" and "2.5" to the image
are very noticeable in a color image although an 8 bit grayscale
.image will produce relatively good results
by: Thenaa Ali Kadhum 21
:Applying steganography
 The carrier of the stego information is a jpg format
 picture for " Kadhum Al­Saher" and   a message of
four words" hi how are u".   Using the
  program "main" of appendix C to embed the message
 and view the comparison between before and after
.the embedment in the same image
by: Thenaa Ali Kadhum 22
by: Thenaa Ali Kadhum 23
We introduced some suggestions to control our inputs to get
:the attractor of the messages by choosing
1)the number of characters in each block of the
message ‘k’.
2)The prime number of their alphabet used to
encipher the message ‘p’.
3)The equation they will be using to input the
calculations of the values of the message
characters ‘a
ij
’.
4) The input of the calculations in the affine
transformations ‘Ax+b’.
by: Thenaa Ali Kadhum 24
Constructing the IFS from the message:
Let the contractive affine transformations {W
i
; i=1,…,n} in R
2
, be of the
:form
Could be used as a secret key to encipher words of length K at a time in an N-
,letters alphabet if and only if
GCD (D, P
K
) =1, as D the value of the joint characters in the key agreement
.between the sender and the recipient
. b AX
f
e
a a
a a
22 21
12 11
+ ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
by: Thenaa Ali Kadhum 25
• thus to put a "1" in the place where there is a number and a "0"
where a zero is in the IFS, and a sequence if 0, 1, of eight digits
ignoring the last two digits to how the affine transformations are
organized, therefore, the orders of the formation of these maps are
as follows:
. A 10000000 AX
0
0
0 0
0 a
11
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. A 00100000 AX
0
0
0 a
0 0
21
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. A 01000000 AX
0
0
0 0
a 0
12
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. A 00110000 AX
0
0
a a
0 0
22 21
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. A 01100000 AX
0
0
a 0
0 0
22
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. A 11000000 AX
0
0
0 0
a a
12 11
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
by: Thenaa Ali Kadhum 26
Are all the possible inputs as a linear transformations, the first six orders are better to be ignored and
:the non- linear are

. ULA 11100000 AX
0
0
0 a
a a
21
12 11
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. LLA 10110000 AX
0
0
a a
0 a
22 21
11
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. DA 10010000 AX
0
0
a 0
0 a
22
11
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. ALLA 11110000 AX
0
0
a a
a a
22 21
12 11
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. SDA 01100000 AX
0
0
0 a
a 0
21
12
· → ·
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
W
. AX 11101000 b AX
0
e
· → + ·
]
]
]

+
]
]
]

·
]
]
]

y
x
A
y
x
W
. AY 11100100 b AX
f
0
· → + ·
]
]
]

+
]
]
]

·
]
]
]

y
x
A
y
x
W
by: Thenaa Ali Kadhum 27
Notice that the sender can form an IFS, however the above order
.must be agreed upon between sender and receiver
:example
if the sender wants to use a diagonal linear (10010000) in the IFS,
:the sender uses
a
ij
= any equation they agree on as a key

to their communication
Here a
11
, and a
22
are the numerical values of the first two unit
messages in a ring of integers modulo N
k
, i.e. the numerical value
of a number of k
th
-digit in a numeric system with N-digits. The
.sender can select the next member of the IFS
.
N
a
and ,
N
a
K
22
K
11
by: Thenaa Ali Kadhum 28
:Example1
to hide the message “Send me some money .”, and p=29 andk=2
Here A-Z takes the numerical values 0-25, '.', '?', and blank '$' take
. 26, 27, and 28 respectively

sender selects each message units as D= characters value of the order
.of appearance in the message
.So in this case N=29 and k=2
:And as a linear transformation Ali will use
C
1
*29 +C
2
...
C
3
*29 +C
4
……for C
i
represents the characters in the message
.till the value of the last character in the message is computed
.And i=1, 2, 3…the last character in the message
Note that Se=526
: S=18,e=4 so
..…S*29+e=18*29+4=526
.The same is for the rest of the block characters
The calculations of the numbers and the key agreement is applied by the
:program "mymessagen" of appendix C, and arranged in the table
by: Thenaa Ali Kadhum 29
838 28*29+26 $.
140 4*29+24 ey
419 14*29+13 on
824 28*29+12 $m
352 12*29+4 me
536 18*29+14 so
144 4*29+28 e$
824 28*29+12 $m
380 13*29+3 nd
526 18*29+4 Se
Ali chooses {(10110000),
(10011000),(11100100)}, to
:form the IFS, so the IFS are
}.
29
838
0
29
140
0
29
377
29
822
,
0
29
352
29
536
0
0
29
144
,
29
824
29
380
0
29
526
{
2
2
2 2
2
2
2
2 2
2
]
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

]
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

,
`

.
|
·
]
]
]

·
y
x
Y
X
U
y
x
y
x
D
y
x
L W
by: Thenaa Ali Kadhum 30
To get the attractor of the
above affine
transformations, applying
the outputs of the
program "mymessagen"
in appendix C, as inputs
to the affine
transformations, of the
program " message(n)" of
appendix B, according to
what the sender and the
receiver agreed on , the
program applies the
random algorithm that
mentioned in the first
chapter, and the image is
:the attractor in Figure3.1
by: Thenaa Ali Kadhum 31
by: Thenaa Ali Kadhum 32
by: Thenaa Ali Kadhum 33
:Example2
Suppose Ali and Aqeel have
agreed to encipher and
decipher block messages of
length k=2 in a language with
N=29 alphabet. Suppose the
classical key is of the following
:(form (11111100
2
29 mod
202
322
206 821
781 14
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

y
x
y
x
C
}
29
821
0
0
29
781
,
29
202
29
322
29
206
0
0
29
14
{
2
2
2
2
2
2
]
]
]

,
`

.
|
·
]
]
]

]
]
]
]
]
]

+
]
]
]

,
`

.
|
·
]
]
]

·
y
x
y
x
L
y
x
y
x
D W
Applying the outputs of the appendix C,
the function "mymessagen" as inputs
to the affine transformations, of the program
"message(n)", of appendix B, to obtain the
attractor image shown in Figure3.2:
by: Thenaa Ali Kadhum 34
Example3:
"send me some money."
If the sender and the recipient agreed on other key to their alphabet of the
same prime number 29 but of three characters together as a calculation of the
sentence's letters order {c
1
x
2
+c
2
x+c
3
:}, so the calculations are going to be
23603 29*28
2
29+0*26+ .$
11073
29*13
2
29+24*+4
ney
23910 29*28
2
29+14*+12 mo$
12126 29*14
2
29+4*+12 ome
4194 29*4
2
29+18*+28 e$s
11757 29*13
2
29+12*+28 d$m
15267 29*18
2
29+13*+4 sen
by: Thenaa Ali Kadhum 35
by: Thenaa Ali Kadhum 36
To make the encoding more difficult to intruders
the sender Ali is going to hide the attractor image
in Figure3.1 in a colored image of 256x 256 pixels
"size using a program by matlab, the function "main
,in Appendix D, which is a collection of call functions
to embed and extract the image of the message
.attractor
In Figure3.5, our message attractor embedded in a
:colored picture
by: Thenaa Ali Kadhum 37
by: Thenaa Ali Kadhum 38
typical image of a face, for example is shown in the Figure
it does not contain the type of self-similarity that can be
found in the usual fractals.
The image does not appear to contain affine
transformations of it. But, in fact, this image does contain a
different sort of self-similarity.
:Space of an Image
by: Thenaa Ali Kadhum 39
:The inverse problem of Iterated transformation
• GIVEN an image x
orig


FIND a contraction T in some family of mappings F,
• for which x
orig
is an approximate fixed point:
• T is called a fractal code for x
orig
and can be efficiently
represented by a small set of quantized coefficients
• x
*
is called a fractal approximation of x
orig

by: Thenaa Ali Kadhum 40
The decoding scheme
The fractal transform basically involves multiplying a pixel in the
selected domain block by an average contrast "scaling factor" and
adding a brightness "offset factor" to the result. Thus the fractal
transformation is applied to the domain block to produce a new
.range block that is visually similar to the original range block
These transformed parts do not fit together, in general, to form an exact
copy of the original image, and so we must allow some error in our
.representation of an image as a set of transformations
by: Thenaa Ali Kadhum 41
:Construction of Fractal Codes
GEOMETRIC PART
corresponds to mapping in position and size from the domain cell D
i
to
the range cell R
i
:. we consider
size of( D
i
) = 2 * size of( R
i
( ). (7

:MASSIC PART
The fractal transform basically involves multiplying a pixel in the selected
domain block by an average contrast "scaling factor" and adding an
brightness "offset factor" to the result. Thus the fractal transformation is
applied to the domain block to produce a new range block that is
visually similar to the original range block. This new block is written to
.the steganographic image in place of the old range block

by: Thenaa Ali Kadhum 42
Thus if the image is partitioned into N range blocks, then the system
can be represented by a set of contractive transformations
w}
i
: R
2
→R
2
, for i=1, 2, ..., N } which defines a contractive map
( (8
partitioned iterated function system has a unique fixed point x
w

((attractor image of W
(9)
Also x
w
:can be given by
(10)


(11)
N
i
i
1
. ) ( ) (
·
• · • w W
N
i
i
x x x
1
) ( ) (
·
· ·
w w w
w W
2 0
. ) ( lim R ∈ · ·
∞ →
x point any for x x x
n
n
))) ).. (W(W(...W( W W
w
.
'
'

,
`

.
|
+

,
`

.
|

,
`

.
|
·

,
`

.
|
·

,
`

.
|
i
i
i i
i i
i
f
e
y
x
d c
b a
y
x
y
x
w
by: Thenaa Ali Kadhum 43
∑ ∑
∑ ∑ ∑
· ·
· · ·


·
n
i
n
i
i
i
n
i
n
i
n
i
i i i i
i
a a n
b a b a n
s
1 1
2 2
1 1 1
) ( ) (
) )( ( ) (
.
1
1 1

,
`

.
|
− ·
∑ ∑
· ·
n
i
n
i
i i i i
a s b
n
o
. 0 , 0 ) (
) 2 ( ) 2 ) ( 2 (
1
2 2
1 1
2 2
2
1
2
1 1 1
2
1
2
∑ ∑ ∑
∑ ∑ ∑ ∑ ∑
· · ·
· · · · ·
· · · −

]
]
]
− + + − + ·
n
i
i
n
i
i
n
i
i
n
i
i
n
i
i i
n
i
i
n
i
i
n
i
i
n b o and s then a a n if
n b on o a o b a a s b R
by: Thenaa Ali Kadhum 44
Before comparing a domain block D
i
with the range block
R
i
, D
j
is contracted by a factor of two on each side by
averaging neighboring pixels (figure 4.6), followed by the
application of one of the eight rotations and reflections
(figure 4.5) making up the isometrics of a square (figure
4.7).
by: Thenaa Ali Kadhum 45
by: Thenaa Ali Kadhum 46


.Figure4.7 An isometry applied to a domain block
This increases the size of domain library by eight times, so
there are greater chances of getting a good match. For
each R
i
, by calculating s
i
, o
i
and rms value corresponding
to all D
i
s in the selected quadrant. These parameters are
calculated as given in (equations 14, 15 and 13
respectively). Domains block corresponding to which rms
value is minimum, is chosen along with s
i
and o
i
.
by: Thenaa Ali Kadhum 47
: Encoding algorithm
Implementation of the algorithm is based on the following
assumptions:

Given an image f that we want to encode, the goal is to
find w
1
, w
2
, …w
N
, such that f is the fixed point of W.
• let the image be made up of N range blocks R
i
and the
corresponding domain blocks be D
i
.
• then we want to minimize the distance d(R
i
,w
i
(D
i
)),
i=1,…N .

The best matching domain is said to cover the range.
• Mark R
i
as covered, and write out the transformation wi.

else
• Partition R
i
into smaller ranges that are marked as
uncovered, and remove R
i
from the list of uncovered
ranges.
by: Thenaa Ali Kadhum 48
And the algorithm of an encoding with N
r
: transformations is
• Choose a target number of ranges N
r
.
• Set a list to contain all ranges R
i
, and mark it as uncovered.
• While there are uncovered ranges in the list do
{
• For each uncovered range in the list, find and store the domain
D
i
∈ D
• Out of the list of ranges, find the range R
j
with size (R
j
) > r
min
,
with the largest rms (i.e. which is covered worst).
• If the number of ranges in the list is less than N
r
then
{
• Partition R
j
into smaller ranges which are added to the list and
marked as uncovered.
• Remove R
j
, w
j
and D
j
from the list.
}
}
• Write out all the w
i
in the list.
by: Thenaa Ali Kadhum 49
• example2:
• Original image f= 256x256.
• Range blocks 8x8=1024 blocks (non- overlapping).
• Domain blocks 16x16- 241 x241 = 58081(overlapping).
• Need to compare 58081*8= 464,648 squares with each of the 1024 range blocks.
• Since the size of domain block is 4 times the size of range block, we either sub-sample or
average.
• The previous is an input to our attractor image of the affine transformations generated by
the characters of the message as the sender and the receiver agreed on as the key to
their secrete communications
by: Thenaa Ali Kadhum 50
The value of s
i
, and o
i
, and the transformation is clear in
the window the above image for a domain and a best
match range with
s=0.232369,
o=195.0 and
rms Error located to 9.071
For a Domain in the space of the image below:
The value of s
i
, and o
i
, and the transformation is clear in
the window the above image for a domain and a best
match range with
s=0.232369,
o=195.0 and
rms Error located to 9.071
For a Domain in the space of the image below: