You are on page 1of 50

Using

Fractals in
Information Hiding

by
Thenaa Ali Kadhum
supervised by

Dr. Nadia M. G.

1 by: Thenaa Ali Kadhum


??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
2 theory .. by: Thenaa Ali Kadhum
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

3 by: Thenaa Ali Kadhum


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
4 by: Thenaa Ali Kadhum
:Examples

Koch Curve: subdivide each segment of Kn


into three equal parts, and replace the
middle part with a bump in the shape of an
.equilateral triangle

5 by: Thenaa Ali Kadhum


6 by: Thenaa Ali Kadhum
:Generating the fractals

The Deterministic Algorithm

The Random Iteration Algorithm

7 by: Thenaa Ali Kadhum


The Deterministic Algorithm

Let {X; w1, w2 ...wn) be an IFS. Choose any compact


set Bo ⊂ R2 . Then compute successively
Bn+1 = union (wi (Bn)) for i = 1... , n
This sequence {Bn} will converge to the attractor of
.the IFS

8 by: Thenaa Ali Kadhum


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)
9 by: Thenaa Ali Kadhum
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

10 by: Thenaa Ali Kadhum


: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

11 by: Thenaa Ali Kadhum


: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

12 by: Thenaa Ali Kadhum


Cryptography Steganography
is concerned withdisguising the seeks to makethe very presence
content of a message, the plain of the message undetectable and
text, butmakes no effort at is usually used in conjunction
concealing the resulting cipher with cryptography by hiding a
text. In other words it is about previously encrypted message. In
protecting the content of a other words it is about
.message concealing the message very
.existence

In cryptographythe enemy is In steganographythe enemy is


allowed to detect, intercept and not allowed to even detect that
modify messages without being there is a second secret message
able to violate certain security .present
premises guaranteed by a
.cryptosystem
The end result in cryptography is The end result in steganography
the cipher text isa stego image
13 by: Thenaa Ali Kadhum
: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

14 by: Thenaa Ali Kadhum


Example for null ciphers
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
Byreading the first character of every word in
the first messagewill yield the following hidden
:text
."PERSHING SAILS FROM N.Y. JUNE 1"
15 by: Thenaa Ali Kadhum
Steganography's common Carriers:

 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.
16 by: Thenaa Ali Kadhum
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.

: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.,
27=128), whereas the low-order or least
significant bit is the one with the
lowest arithmetic value (i.e., 20=1).
17 by: Thenaa Ali Kadhum
Algorithms
: Embedding algorithm :Extraction algorithm
Embedding process: least Extracting process: least
significant bit significant bit substitution
substitution for i= 1, …l(m) do
for i= 1, …l(c ) do compute index ji , where to
si←ci store ith message bit
end for ( mi ←LSB(cji
for i= 1, …l( c ) do end for
compute index ji , where to
store i th message bit
si←ci ↔mi
end for

18 by: Thenaa Ali Kadhum


:Example2

Consider a palette with The values, of four


four colors: white, red, adjacent pixels, with
blue, and green which colored white, white,
have the palette blue, and blue
:position entries of .(10 10 00 00)
and (10)2 ,(01)1 ,(00)0 We will try and hide the
. 3(11) respectively decimal number 10
represented in binary
.as 1010

19 by: Thenaa Ali Kadhum


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

20 by: Thenaa Ali Kadhum


:Applying steganography

  he carrier of the stego information is a jpg format
T
 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

21 by: Thenaa Ali Kadhum


22 by: Thenaa Ali Kadhum
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 ‘aij’.
4) The input of the calculations in the affine
transformations ‘Ax+b’.
23 by: Thenaa Ali Kadhum
Constructing the IFS from the message:
Let the contractive affine transformations {Wi ; i=1,…,n} in R2, be of the
:form
 x   a11 a 12   x  e 
W  =     +   = AX + b .
 y   a 21 a 22   y  f 

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, PK) =1, as D the value of the joint characters in the key agreement
.between the sender and the recipient

24 by: Thenaa Ali Kadhum


