Palettes and GIF CSM25 Secure Information Hiding Dr Hans Georg - - PowerPoint PPT Presentation

palettes and gif
SMART_READER_LITE
LIVE PREVIEW

Palettes and GIF CSM25 Secure Information Hiding Dr Hans Georg - - PowerPoint PPT Presentation

Palettes and GIF CSM25 Secure Information Hiding Dr Hans Georg Schaathun University of Surrey Spring 2007 Dr Hans Georg Schaathun Palettes and GIF Spring 2007 1 / 30 Learning outcomes Learn how images are represented using a palette Get


slide-1
SLIDE 1

Palettes and GIF

CSM25 Secure Information Hiding Dr Hans Georg Schaathun

University of Surrey

Spring 2007

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 1 / 30

slide-2
SLIDE 2

Learning outcomes

Learn how images are represented using a palette Get an overview of hiding techniques in GIF et c. Understand how grayscale steganography can be adapted for palette images

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 2 / 30

slide-3
SLIDE 3

Colour palettes The image format

Outline

1

Colour palettes The image format The palette in Matlab Steganography in the palette

2

Steganography in the pixmap What about LSB? Palette sorting

3

Steganalysis of palette images

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 3 / 30

slide-4
SLIDE 4

Colour palettes The image format

The colour palette

The palette is a table of colours Typically 256 for images Sometimes 8 or 16 for screen view Each colour has an index The palette can be stored as

array of (say) 256 entries each entry: RGB colour . . . using 3 × 8 bits

1 2 3 4 5 6 . . . . . . 255

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 4 / 30

slide-5
SLIDE 5

Colour palettes The image format

Using the colour palette

The GIF file

The GIF file format uses the colour palette . . . in the spatial domain Like the grayscale image,

GIF is a matrix, I entry (x, y) defines the colour of pixel (x, y)

however Ix,y is the index of a colour in the palette A GIF file has to store both

A palette The pixel matrix (pixmap)

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 5 / 30

slide-6
SLIDE 6

Colour palettes The image format

Which is best?

GIF? JPEG? ‘true colour’?

GIF saves space compared to ‘true colour’ Perfect representation of selected colours Perfect for drawings and computer graphics

where only selected colours are used

JPEG is better for photos

Colours are ‘truer’ can ‘blur’, losing contrast and detail

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 6 / 30

slide-7
SLIDE 7

Colour palettes The palette in Matlab

Outline

1

Colour palettes The image format The palette in Matlab Steganography in the palette

2

Steganography in the pixmap What about LSB? Palette sorting

3

Steganalysis of palette images

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 7 / 30

slide-8
SLIDE 8

Colour palettes The palette in Matlab

Loading a palette image

Remember to store the palette

[pixmap,palette] = imread ( ’picture.gif’ ) imshow ( pixmap, palette )

  • therwise, treated as a weird grayscale image

You can work on palette and pixmap separately

>> [X,P] = imread ( ’krinslogo.gif’ ) ; >> whos X P Name Size Bytes Class Attributes P 256x3 6144 double X 120x90 10800 uint8

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 8 / 30

slide-9
SLIDE 9

Colour palettes The palette in Matlab

Exercise

Preliminaries

Suppose a GIF file uses a 8-bit palette. How much space does this GIF file save compared to a 24-bit true-colour image? Consider a 64 × 64 image and a 512 × 768 image. Give the answer as a percentage. How do you generate a random binary message (bit string) in matlab? Look up in the help system and find the necessary commands to generate a random N binary (logical) matrix.

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 9 / 30

slide-10
SLIDE 10

Colour palettes Steganography in the palette

Outline

1

Colour palettes The image format The palette in Matlab Steganography in the palette

2

Steganography in the pixmap What about LSB? Palette sorting

3

Steganalysis of palette images

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 10 / 30

slide-11
SLIDE 11

Colour palettes Steganography in the palette

A simple idea

Data hiding is possible

in the palette leaving the pixmap unaltered How? Any ideas?

Two basic ideas

changing colours changing order

