You are on page 1of 26

Digital Watermarking

An Application of Digital Forensics


Princeton CS426 examples
http://www.cs.princeton.edu/courses/archive/fall98/cs426/assignments/morph/morph_results.html
Watermarking

Watermarking is the process of


embedding data (encoding
hidden copyright information)
called a watermark (also known
as Digital Signature, Tag or Label)
into a multimedia object such
that watermark can be detected
or extracted later to make an
assertion about the object. The
object may be an audio, image,
text or video.
General watermarking Framework
Key Key

Attacks
Encoder Decoder

Cover Image Watermarked Image

Watermark Recovered Watermark


Requirements of Watermarking
• Security
• Imperceptibility
• Capacity
• Robustness

The tradeoffs among Imperceptibility, Robustness and Capacity


Matrix Representation of Images
A digital image can be written as a matrix

 x[0, 0] x[0,1]  x[0, N  1] 


 x[1, 0] x[1,1]  x[1, N  1] 
x[ n1 , n2 ]  
     
 
 x[ M  1, 0]   x[ M  1, N  1] MxN

 35 45 20 
 43 64 52 
 
10 29 39 
Digital Color Images
xR [n1 , n2 ]
xG [n1 , n2 ]
xB [n1 , n2 ]

 Color image
– Can be represented by three functions, R(x,y) for
red, G(x,y) for green, and B(x,y) for blue.
Classification
Watermarking Domain
• Spatial Domain Watermarking
LSB Replacement Method

• Transform Domain Watermarking


– (DCT, DWT, SVD based Approach)
A visible watermark

Taken from IBM research magazine


Invisible watermark
Invisible Watermark types

The fragile watermark is embedded in such a way that any


manipulation or modification of the image would alter or
destroy the watermark.

The robust watermark is embedded in such a way that


alternations made to the pixel value are perceptually not
noticed and it can be recovered only with appropriate
decoding mechanism.
Watermarks Detection Techniques

• At least, digital watermarks can be subdivided into blind and


non-blind detection techniques, which are strongly related to
the decoding process.
• Blind- If the detection of the digital watermark can be
done without the original data, such techniques are called
blind.
• Non-blind - Non-blind techniques use the original source to
extract the watermark by simple comparison and correlation
procedures.
Reversible Watermarking
Least Significant bit (LSB) method
• Sometimes abbreviated as LSB, the least significant bit
is the lowest bit in a series of numbers in binary; the LSB
is located at the far right of a string. For example, in the
binary number: 10111001, the least significant bit is the
far right 1.
• human eyes are not very attuned to small variance in
color and therefore processing of small difference in
the LSB will not noticeable.
1 0 1 0 1 1 0 0
LSB Decomposition of one Pixel
Image Bit Plane Slices
Watermark Replacement

LSB Plane is replaced by Binary Watermark

Binary watermark
LSB Replacement Code
• clc
• w_mark=imread('newlogobinary.tif'); %%read watermark
• [H W]=size(w_mark); %%size of watermark
• imshow(w_mark); %%show watermark
• img=imread('lena_gray.tif'); %%read host/cover image
• wimg=img; %% creating alias image of original

• %%%%%%%%%%watermark embedding%%%%%%%%%%%%%%%%%%%%
• for i=1:H
• for j=1:W
• a=img(i,j);
• z = dec2bin(a,8); %% decimal to binary conversion with 8 bits
• z1=w_mark(i,j);
• z(8)= dec2bin(z1,1); %%LSB replacement with watermark bit
• wimg(i,j) = bin2dec(z); %% binary to decimal conversion
• end
• end
• imwrite(wimg,'watermarked_lena.jpg','jpg','quality',100); %%writing the watermark
image
LSB Replacement Code(contd.)
• %%%Different attacks
• % img1=medfilt2(img1);
• % img1=imnoise(img1,'gaussian', 0.001);
• % img1=imnoise(img1,'salt & pepper', 0.001);

• figure(), imshow(wimg); %% showing watermarked image


• img1=imread('watermarked_lena.jpg'); %% reading watermarked image

• %%Extracting watermark from the LSB plane of watermarked image
• for i=1:H
• for j=1:W
• a=dec2bin(img1(i,j),8);
• w_mark1(i,j)=bin2dec(a(8));
• end
• end

• figure();
• imshow(w_mark1);
• imwrite(w_mark1,'w_mark1.tif'); %% Recovered watermarked
Original Image

Original watermark

Original Image (Cover Image) 512X512 Original Watermark 512X512

Watermarked Image

Extracted Watermark

Watermarked Image Extracted Watermark


LSB Observations and Results
Original watermark

Original Image

Original Binary Watermark


512x512

Cover Image 512x512 Gaussian Median Filtering


Noise var=0.001

Recovered Watermark
LSB Observations and Results

• The LSB plane and plane next to LSB contains practically no visually
significant information.

• LSB manipulation gives an enormous amount of capacity in LSB plane for


hiding the information.

• This technique is not very secure.

• Hidden information is affected when simple conversion format change


from GIF or BMP format to lossy compression format such as JPEG is done,
subjected to Gaussian noise, Cropping of the stego image.
Thank You……

You might also like