• 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:

 x   a 11 0   x  0 
W  =   + = AX → 10000000 = A .
 y   0 0   y  0

x   0 0   x  0
W  =   + = AX → 00100000 = A .
 y   a 21 0   y  0

x   0 a 12   x  0
W  =   + = AX → 01000000 = A .
 y   0 0   y  0

x   0 0   x  0 
W  =   + = AX → 00110000 = A.
 y   a 21 a 22   y  0

x   0 0   x  0
W  =   + = AX → 01100000 = A .
 y   0 a 22   y  0

 x   a 11 a 12   x  0
W  =   + = AX → 11000000 = A .
 y   0 0   y  0

25 by: Thenaa Ali Kadhum


 x   a11 a 12   x  0
W  =   + = AX → 11100000 = ULA .
 y   a 21 0   y  0

 x   a 11 0   x  0 
W  =   + = AX → 10110000 = LLA .
 y   a 21 a 22   y  0

 x   a11 0   x  0 
W  =   + = AX → 10010000 = DA .
 y   0 a 22   y  0
 x   a 11 a 12   x  0
W  =   + = AX → 11110000 = ALLA .
 y   a 21 a 22   y  0

x   0 a 12   x  0
W  =   + = AX → 01100000 = SDA .
 y   a 21 0   y  0

Are all the possible inputs as a linear transformations, the first six orders are better to be ignored and
:the non- linear are

x   x  e 
W   = A   +   = AX + b → 11101000 = AX .
 y  y  0 

x   x  0 
W   = A   +   = AX + b → 11100100 = AY .
 y  y  f 

26 by: Thenaa Ali Kadhum


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 11 a 22
, and .
NK N K

aij= any equation they agree on as a key to their communication

Here a11, and a22 are the numerical values of the first two unit
messages in a ring of integers modulo Nk, i.e. the numerical value
of a number of kth -digit in a numeric system with N-digits. The
.sender can select the next member of the IFS
27 by: Thenaa Ali Kadhum
: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
...C1*29 +C2
C3 *29 +C4 ……for Ci 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

28 by: Thenaa Ali Kadhum


Ali chooses {(10110000),
Se 18*29+4 526 (10011000),(11100100)}, to
:form the IFS, so the IFS are
nd 13*29+3 380
$m 28*29+12 824  526
 0 

 x   29 2 ,
e$ 4*29+28 144 W = {L   =
 y   380 824 
 2 
 29 29 2 
so 18*29+14 536
me 12*29+4 352  144 
 2 0  x  352 
x 29    +  29 2  ,
$m 28*29+12 824 D  =
 y  536   y   
 0   0 
on 14*29+13 419  29 2 

ey 4*29+24 140  822 377 


 2  x
 0 
 X   29 2  
$. 28*29+26 838 U  =
29 
  +  838 }.
Y   0 140   y   
29 by: Thenaa Ali Kadhum    29 
2
 29 2 
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

30 by: Thenaa Ali Kadhum


31 by: Thenaa Ali Kadhum
32 by: Thenaa Ali Kadhum
:Example2
 x   14 781   x   322 
C   =     +   mod 29 2
Suppose Ali and Aqeel have  y   821 206   y   202
agreed to encipher and
decipher block messages of
length k=2 in a language with
N=29 alphabet. Suppose the  14   322   781 
classical key is of the following  0  
 29   x  29 0  x
 x   29 2
  x 2 2
  }