Main disadvantage: low capacity

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 11 / 30

slide-12
SLIDE 12

Colour palettes Steganography in the palette

A simple idea

Data hiding is possible

in the palette leaving the pixmap unaltered How? Any ideas?

Two basic ideas

changing colours changing order

Main disadvantage: low capacity

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 11 / 30

slide-13
SLIDE 13

Colour palettes Steganography in the palette

A simple idea

Data hiding is possible

in the palette leaving the pixmap unaltered How? Any ideas?

Two basic ideas

changing colours changing order

Main disadvantage: low capacity

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 11 / 30

slide-14
SLIDE 14

Colour palettes Steganography in the palette

Changing colours

Minor changes to palette colours

as if they were pixels in ‘true colour’

  • nly difference: there are only (say) 256 entries

For instance, LSB

Capacity 3 × 256 bits (= 768 bits)

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 12 / 30

slide-15
SLIDE 15

Colour palettes Steganography in the palette

Changing order

Define a canonical colour order

i.e. obtained by a deterministic sorting algorithm always same order, regardless of input order

Assign colour indices according to canonical order For each message, assign a permutation P on {1, 2, 3, . . . , N} (N is palette size) Shuffle the palette using the permutation of the message Decoder can find canonical order (deterministic)

and hence deduce P which maps to the message.

N! = 1 · 2 · 3 · . . . · N possible messages

  • Approx. 1684 bits for an 8-bit palette

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 13 / 30

slide-16
SLIDE 16

Colour palettes Steganography in the palette

Large-scale data hiding

pixmap is main part of palette image file to hide a lot of data, the pixmap must be used the palette is small

can cover a correspondingly small amount of data

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 14 / 30

slide-17
SLIDE 17

Steganography in the pixmap What about LSB?

Outline

1

Colour palettes The image format The palette in Matlab Steganography in the palette

2

Steganography in the pixmap What about LSB? Palette sorting

3

Steganalysis of palette images

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 15 / 30

slide-18
SLIDE 18

Steganography in the pixmap What about LSB?

First attempt: LSB

We still have a pixmap as before Logical to attempt LSB

in the colour indices in selected pixels

What happens?

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 16 / 30

slide-19
SLIDE 19

Steganography in the pixmap What about LSB?

Exercise

LSB test

Take any GIF image from the web. Some test GIF images can be found on the module web pages. Make stego-images by embedding random binary messages of length 10%, 30%, 50% and 75% of capacity in the least significant bit. View the images. What does it look like? Extract the message again. Do you get the same message back? Hint: Reuse functions from previous exercises.

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 17 / 30

slide-20
SLIDE 20

Steganography in the pixmap What about LSB?

What it looks like

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 18 / 30

slide-21
SLIDE 21

Steganography in the pixmap What about LSB?

So, what do we do?

Green areas, are not too bad

Visible, but still green

Brown is terrible

It is suddenly green

Why is this?

Neighbour colour in the palette, can be

Similar

  • r far away

Somehow, we have to change to a similar colour

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 19 / 30

slide-22
SLIDE 22

Steganography in the pixmap What about LSB?

So, what do we do?

Green areas, are not too bad

Visible, but still green

Brown is terrible

It is suddenly green

Why is this?

Neighbour colour in the palette, can be

Similar

  • r far away

Somehow, we have to change to a similar colour

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 19 / 30

slide-23
SLIDE 23

Steganography in the pixmap What about LSB?

So, what do we do?

Green areas, are not too bad

Visible, but still green

Brown is terrible

It is suddenly green

Why is this?

Neighbour colour in the palette, can be

Similar

  • r far away

Somehow, we have to change to a similar colour

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 19 / 30

slide-24
SLIDE 24

Steganography in the pixmap Palette sorting

Outline

1

Colour palettes The image format The palette in Matlab Steganography in the palette

2

Steganography in the pixmap What about LSB? Palette sorting

3

Steganalysis of palette images

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 20 / 30

slide-25
SLIDE 25

Steganography in the pixmap Palette sorting

