• the cell at row i and column π
i
is labeled by the
number π
i
, for each i = 1,2, ...,n.
In our 2DM representation, a permutation π over the
set N
n
= {1, 2,.. .,n} is represented by an n×n matrix
A as follows:
• the cell at row i and column π
i
is marked by a
specific symbol, for each i = 1,2, ...,n.
1
2
3
4
5
6
6
5
4
3
2
1
1
2
3 4
5
6
Figure 1: A 2DM representation of π = (2,5,3,1,6, 4).
We next present an algorithm which extracts the
permutation π from its 2DM representation matrix.
More precisely, let π be a permutation over N
n
and let
A be the 2DM representation matrix of π ; given the
matrix A, we can easily extract π from A in linear time
(in the size of matrix A) by the following algorithm:
Algorithm Extract π from 2DM
Input: the 2DM representation matrix A of π;
Output: the permutation π;
1. For each column i of matrix A, 1 ≤ i ≤ n, do:
find the marked cell j in the column i,
and set i in cell A( j,i) and 0 in all other cells;
2. For each row i of matrix A, 1 ≤ i ≤ n, do:
find the cell j in the row i with value not
equal to 0, and set π
i
← A(i, j);
3. Return the permutation π;
2.2 Color Images
A digital image is a numeric representation of a 2-
dimensional image; it has a finite set of values, called
picture elements or pixels, that represent the bright-
ness of a given color at any specific point in the image.
(Gonzalez and Woods, 2007).
The range of colors can be represented on the
Cartesian 3-dimensional system. The axes x, y and z
are used for the red green and blue color respectively.
In our system, since a color is a triple of integers
(x,y,z), a digital image I of resolution N × M (i.e., it
contains N rows and M columns of pixels) is stored in
a three-dimensional matrix Img of size N × M × 3 as
follows:
if the pixel I(i, j) of the image I has (x,y,z)
color, then Img(i, j,1) = x, Img(i, j, 2) = y, and
Img(i, j,3) = z.
3 OUR WATERMARKING
SYSTEM
In this section we describe the modules and the main
functions of the proposed watermarking system. Our
system, which we named WaterIP, provides to a stu-
dent two main working levels:
• Embed Level. Through a friendly graphical user
interface, the student creates a secret key (i.e., the
watermark w) and selects a picture I in which he
wants to embed the watermark; in our system the
watermark w is a permutation π over the set N
6
and it is embedded into the original picture I, us-
ing the 2DM representation, resulting the water-
marked picture I
w
.
• Mark Level. The student, in order to prove that
he is the owner of the picture I
w
, inputs the wa-
termarked picture I
w
into the system which makes
the marks visible to the student so that he will be
able to easily extract the watermark w (i.e., his
secret key) just by looking at the marks; in partic-
ular, the system returns the marked picture I
m
to
the student.
We should mention that our system uses a permu-
tation π over the set N
6
for the watermark w. The set
N
6
was selected in purpose; we preferredto use a fixed
size rather than giving the size as a choice to the user.
That choice was made in order to make the system
simple as it is designed to serve educational needs.
Also 6 is not a great number so it is relatively easy to
memorize by a student, nor it is a very small number
and that makes the permutation more presentable.
3.1 Embed Watermark into Image
We next describe an algorithm which embeds a per-
mutation π into an image I;
The algorithm takes as input a permutation π and
an image I, in which the user wants to embed the wa-
termark w = π, and produces the watermarked image
I
w
; it works as follows:
Step 1. The algorithm first computes the 2DM repre-
sentation of the permutation π = (π
1
,π
2
,. ..,π
6
), that
AWATERMARKINGSYSTEMFORTEACHINGSTUDENTSTORESPECTINTELLECTUALPROPERTYRIGHTS
337