W = {D   =   +   , L  =   
:(form (11111100  y   0 206   y   202   y   0 821   y 
   29 2   
 29 2   29 2 

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:

33 by: Thenaa Ali Kadhum


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 {c1x2+c2 x+c3:}, so the calculations are going to be

sen 29*18229+13*+4 15267


d$m 29*13229+12*+28 11757
e$s 29*4229+18*+28 4194
ome 29*142 29+4*+12 12126
mo$ 29*282 29+14*+12 23910

ney 29*132 29+24*+4 11073


.$ 29+0*26+ 29*282 23603
34 by: Thenaa Ali Kadhum
35 by: Thenaa Ali Kadhum
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

36 by: Thenaa Ali Kadhum


37 by: Thenaa Ali Kadhum
:Space of an Image
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.

38 by: Thenaa Ali Kadhum


:The inverse problem of Iterated transformation
• GIVEN an image xorig

• FIND a contraction T in some family of mappings F,


• for which xorig is an approximate fixed point:

• T is called a fractal code for xorig and can be efficiently


represented by a small set of quantized coefficients
• x* is called a fractal approximation of xorig
39 by: Thenaa Ali Kadhum
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

40 by: Thenaa Ali Kadhum


:Construction of Fractal Codes
GEOMETRIC PART
corresponds to mapping in position and size from the domain cell Di to
the range cell Ri:. we consider
size of( Di ) = 2 * size of( Ri( ). (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

41 by: Thenaa Ali Kadhum


Thus if the image is partitioned into N range blocks, then the system
can be represented by a set of contractive transformations
i : R →R , for i=1, 2, ..., N } which defines a contractive map w}
2 2
N
( W ( •) = w ( •) . (8
i
i =1

partitioned iterated function system has a unique fixed point xw


((attractor image of W N

(9) x w = W( x w )= w i ( x w)
i =1
Also xw :can be given by
x(10)
w = lim W 0n
( x ) = W (W(W(...W( x ).. .))) for any point x ∈ R 2
n→ ∞

x '   x   ai bi  x   ei 
(11) 
y ' 
 = wi 
 y =


 
 + 
d i  y   f i 
 .
     ci 

42 by: Thenaa Ali Kadhum


n n n
n( ∑ai bi ) − (∑ai )(∑bi )
si = i =1
n
i =1
n
i =1

n(∑a i ) − (∑ai ) 2
2

i =1 i =1

1 n  n
oi = ∑bi −si ∑a i .
n  i =1 i =1 

n 2 n n n n
 2
R =  ∑ bi + s (∑ ai − 2(∑ ai bi ) + 2o∑ ai ) + o(on − 2∑ bi ) n
2 2

 i =1 i =1 i =1 i =1 i =1 
n n n
if n 2
∑ ∑ i
a −
i =1
( a2
i) = 0 , then s
i =1
= 0 and2
o = ∑i .
b n 2

i =1
43 by: Thenaa Ali Kadhum
Before comparing a domain block Di with the range block
Ri, Dj 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).

44 by: Thenaa Ali Kadhum


45 by: Thenaa Ali Kadhum
.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 Ri, by calculating si, oi and rms value corresponding
to all Dis in the selected quadrant. These parameters are
calculated as given in (equations 14, 15 and 13
respectively). Domains block corresponding to which rms
.value
46 is minimum, is chosen along
by: Thenaa with si and oi
Ali Kadhum
: 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 w1, w2, …wN , such that f is the fixed point of W.
• let the image be made up of N range blocks Ri and the
corresponding domain blocks be Di.
• then we want to minimize the distance d(Ri,w i(Di)),
i=1,…N .
• The best matching domain is said to cover the range.
• Mark Ri as covered, and write out the transformation wi.
• else
• Partition Ri into smaller ranges that are marked as
uncovered, and remove Ri from the list of uncovered
ranges.
47 by: Thenaa Ali Kadhum
And the algorithm of an encoding with Nr: transformations is

• Choose a target number of ranges Nr.


• Set a list to contain all ranges Ri, 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
Di ∈ D
• Out of the list of ranges, find the range Rj with size (Rj) > rmin ,
with the largest rms (i.e. which is covered worst).
• If the number of ranges in the list is less than Nr then
{
• Partition Rj into smaller ranges which are added to the list and
marked as uncovered.
• Remove Rj, wj and Dj from the list.
}
}
• Write out all the wi in the list.

48 by: Thenaa Ali Kadhum


• 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

49 by: Thenaa Ali Kadhum


The value of si , and oi , 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:

50 by: Thenaa Ali Kadhum

You might also like