Three possible solutions

Colour reduction Colour sorting Beyond sorting

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 21 / 30

slide-26
SLIDE 26

Steganography in the pixmap Palette sorting

Reduce the palette

An ancient solution

Reduce colour depth by 50% 256 colours → 128 colours Duplicate each colour (or use a slight variation of it)

Such that colour i and colour i + 1 are identical (or almost)

Now LSB embedding is hardly perceptible visually How do you steganalyse it?

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 22 / 30

slide-27
SLIDE 27

Steganography in the pixmap Palette sorting

Reduce the palette

An ancient solution

Reduce colour depth by 50% 256 colours → 128 colours Duplicate each colour (or use a slight variation of it)

Such that colour i and colour i + 1 are identical (or almost)

Now LSB embedding is hardly perceptible visually How do you steganalyse it?

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 22 / 30

slide-28
SLIDE 28

Steganography in the pixmap Palette sorting

Reduce the palette

An ancient solution

Reduce colour depth by 50% 256 colours → 128 colours Duplicate each colour (or use a slight variation of it)

Such that colour i and colour i + 1 are identical (or almost)

Now LSB embedding is hardly perceptible visually How do you steganalyse it?

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 22 / 30

slide-29
SLIDE 29

Steganography in the pixmap Palette sorting

Sorting

Another obvious one

Sort the palette before embedding

Consecutive colours similar

Unsort before shipping

Sorted palette may be suspect The original order should look innocent

Many different sort orders

Sort by luminence Travelling salesman (EzStego)

Let (ri, bi, gi) be RGB of colour i Minimise P255

i=0[(ri − ri+1)2 + (bi − bi+1)2 + (gi − gi+1)2] Dr Hans Georg Schaathun Palettes and GIF Spring 2007 23 / 30

slide-30
SLIDE 30

Steganography in the pixmap Palette sorting

Abandon sorting

according to Jessica Fridrich

Input: Image I, Palette C = {c1, c2, . . . , cL}, Message m Output: Image J for each bit b of m choose a pixel Ix,y if Ix,y mod 2 = b, then find ci ∈ C such that ci mod 2 = b and ||ci − Ix,y||2 is minimised Ix,y := ci end if end for

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 24 / 30

slide-31
SLIDE 31

Steganography in the pixmap Palette sorting

Sort order and colour difference

What is the distance ||c1 − c2||2 between colours?

Euclidean: |R1 − R2|2 + |G1 − G2|2 + |B1 − B2|2 Ignore chrominence: |Y1 − Y2|

No obvious choice. Same problem for sorting and ‘abandon sorting’

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 25 / 30

slide-32
SLIDE 32

Steganalysis of palette images

General principles

General approaches in the spatial domain

Visual steganalysis Statistical steganalysis

. . . similar to other representations in the spatial domain Structural steganalysis

Consider the file format Does it look ‘normal’?

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 26 / 30

slide-33
SLIDE 33

Steganalysis of palette images

Reading

Core Reading David Wayner: Disappearing Cryptography Chapter 17

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 27 / 30

slide-34
SLIDE 34

Steganalysis of palette images

Structural steganalysis

Structural steganalysis considers file format et c. Palette structure can be significant

Duplicate colours? Unusual palette order?

General structural artifacts (not limited to palette images)

Resolution requirements; palette size; et c. Bad or limited software can create artifacts

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 28 / 30

slide-35
SLIDE 35

Steganalysis of palette images

General, Spatial Approaches

Most attacks on spatial, grayscale images apply

χ2/pairs of values pairs analysis RS analysis

Statistics may vary

parameters may need tuning reasoning is the same

Let’s explore it in excersises.

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 29 / 30

slide-36
SLIDE 36

Steganalysis of palette images

Exercise

Steganalysis

Take the stego-images created in the previous message, and plot the χ2 statistic as a function of N. What do you observe? Remark Extra, challenging exercises on the exercise sheet on the web page.

Dr Hans Georg Schaathun Palettes and GIF Spring 2007 30 / 30