CHAPTER 1 1
CHAPTER 1
1
INTRODUCTION
1.1 Background
The fast development of the Internet in recent years has made it possible to easily create
copy, transmit, and distribute digital data. Consequently, this has led to a strong demand for
reliable and secure copyright protection techniques for digital data. Digital watermarking has
been proposed as valid solution for this problem. The purpose of the watermark is to embed
some additional information about the digital data without visibly modifying it.
Digital watermarking is the process of embedding information into a digital signal which may
be used to verify its authenticity or the identity of its owners, in the same manner as paper
bearing for watermarking visible identification. In digital watermarking, the signal may be
text, audio, pictures, or video. If the signal is copied, then the information also is carried in
the copy. A signal may carry several different watermarks at the same time.
In visible digital watermarking, the information is visible in the picture or video. Typically,
the information is text or a logo, which identifies the owner of the media. The image on the
right has a visible watermark. When a television broadcaster adds its logo to the corner of
transmitted video, this also is a visible watermark.
In invisible digital watermarking, information is added as digital data to audio, picture, or
video, but it cannot be perceived. The watermark may be intended for widespread use and
thus, is made easy to retrieve or, it may be a form of steganography, where a party
communicates a secret message embedded in the digital signal. In either case, as in visible
watermarking, the objective is to attach ownership or other descriptive information to the
signal in a way that is difficult to remove. It also is possible to use hidden embedded
information as a means of covert communication between individuals.
Our aim was to study different watermarking techniques and implement the one which is
most resistant to all types of attack, scalar or geometric. Counterfeiters try to degrade the
quality of watermarked image by attacking an image (generally attacks are median and
Gaussian filter, scaling, compression and rotation of watermarked image).By attacking
watermarked image it become very difficult to recover watermark back from the
watermarked image and even if it extracted one may no longer use it to prove the ownership
and copyrights. So our main idea was to find such regions in an image which are very stable
and resistant to attacks.
2
Figure 1: Sample picture before Figure 2: Sample picture after
Embedding Watermark Embedding Watermark
1.2 Digital watermarking life-cycle phases
Figure 3: Digital Watermarking life-cycle phase
General digital watermark life-cycle phases with embedding-, attacking-, and detection and
retrieval functions
The information to be embedded in a signal is called a digital watermark, although in some
contexts the phrase digital watermark means the difference between the watermarked signal
and the cover signal. The signal where the watermark is to be embedded is called the host
signal. A watermarking system is usually divided into three distinct steps, embedding, attack,
3
Result
Insecure Part
SEASASSignals S
Embedding Function E
Attacking Function A
Detecting Retrieval Function D R
Secure PartInsecure or Secure Part
and detection. In embedding, an algorithm accepts the host and the data to be embedded, and
produces a watermarked signal.
Then the watermarked digital signal is transmitted or stored, usually transmitted to another
person. If this person makes a modification, this is called an attack. While the modification
may not be malicious, the term attack arises from copyright protection application, where
pirates attempt to remove the digital watermark through modification. There are many
possible modifications, for example, lossy compression of the data (in which resolution is
diminished), cropping an image or video or intentionally adding noise.
Detection (often called extraction) is an algorithm which is applied to the attacked signal to
attempt to extract the watermark from it. If the signal was unmodified during transmission,
then the watermark still is present and it may be extracted. In robust digital watermarking
applications, the extraction algorithm should be able to produce the watermark correctly,
even if the modifications were strong. In fragile digital watermarking, the extraction
algorithm should fail if any change is made to the signal.
1.3Types of Watermark
Based on various parameter of Watermarking system, it is classified into various
types. Different type of Watermark depending on various parameters are described
below:
Visible watermark or transparent
Visible Watermarks are those watermarks which can be easily seen by End
users. Logo of particular television channel is on example if Visible
Watermark.
Invisible watermark
Those watermarks that are stored in the form of digital signal in original signal
and cannot be directly perceived by users are Invisible Watermark.
Annotation of digital photograph with descriptive information is best example
of Invisible Watermark.
4
Robust watermark or fragile
A digital watermark is called robust if it resists a designated class of
transformations. Robust watermarks may be used in copy protection
applications to carry copy and no access control information to form correct
order and get the digital water marking.
A digital watermark is called robust if it resists a designated class of
transformations. Robust watermarks may be used in copy protection
applications to carry copy and no access control information to form correct
order and get the digital water marking
Public or private
In the case of Public Watermark the original signal is not needed during the
detection process to detect the mark. Solely the key, which is typically used to
generate some random sequences used during the embedding process is
required. These type of scheme can be easily used in Mass market electronic
equipment or software.
In the case of Private Watermarking, the original signal is not required during
the detection process.
Symmetric or asymmetric
People refer to photo watermarking schemes with properties reminding
Asymmetric cryptosystem. In this case, the detection process is fully known to
anyone as opposed to blind watermarking where a secret key is required. So
here only a public key is needed for verification and a private key is used for
embedding though, knowledge of public key does not help to compute the
private , it does not either allow removal of the mark nor it allows an attack to
forge a mark.
In order to be successful, the watermark should be invisible, robust and informed to
premeditated or spontaneous of image.
5
1.4 Attacks on Watermarked Work
Below are some significant known attacks: -
Scrambling Attacks:
A scrambling attack is a system-level attack in which the samples of a Work are
scrambled prior to presentation to a watermark detector and then subsequently
descrambled. The type of scrambling can be a simple sample permutation or a more
sophisticated pseudo-random scrambling of the sample values. The degree of
scrambling necessary depends on the detection strategy. A well-known scrambling
attack is the mosaic attack, in which an image is broken into many small rectangular
patches, each too small for reliable watermark detection. These image segments are
then displayed in a table such that the segment edges are adjacent. The resulting table
of small images is perceptually identical to the image prior to subdivision. This
technique can be used in a web application to evade a web-crawling detector. The
scrambling is simply the subdivision of the image into sub images, and the
descrambling is accomplished by the web browser itself.
Pathological Distortions:
For a watermark to be secure against unauthorized removal, it must be robust to any
process that maintains the fidelity of the Work. This process may be a normal process,
in which case we are requiring that a secure watermark be robust. However, it may
also be a process unlikely to occur during the normal processing of the Work. Any
process that maintains the fidelity of the Work could be used by an adversary to
circumvent the detector by masking or eliminating the watermark. The two most
common categories of such pathological distortions, geometric/temporal distortions
(attacks on synchronization) and noise removal distortions.
Synchronization Attacks:
Many watermarking techniques are sensitive to synchronization. By disturbing this
synchronization, an adversary attempts to mask the watermark signal. Examples of
simple synchronization distortions include delay and time scaling for audio and video,
6
and rotation, scaling, and translation for images and video. These simple distortions
can be implemented such that they vary over time .
Copy Attacks:
A copy attack occurs when an adversary copies a watermark from one Work to
another. As such, it is a form of unauthorized embedding. The copy attack attempts to
thwart the effectiveness of such systems by estimating the watermark given in an
originally watermarked piece of media, and then adding that watermark to an un-
watermarked piece. In the first scenario listed above, this would allow an attacker to
have an inauthentic image be declared authentic, since it contains a watermark. In the
second scenario, an attacker could flood the market with content which ordinarily
would allow a user to manipulate it as he saw fit, but due to the presence of the
watermark, limitations would be imposed. In this way, schemes which ought to limit
use of watermarked media may prove to be too unpopular for wide distribution.
1.4.4 Ambiguity Attacks:
Ambiguity attacks create the appearance that a watermark has been embedded in a
Work when in fact no such embedding has taken place. An adversary can use this attack to
claim ownership of a distributed Work. He or she may even be able to make an ownership
claim on the original Work. As such, ambiguity attacks can be considered a form of
unauthorized embedding. However, they are usually considered system attacks.
1.5 Importance of Digital Watermarking
The sudden increase in watermarking interest is most likely due to the increase in concern
over copyright protection of content. The Internet had become user friendly with the
introduction of Marc Andreessen’s Mosaic web browser in November 1993, and it quickly
became clear that people wanted to download pictures, music, and videos. The Internet is
an excellent distribution system for digital media because it is inexpensive, eliminates
warehousing and stock, and delivery is almost instantaneous. However, content owners
(especially large Hollywood studios and music labels) also see a high risk of piracy. This
risk of piracy is exacerbated by the proliferation of high-capacity digital recording devices.
7
When the only way the average customer could record a song or a movie was on analog
tape, pirated copies were usually of a lower quality than the originals, and the quality of
second-generation pirated copies (i.e., copies of a copy) was generally very poor. However,
with digital recording devices, songs and movies can be recorded with little, if any,
degradation in quality. Using these recording devices and using the Internet for distribution,
would-be pirates can easily record and distribute copyright-protected material without
appropriate compensation being paid to the actual copyright owners. Thus, content owners
are eagerly seeking technologies that promise to protect their rights. The first technology
content owners turn to is cryptography. Cryptography is probably the most common
method of protecting digital content. It is certainly one of the best developed as a science.
The content is encrypted prior to delivery, and a decryption key is provided only to those
who have purchased legitimate copies of the content. The encrypted file can then be made
available via the Internet, but would be useless to a pirate without an appropriate key.
Unfortunately, encryption cannot help the seller monitor how a legitimate customer handles
the content after decryption. A pirate can actually purchase the product, use the decryption
key to obtain an unprotected copy of the content, and then proceed to distribute illegal
copies. In other words, cryptography can protect content in transit, but once decrypted, the
content has no further protection. Thus, there is a strong need for an alternative or
complement to cryptography: a technology that can protect content even after it is
decrypted. Watermarking has the potential to fulfill this need because it places information
within the content where it is never removed during normal usage. Decryption,
reencryption, compression, digital-to-analog conversion, and file format changes—a
watermark can be designed to survive all of these processes. Watermarking has been
considered for many copy prevention and copyright protection applications. In copy
prevention, the watermark may be used to inform software or hardware devices that
copying should be restricted. In copyright protection applications, the watermark may be
used to identify the copyright holder and ensure proper payment of royalties. Although
copy prevention and copyright protection have been major driving forces behind research in
the watermarking field, there is a number of other applications for which watermarking has
been used or suggested. These include broadcast monitoring, transaction tracking,
authentication (with direct analogy to our Rs100 example), copy control, and device
control.
8
1.4 Applications
Digital watermarking may be used for a wide range of applications, such as:
Ownership assertion
Watermarks can be used for ownership assertion. To assert ownership of an
image, where generate a watermarking signal using a secret private key, and then
embed it into the original image then make the watermarked image publicly available.
For such a scheme to work, the watermark has to survive image processing operations
aimed at malicious removal. In addition, the watermark should be inserted in such a
manner that it cannot be forged.
Fingerprinting
In applications where multimedia content is electronically distributed over a
network, the content owner would like to discourage unauthorized duplication and
distribution by embedding a distinct watermark (or a fingerprint) in each copy of the
data. If, at a later point in time, unauthorized copies of the data are found, then the
origin of the copy can be determined by retrieving the fingerprint. In this application
the watermark needs to be invisible and must also be invulnerable to deliberate
attempts to forge, remove or invalidate. Furthermore, and unlike the ownership
assertion application, the watermark should be resistant to collusion.
Copy prevention or control.
Watermarks can also be used for copy prevention and control. For example, in a
closed system where the multimedia content needs special hardware for copying
and/or viewing, a digital watermark can be inserted indicating the number of copies
that are permitted. Every time a copy is made the watermark can be modified by the
hardware and after a point the hardware would not create further copies of the data.
An example of such a system is the Digital Versatile Disc (DVD). In fact, a copy
protection mechanism that includes digital watermarking at its core is currently being
considered for standardization and second generation DVD players may well include
the ability to read watermarks and act based on their presence or absence. Another
9
example is in digital cinema, where information can be embedded as a watermark in
every frame or a sequence of frames to help investigators locate the scene of the
piracy more quickly and point out weaknesses in security in the movie’s distribution.
The information could include data such as the name of the theater and the date and
time of the screening. The technology would be most useful in fighting a form of
piracy that’s surprisingly common, i.e., when someone uses a camcorder to record the
movie as it’s shown in a theater, then duplicates it onto optical disks or VHS tapes for
distribution.
Fraud and tamper detection
When multimedia content is used for legal purposes, medical applications, news
reporting, and commercial transactions, it is important to ensure that the content was
originated from a specific source and that it had not been changed, manipulated or
falsified. This can be achieved by embedding a watermark in the data. Subsequently,
when the photo is checked, the watermark is extracted using a unique key associated
with the source, and the integrity of the data is verified through the integrity of the
extracted watermark. The watermark can also include information from the original
image that can aid in undoing any modification and recovering the original. Clearly a
watermark used for authentication purposes should not affect the quality of an image
and should be resistant to forgeries. Robustness is not critical as removal of the
watermark renders the content inauthentic and hence of no value.
ID card security
Information in a passport or ID (e.g., passport number, person’s name, etc.) can
also be included in the person’s photo that appears on the ID. By extracting the
embedded information and comparing it to the written text, the ID card can be
verified. The inclusion of the watermark provides an additional level of security in
this application. For example, if the ID card is stolen and the picture is replaced by a
forged copy, the failure in extracting the watermark will invalidate the ID card. The
above represent a few example applications where digital watermarks could
potentially be of use. In addition there are many other applications in rights
management and protection like tracking use of content, binding content to specific
10
players, automatic billing for viewing content, broadcast monitoring etc. From the
variety of potential applications exemplified above it is clear that a digital
watermarking technique needs to satisfy a number of requirements. Since the specific
requirements vary with the application, watermarking techniques need to be designed
within the context of the entire system in which they are to be employed. Each
application imposes different requirements and would require different types of
invisible or visible watermarking schemes or a combination thereof. In the remaining
sections of this chapter we describe some general principles and techniques for
invisible watermarking. Our aim is to give the reader a better understanding of the
basic principles, inherent trade-offs, strengths, and weakness, of digital watermarking.
We will focus on image watermarking in our discussions and examples. However as
we mentioned earlier, the concepts involved are general in nature and can be applied
to other forms of content such as video and audio.
Broadcasting Monitoring
Commercials are aired by broadcasting channels and stations. For this
advertising firm purchase airtime from broadcasting channel. There are several
organizations and individuals interested in broadcasting monitoring, viz. advertiser,
who want to ensure if his commercial is broadcasted for all of his purchased airtime,
performers, who want to ensure that they get the royalties due to them from
advertising firm and owners of copyrighted works, who want to ensure that their
property is not illegally rebroadcasted by pirate stations. One solution to the problem
is human observers watching the broadcasting which is neither a feasible nor
practically possible solution. The other solution is to match the signal with the signals
present in databases to ascertain advertisers that messages are broadcasted. But
matching signals from databases is very complex process and require large amount of
time and money.
The last solution is using watermarking techniques. It has advantage of existing within
content itself, rather than exploiting a particular segment of the broadcast signal, and is
therefore completely compatible with the installed base of broadcast equipment, including
both digital and analog transmission.
11
1.5Purposes of Digital Watermarking
Watermarks added to digital content serve a variety of purposes. The following list
details six purposes of digital watermarking:
Ownership Assertion – to establish ownership of the content (i.e. image)
Fingerprinting – to avoid unauthorized duplication and distribution of publicly
available digital images content
Authentication and integrity verification – the authenticator is inseparably
bound to the content whereby the author has a unique key associated with the
content and can verify integrity of that content by extracting the watermark
Content labeling – bits embedded into the data that gives further information
about the content such as a graphic image with time and place information
Usage control – added to limit the number of copies created whereas the
watermarks are modified by the hardware and at some point would not create
any more copies (i.e. DVD)
Content protection – content stamped with a visible watermark that is very
difficult to remove so that it can be publicly and freely distributed.
1.6 Problem Statement Goals
The desire for the availability of information and quick distribution has been a major
factor in the development of new technology in the last decade. There is the increased
use of digital images across the Internet. It is commonly applied in Internet marketing
campaigns and electronic commerce web sites. Due to the growing usage of digital
images on the Internet, serious issues have emerged. Counterfeiting, forgery, fraud, and
pirating of this content are rising. Virtually anyone with a scanner, frame grabbers,
downloader allow them to incorporate copyrighted material into presentations, web
designs, and Internet marketing campaigns. Consequently, copyright abuse is rampant
among users, who are rarely caught. This copyright abuse is the motivating factor in
developing new encryption technologies, one such technology is digital watermarking.
The focus of this proposed project will detail digital watermarking for digital images
applications.
12
1.7 Issues
Several barriers prevent digital watermarking from being effective and widespread.
First, there is not a foolproof protection scheme while making the watermarks
imperceptible. Thus, absolute robustness is impossible.
Although, there is significant interest in this technology from OEMs and system
integrators, there is no infrastructure or protocols. Besides, the legal status of
watermarks used as evidence in lawsuits involving intellectual property has not been
tested.
Lastly, out of fear of piracy, many professional photographers, artists, and other
content creators still do not put their work out in digital format. Thus, the market for
this new encryption technology is not widespread.
Even though we have tried to make as much as possible to obtain robust digital
watermarking. Various problems have arisen during construction, but we did our
best working on it for the better performance.
1.8 Objectives
Watermarking system is implemented to achieve the various objectives as describe
below:
To indentify and protect copyright ownership.
To indicate that content cannot be illegally copied.
To track the usage of digital content.
To detect alternation and modification in document whenever any sort of
modification is made to the content.
1.9 Scope of project
This project is mainly appropriate for protecting intellectual property rights in all
kinds of organization and institution. By using this system, owner of any contents
13
can assert their ownership of the content and no one can use it without his/her
permission. This system also more appropriate for security point of view like
duplication of passport and currency can be avoided.
1.10 Limitations
Even we tried to include the all Objectives described above, still there exist some
limitations in our project which are as follows:
Our project have the limitation on size of image that is cannot be implemented
into large images.
1.11 Significance of Digital Watermarking System in Context of Nepal
In context of Nepal, Digital Watermarking System is usually use in the form of human
perceptibility and had covered wide area by its significance. The invisible watermarking
system is rarely found in context of Nepal.
Invisible Digital Watermarked are the new technology which could solve the problem
of enforcing the copyright of the content transmitted across shared network.
They allow the copyright holder to insert the hidden message within the image.
Suspicious content can be detected for the presence of author’s watermark.
The detection of watermark indicating the ownership can use as substantiated evidence
in a court of law.
Invisible watermarking is very difficult to remove. Thereby, this technology could
greatly strengthen the enforcement of copyright law.
14
CHAPTER 2
15
LITERATURE REVIEWS
The term "digital watermark" was first coined in 1992 by Andrew Tirkel and Charles
Osborne Actually, the term used by Tirkel and Osborne was originally used in Japan-- from
the Japanese-- "denshi sukashi" -- literally, an "electronic watermark”.[1]. There were many
studies done for watermarking images, sounds, text, etc [2][3]. on the other hand, a few
methods for watermarking computer programs have been propose [4][5][6][7].
Hirose et al. proposed a method for embedding C source program with user
identification number [6]. However, watermark in the program is undecodable if only
a part of the program was stolen. Moreover, if program thieves applied the same
method to the already watermarked program, original watermark will be easily erased.
Kitagawa also proposed a method for watermarking [7]. In this method, new variables
are appended to a program; and, watermark codeword (values) are set to those
variables. In decoding phase, program developers need to replace a specific class file
in the program with a special class file (called detection class file), and execute the
program. However, this method is not useful from the purpose of defending class files
from program thieves.
Collberg and Thomborson proposed a software watermarking technique in which a
dynamic watermark is stored in the execution state of a program. Their method is easy
to tamperproof against various program transformations. However, they watermark
complete applications, not individual modules. Hence, cropping a particularly
valuable class file from a Java application for illegal reuse is likely to be a successful
attack against this method.[4]
Davidson and Myhrvold proposed a method for generating and auditing a signature
for executable program modules[5]. The signature (identification number) of each
authorized copy is encoded within the order of instructions of the executable module.
However, this method is not suitable for watermarking a sentence, such as a copyright
notification, into each Java class file because encodable codeword in this method is
quite short.
16
CHAPTER 3
17
METHODOLOGY
4.2 Tools Used
Our main goal is to develop the software “Digital Watermarking”. For the development
of this software the tools we have been using are:
Hardware Requirement:
Personal computer
Software requirement:
Windows OS, Java development kit (JDK), Net beans IDE, Eclipse
4.3 Gantt chart
The quick view of working schedule of the project is depicted in figure below:
ID Task name 2012
Jan Feb Mar Apr May June
1 Preliminary investigation
2 Problem and requirement analysis
3 Decision analysis
4 Design
5 Coding and testing
6 Implementation
Complete task
Incomplete task
Figure 7: Gantt chart
18
4.1 Designs
4.1.1 Data Flow Diagram:
Data Flow Diagram is versatile diagramming tools that show how the execution of
whole program is carried out. This diagram shows what kind of data will be input to
and output from the system, where the data will come from and go to, and where the
data will be store. Thus the DFD are the preliminary step use to create an overview
of the system. There are four symbols that are considered in data flow diagram that
are data flow, data store, process and source/sink. There is different level of data
flow diagram according to the requirement of the system. Following are the DFD of
our project consisting of
1. Context Diagram.
2. Level 1 Diagram.
3. Level 2 Diagram.
19
Figure 4: Level-0 Context Diagram for Digital Watermarking System
20
Figure 5: Level-1 Diagram for Digital Watermarking System
21
Figure 6: Level-2 Diagram for Digital Watermarking System
22
5.1.3 Algorithm
1. Take the Original image.
2. Convert Original image into grey scale.
3. Byte conversion of grayscale image.
4. Write the certain text to be embedded as watermark in grayscale image.
5. Bit conversion of text watermark.
6. Byte conversion of text watermark.
7. Embedding watermark into grayscale image by using encoding technique as
discuss below.
8. Extracting watermark from grayscale image by using decoding technique as
discuss below.
Bit Conversion:
Source code:
byte byte3 = (byte)((i & 0xFF000000) >>> 24); byte byte2 = (byte)((i & 0x00FF0000) >>> 16);
byte byte1 = (byte)((i & 0x0000FF00) >>> 8);
byte byte0 = (byte)((i & 0x000000FF)); return(new byte[]{byte3,byte2,byte1,byte0});
}
private byte[] bit_conversion(int i)
{
return(new byte[]{0,0,0, (byte)(i & 0x000000FF));
}
23
private byte[] bit_conversion(int i)
{
Here , in this code byte holds a max value of 127, all shifts of 8 and higher, will remove all bits
and replace them with zeros, but to save each set of bits, to be the proper the implementation is
left as calculating each byte.
Here, hex FF = 11111111 in binary this is important, because, if there were more than 8 bits,
say 16 and let i = 287:
0000000100011111 = 287
0000000011111111 = 255 or 0x00FF
0000000000011111 = 31
The result has the last 8 bits matching , but the first 8 bits were all removed to 0s due to being
AND with 0s in all positions, but the last 8. The thing to take from this, is we can force a
value to 0, by ANDing with 0, and leave a value alone, by ANDing with 1.
Encoding:
Source code:
if(addition.length + offset > image.length)
{
throw new IllegalArgumentException("File not long enough!");
}
for(int i=0; i<addition.length; ++i)
{
int add = addition[i];
for(int bit=7; bit>=0; --bit, ++offset)
{
int b = (add >>> bit) & 1; image[offset] = (byte)((image[offset] & 0xFE) | b );
}
}
}
24
01private byte[] encode_text(byte[] image, byte[] addition, int offset)
02{
.
In a byte, the bits have a rank, the left most bit is the most significant and right most, least
significant. This gives us the key, if we need to change some data in this image, we want it to
be as unobtrusive as possible, or even invisible. Thus we want to apply our changes to the
least significant bit of some of the bytes. In this way we change each byte, a maximum of 1 in
value.
Here, following code accomplish the task in following ways:
for(int i=0; i<addition.length; ++i) – loops through each byte of the addition array
int add = addition[i]; – assigns add to be the current byte
for(int bit=7; bit>=0; --bit, ++offset) – loops through the 8 bits of the byte stored in add
int b = (add >>> bit) & 1; – b is assigned the value of the byte add shifted right bit positions
AND 1
The end result is a loop which systematically assigns b the next single bit value of the byte
add, either 0, or 1. This is best seen in a set of examples:
We will start with int b = (add >>> bit); Let
add = 50= 00110010
First loop through, bit = 7:
00110010 = 50
>>> 7
00000000 = 0
Next time, bit = 6:
00110010 = 50
>>> 6
00000000 = 0
Next time, bit = 5:
00110010 = 50
>>> 5
00000001 = 1
Next time, bit = 4:
25
00110010=50
>>> 4
00000011=3
Next time, bit = 3:
00110010=50
>>> 3
00000110 = 6
Next time, bit = 2:
00110010=50
>>> 2
00001101 = 13
Next time, bit = 1:
00110010=50
>>> 1
00011010 = 36
Now we perform Anding above results with 1:
First loop:
00000000 = 0
00000001 = 1
00000000 = 0 = b
Next:
00000000 = 0
00000001 = 1
00000001 = 0 = b
Next:
00000001 = 1
00000001 = 1
00000000 = 1 = b
26
Next:
00000011 = 3
00000001 = 1
00000001 = 1 = b
Next:
00000110 = 6
00000001 = 1
00000000 = 0 = b
Next:
00001101 = 13
00000001 = 1
00000001 = 1 = b
Next:
00011010 = 36
00000001 = 1
00000001 = 0 = b
Here “ b“ is assigned the value 0 or 1, based on the last bit of the shifted add byte. We
accomplish the same as above, by ANDing by 1, which clears all bits to 0, except the last
which is left as it was. This means that b’s value represents the bit at position bit in the for
loop.
image[offset] = (byte)((image[offset] & 0xFE) | b );
This line of code works in a similar way. 0xFE is hex, which represents 11111110 in binary.
By reasoning above, this will leave the first 7 bits as is, and clear the least significant bit to 0.
Then with the last bit 0, we OR it with b, which is either: 00000000 or 00000001. This will
set the last bit to match the value stored in b. As the OR operation with 0s will not change
any of the first 7 bits, and thus knowing the last bit is a 0, the value in this position of b, is
guaranteed to be placed into this position, whether it be 0 or 1
.
27
Decoding:
Source code:
private byte[] decode_text(byte[] image)
{
int length = 0;
int offset = 32; for(int i=0; i<32; ++i)
{
length = (length << 1) | (image[i] & 1);
}
byte[] result = new byte[length];
for(int b=0; b<result.length; ++b )
{
for(int i=0; i<8; ++i, ++offset)
{
result[b] = (byte)((result[b] << 1) | (image[offset] & 1)); }
}
return result;}
The above code accomplish the task as described below:
int offset = 32; – The length of the message is stored as a 4 byte number, or 32 bits, thus the message starts after 32 bytes of image.
for(int i=0; i<32; ++i) – Since the first 32 bytes contain 1 bit each of our length, we must loop all 32 bytes to retrieve the length.
length = (length << 1) | (image[i] & 1); – We shift the bits of length left by 1, then OR it with a result of the least significant bit of the image byte. (& 1) will clear all bits, except the last bit, which will be left as is. Thus as bits are added, they are moved along and placed into the newly least significant slot of length.
for(int b=0; b<result.length; ++b ) – Now that we have a length and have created a byte array to hold the bits, we loop through that many image bytes.
for(int i=0; i<8; ++i, ++offset) – Again we must loop through the 8 bits of a byte to be
28
collected.
result[b] = (byte)((result[b] << 1) | (image[offset] & 1)); – the resulting array of bytes is made up of the least significant bit of each sequential byte. This is retrieved in the same way as we retrieved the length, now that the loops are properly setup.
5.1.4 Flowchart
A flowchart is a type of diagram that represents an algorithm or process, showing
steps as boxes of various kinds, and there order by connecting these with arrows. This
diagrammatic representation can give a step by step solution to a given problem.
Process operation is represented in these boxes, and arrows connecting them represent
flow of control. Flowchart is used in analyzing, designing, documenting or managing
process or program in various fields.
29
Figure 12: Flow Chart for Digital Watermarking System
CHAPTER 5
EXPERIMENTS AND RESULTS
5.4 Results/Testing
Algorithm Testing Overview:
To find out whether the watermark image is embedded into the original image or not, it
is a point of testing to show in what ways watermark can be extracted from the original
image. It is important to extract for authentication.
30
We can apply the algorithm for extraction of embedded watermark that is the Inverse
Discrete Cosine Transform where original image and watermark image are
distinguishes.
31
CHAPTER 6
DICUSSIONS
Our project entitled “Digital Watermarking System” is specially carried out for the security
of original image from being pirated. Till this phase of our project we have completed
different phases of SDLC like preliminary investigation, research and understanding of
algorithm and soon. We have finished the coding phase to some extent and trying to
implement it but not fully completed. So this task in progress. Up to now, we succeed to get
image from the file and convert it into grayscale. Then we divided the image into m*m
blocks and each block of the individual block is placed to implement DCT. But embedding
watermark image into the original image is in progress.
In this project we have taken “Image” as the source document for embedding water mark
rather than videos and text because if we succeed in embedding watermark in image then
embedding watermark can be easily done in videos and text . so we choose image as source
document for embedding.
Hence, we are trying to do our best to complete the project on the given time period with
successful compilation and execution.
6.1
32
REFERENCES
[1] Z.Trikle G.A.Rankin,R.M Van Schyndel,W.J.HON.R.A.Mee,C.F.Osborne,”Electronics
WaterMark”DICTIA 93 Macguarie Univwrsity,p.666-673.
[2] Berghel,H,”Watermarking cyberspace,” Communications of the ACM, vol 40,no.11,1997,
pp.19-42.
[3] Craver,S. Merron, N.Yes, B & Young, Mom, ”Resolving rightful ownership with
invisible watermarking techniques: Limitations, attacks, and implications, “IEEE Journal
on selected Areas in communications, vol.16.4, 1998, pp.573.586.
[4] Collberg, C. and Thomberson C , ”Software Watermarking”, Model and dynamic
Embedding, ”The 26 ACM SIGP LAW .SIGACT Aymposium on Principles of
Programming Languages (POPL 199). San Antorio, Texas, Jan 1999.
[5] David,R.L and Myhryold,”Method and system for generating and auditing a signature for
a computer program,”US Patent,no.5559884,Assignee:Microsoft Corporation, Sep 1996.
[6] Hirose, N.,Okanoto,E.Mamboo,M,” a Proposal for Software protection,”in Proc.1998
Symposium on Cryptography & Information Security, SCIS ’98. 9. 2.C, Jan 1998
(in Japenese)
[7] Kitagawa, T.”Digital Watermarking method for Java Programs,” Master’s Thesis,
Depatrment of Information Procssing, Graduate School of Information Science
Nara Institue of Science & Technology, NAIST – ISMJ 9751041, Feb.1999(in Japenese).
33
Conclusion:
Digital watermarking technology is an emerging field in Computer science, Cryptography, Signal processing and Communications. The watermarking research is more exciting as it needs collective concepts from the entire field along with Human psycho-visual analysis, Multimedia and Computer graphics. The watermark may be of visible or invisible type and each has got its own applications. We have developed the invisible text watermark into the image as a part of the project work.
The fast development of the Internet in recent years has made it possible to easily create, copy, transmit and distribute digital data. Consequently this has led to a strong demand for reliable and secure copyright protection techniques for digital data.
So, our project has been stulk towards the better performance for preventing the owners from the copyright and identifies the image of owner’s license information and to track illegal copies.
We have all achieved something during the course of the development of Digital Watermarking System and given a best to complete this system.
Suggestion:
We have successfully completed project entitled ”Digital Watermark System” even though, we faced different problems during development. So we would like to suggest the new comers those who are interested in doing new project that is completely new is existing environment to research deeply and completely for receiving adequate knowledge regarding the selected topic. It is also important to finalize the programming language for doing the project which is well known and should have to initialize the project as soon as possible because proper management of time is most important to accomplish the project successfully.
Even though we have faced may problems regarding the detail concepts , time management, programming language during the development period but we feel very much honored to work in such a challenging and the happening topic which is becoming important topic in the field of security and authorization.
We sincerely recommend the upcoming batches to work in this type of interesting and challenging projects. It would make them familiar with the modern technology and to cope up with most rising, interesting and competitive world of computer science.
34