visual cryptography

120
1.INTRODUCTION 1.1 OVERVIEW Region Incrementing Visual Cryptography Scheme (RIVCS) is a method of encrypting a secret image into shares such that stacking a sufficient number of shares reveals the secret image. Shares are usually presented in transparencies. Each participant holds a transparency. Most of the previous research work on EVC’s focuses on two parameters: large pixel expansion and contrast. In this paper, we studied the cheating problem in VC and Region Incrementing Visual Cryptography Scheme (RIVCS) can achieve the minimum pixel expansion and the maximal contrasts. We considered the attacks of malicious adversaries who may deviate from the scheme in any way. We presented three cheating methods and applied them on attacking existent VC or Region Incrementing Visual Cryptography Scheme (RIVCS) schemes. We improved one cheat-preventing scheme. This is a visual cryptographic system which is implemented for database security. This consists of two

Upload: chokkalingam-balasubramanian

Post on 13-Jan-2016

121 views

Category:

Documents


2 download

DESCRIPTION

Information security by using visual cryptography based on Region Incrementing Visual Cryptography Scheme.

TRANSCRIPT

Page 1: Visual Cryptography

1. INTRODUCTION

1.1 OVERVIEW

Region Incrementing Visual Cryptography Scheme (RIVCS) is a method

of encrypting a secret image into shares such that stacking a sufficient number of

shares reveals the secret image. Shares are usually presented in transparencies.

Each participant holds a transparency. Most of the previous research work on

EVC’s focuses on two parameters: large pixel expansion and contrast. In this paper,

we studied the cheating problem in VC and Region Incrementing Visual

Cryptography Scheme (RIVCS) can achieve the minimum pixel expansion and the

maximal contrasts. We considered the attacks of malicious adversaries who may

deviate from the scheme in any way. We presented three cheating methods and

applied them on attacking existent VC or Region Incrementing Visual

Cryptography Scheme (RIVCS) schemes. We improved one cheat-preventing

scheme. This is a visual cryptographic system which is implemented for database

security. This consists of two phases that explains how the data in database servers

are protected from tampering by illegal users, using the concept of visual

cryptography.

We develop a novel and efficient construction for RIVCS using

linear programming in this paper. The proposed integer linear program aims at the

minimization of the pixel expansion under the constraints for being a RIVCS.

Experimental results demonstrate the feasibility, applicability, and flexibility of our

construction. The pixel expansions and contrasts derived from our scheme are also

better than the previous results.

Page 2: Visual Cryptography

1.2 PROBLEM DESCRIPTION

Data security has been a challenging task in visual cryptography system and

database systems. The existing visual cryptography schemes that are used for data

hiding have a security hole in the encrypted Share file. If the share images are

hacked, the hacker can tamper the data that is hidden and hence can disturb the

entire technique. The overhead of the conversion is near optimal in both contrast

degression and pixel expansion. In the existing, there is no optimized secured way

to access the secret hidden data and the data that are stored in databases.

1.3 NETWORK MODEL

LAN Network Model

A local area networksupplies networking capability to a group of computers

in close proximity to each other such as in an office building, a school, or a home.

A LAN is useful for sharing resources like files, printers, games or other

applications. A LAN in turn often connects to other LANs, and to the Internet or

other WAN. Most local area networks are built with relatively inexpensive

hardware such as Ethernet cables, network adapters, and hubs. Wireless LAN and

other more advanced LAN hardware options also exist.

1.4 ADAPTIVE STRATEGY

Adaptive Strategy is a small consulting firm, specializing in business process

automation within small and mid-size construction companies. We realize that

Page 3: Visual Cryptography

businesses in the construction industry face similar problems, but their approach to

solving those problems may be different. In many cases the unique solutions to

common problems define the company itself. By understanding every client’s

individual needs, we are able to tailor a solution that best fits your established

culture and practices.

2. LITERATURE SURVEY

1. S. J. Shyu, “Efficient visual secret sharing scheme for color images,” Pattern Recognit., vol. 39, no. 5, pp. 866–880, May 2006.

A k-out-of-n visual secret sharing scheme (VSSS) resolves the visual variant

of the k-out-of-n secret sharing problem where only k or more out

of n participants can reveal the secret by human visual system without any

cryptographic computation. The best pixel expansion of the general k-out-of-

n VSSS for c-colored images was c×m by Yang and Laih [New colored

visual secret sharing schemes, Des Codes Cryptogr. 24 (2000) 325–335]

where m is the pixel expansion of an existing binary k-out-of-n VSSS.

Regarding the c-colored n-out-of-n scheme, the best pixel expansion is (c-

1)2n-1-c+2 and c(c-1)2n-2-c when n is odd and even, respectively, by Blundo

et al. [Improved schemes for visual cryptography, Des Codes Cryptogr. 24

(2001) 255–278]. In this paper, we propose a new c-colored k-out-of-n VSSS

by using a pixel expansion of   that is more efficient than ever.

Page 4: Visual Cryptography

2. W. P. Fang and J. C. Lin, “Progressive viewing and sharing of sensitive images,” Pattern Recognit. Imag. Anal., vol. 16, no. 4, pp. 632–636,2006.

The paper proposes a progressive viewing method useful in sharing a sensitive image. As in visual cryptography, this method characterizes its ability to recover the image by stacking transparencies without any computation. However, the method balances the sensitivity and the daily-processing convenience of the image.

3. S. J. Shyu, S.-Y. Huang, Y.-K. Lee, R.-Z. Wang, and K. Chen, “Sharing multiple secrets in visual cryptography,” Pattern Recognit., vol. 40, no. 12, pp. 3633–3651, Dec. 2007.

The secret sharing schemes in conventional visual cryptography are characterized by encoding one shared secret into a set of random transparencies which reveal the secret to the human visual system when they are superimposed. In this paper, we propose a visual secret sharing scheme that encodes a set of x⩾ 2 secrets into two circle shares such that none of any single share leaks the secrets and the x secrets can be obtained one by one by stacking the first share and the rotated second shares with x different rotation angles. This is the first true result that discusses the sharing ability in visual cryptography up to any general number of multiple secrets in two circle shares.

4. R.-Z. Wang, “Region incrementing visual cryptography,” IEEE Signal Process. Lett., vol. 16, no. 8, pp. 659–662, Aug. 2009.

This letter presents a novel visual cryptography scheme, called region incrementing visual cryptography (RIVC), for sharing visual secrets with multiple secrecy levels in a single image. In the proposed n-level RIVC scheme, the content of an image S is designated to multiple regions associated with n secret levels, and encoded to n+1 shares with the following features: (a) each share cannot obtain any of the secrets in S, (b) any t (2lestlesn+1) shares can be used to reveal t-1 levels of secrets, (c) the number and locations of not-yet-revealed secrets are unknown to users, (d) all secrets in S can be disclosed when all of the n+1 shares are available, and (e) the secrets are recognized by visually inspecting correctly stacked shares without computation. The basis matrices for constructing the proposed n-level RIVC with

Page 5: Visual Cryptography

small values of n=2, 3, 4 are introduced, and the results from two experiments are presented.

5. T. Katoh and H. Imai, “An extended construction method for visual secret sharing schemes,” Electron. Commun. Japan Part III: Fundam. Electron. Sci., vol. 81, no. 7, pp. 55–63, Jul. 1998.

A visual secret sharing scheme [1] permits a secret to be shared among participants using transparencies. In this paper, we consider an extended scheme for visual secret sharing. We propose an improved method of constructing the visual secret sharing scheme that can conceal some images in a series of transparencies, in such a way that different images are seen as the number of stacking transparencies increases.Furthermore, we describe applications of the visual secret sharing scheme to copy machines and human identification schemes. In the identification scheme, users recognize messages from an identification terminal by stacking their transparencies on the display. A great advantage of this scheme is that users can validate the authenticity of the terminal without onsulting a computer or calculator. © 1998 Scripta Technica. Electron Comm Jpn Pt 3, 81(7): 55–63, 1998

2.1 GOAL OF THE PROJECT

This project concentrates on the task to provide security features for database

system in terms of visual cryptography schemes.In proposed system, to prevent the

accessing of data in database, the security is enhanced in three phases using visual

cryptography. In this proposed work, to prevent the accessing of data in database

the administrator enhances the security using visual cryptography. We use a

generic method that converts a VCS to another EVC’s that has the property of

cheating prevention.

Page 6: Visual Cryptography

We show two methods to generate the covering shares, and proved the optimality

on the black ratio of the threshold covering subsets. We also proposed a method to

improve the visual quality of the share images.

2.2 ANALYSIS OF EXISTING SYSTEMS

Image degression will occur due to pixel expansion and Contrast level. Hacker may easily verify the irregular color appearance in the stego image.

The existing visual cryptography schemes that are used for data hiding have

a security hole in the encrypted Share file.If the share images are hacked, the

hacker can tamper the data that is hidden and hence can disturb the entire

technique.In the existing, there is no optimized secured way to access the secret

hidden data and the data that are stored in databases

2.3 IDEA ON PROPOSED SYSTEM

This project concentrates on the task to provide security features for database

system in terms of visual cryptography schemes. In proposed system, to prevent the

accessing of data in database, the security is enhanced in three phases using visual

cryptography.

First, an image is split into n encrypted shares using algorithm by the fact

that a pixel can be split into sub pixels. Second, in order to avoid hacking of shared

image, we employ password protection for each share using Extended Embedded

algorithm and simple Arithmetic Encoding compression technique which

compresses the pass code. Third, we perform rearranging of pixels of shared image

by overlaying process to obtain the access to the protected database.

Page 7: Visual Cryptography

2.4 IMPLEMENTATION PLAN

We also proposed a method to improve the visual quality of the share

images. Implementation is the stage of the project when the theoretical design is

turned out into a working system. Thus, it can be considered to be the most critical

stage in achieving a successful new system and in giving the user, confidence that

the new system will work and be effective.

2.5 WORK RELATED TO PROJECT

The shares of the proposed scheme are meaningful images, and the stacking

of a qualified subset of shares will recover the secret image visually. We show two

methods to generate the covering shares, and proved the optimality on the black

ratio of the threshold covering subsets.

2.6 FUTURE WORK

Furthermore, our construction is flexible in the sense that there exist two trade-

offs between the share pixel expansion and the visual quality of the shares and

between the secret image pixel expansion and the visual quality of the shares.

3. SYSTEM ANALYSIS

3.1 PROBLEM ANALYSIS

The existing visual cryptography schemes that are used for data hiding have

a security hole in the encrypted Share file.If the share images are hacked, the

hacker can tamper the data that is hidden and hence can disturb the entire

technique.In the existing, there is no optimized secured way to access the secret

hidden data and the data that are stored in databases.

Page 8: Visual Cryptography

3.2 EXISTING SYSTEM

1) Data security has been a challenging task in visual cryptography system and

database systems.

2) The existing visual cryptography schemes that are used for data hiding have

a security hole in the encrypted Share file.

3) If the share images are hacked, the hacker can tamper the data that is

hidden and hence can disturb the entire technique.

4) In the existing, there is no optimized secured way to access the secret

hidden data and the data that are stored in databases.

3.3 PROPOSED SYSTEM

1) The proposed integer linear program aims at the minimization of the pixel

expansion under the constraints for being a RIVCS.

2) Experimental results demonstrate the feasibility, applicability, and flexibility

of our construction. The pixel expansions and contrasts derived from our

scheme are also better than the previous results.

3) In proposed system, to prevent the accessing of data in database, the

security is enhanced in three phases using visual cryptography.

4) First, an image is split into “n” encrypted shares using algorithm by the fact

that a pixel can be split into sub pixels.

5) Second, in order to avoid hacking of shared image, we employ password

protection for each share using Extended Embedded algorithm and simple

Arithmetic Encoding compression technique which compresses the pass

code.

6) Third, we perform rearranging of pixels of shared image by overlaying

process to obtain the access to the protected database.

Page 9: Visual Cryptography

SYSTEM STUDY

2.1 FEASIBILITY STUDY

The feasibility of the project is analyzed in this phase and business

proposal is put forth with a very general plan for the project and some cost

estimates. During system analysis the feasibility study of the proposed system is

to be carried out. This is to ensure that the proposed system is not a burden to

the company. For feasibility analysis, some understanding of the major

requirements for the system is essential.Three key considerations involved in

the feasibility analysis are

ECONOMICAL FEASIBILITY

TECHNICAL FEASIBILITY

SOCIAL FEASIBILITY

ECONOMICAL FEASIBILITY

Page 10: Visual Cryptography

This study is carried out to check the economic impact that the system will

have on the organization. The amount of fund that the company can pour into the

research and development of the system is limited. The expenditures must be

justified. Thus the developed system as well within the budget and this was

achieved because most of the technologies used are freely available. Only the

customized products had to be purchased.

TECHNICAL FEASIBILITY

This study is carried out to check the technical feasibility, that is, the

technical requirements of the system. Any system developed must not have a high

demand on the available technical resources. This will lead to high demands on the

available technical resources. This will lead to high demands being placed on the

client. The developed system must have a modest requirement, as only minimal or

null changes are required for implementing this system.

SOCIAL FEASIBILITY

The aspect of study is to check the level of acceptance of the system by

the user. This includes the process of training the user to use the system efficiently.

Page 11: Visual Cryptography

The user must not feel threatened by the system, instead must accept it as a

necessity. The level of acceptance by the users solely depends on the methods that

are employed to educate the user about the system and to make him familiar with it.

His level of confidence must be raised so that he is also able to make some

constructive criticism, which is welcomed, as he is the final user of the system.

6. SYSTEM TESTING

The purpose of testing is to discover errors. Testing is the process of trying

to discover every conceivable fault or weakness in a work product. It provides a

way to check the functionality of components, sub assemblies, assemblies and/or a

finished product It is the process of exercising software with the intent of ensuring

that the

Software system meets its requirements and user expectations and does not fail in

an unacceptable manner. There are various types of test. Each test type addresses a

specific testing requirement.

4. REQUIREMENT ANALYSIS

4.1 SYSTEM REQUIREMENT

4.1.1 HARDWARE REQUIREMENTS

Page 12: Visual Cryptography

Processor : Pentium IV Processor

RAM : 512 MB

Hard Disk : 10GB

Monitor : 14” VGA COLOR MONITOR

4.1.2 SOFTWARE REQUIREMENTS

Platform : JAVA (JDK 1.5)

Front End : JAVA Swing

IDE : Net Beans 6.9

Operating System : Microsoft Windows XP

Software Specifications

Java Technology

Page 13: Visual Cryptography

Initially the language was called as “oak” but it was renamed as “Java” in 1995.

The primary motivation of this language was the need for a platform-independent

(i.e., architecture neutral) language that could be used to create software to be

embedded in various consumer electronic devices.

Java is a programmer’s language.

Java is cohesive and consistent.

Except for those constraints imposed by the Internet environment, Java

gives the programmer, full control.

Finally, Java is to Internet programming where C was to system

programming.

Importance of Java to the Internet

Java has had a profound effect on the Internet. This is because; Java expands the

Universe of objects that can move about freely in Cyberspace. In a network, two

categories of objects are transmitted between the Server and the Personal computer.

They are: Passive information and Dynamic active programs. The Dynamic, Self-

executing programs cause serious problems in the areas of Security and probability.

But, Java addresses those concerns and by doing so, has opened the door to an

exciting new form of program called the Applet.

Java can be used to create two types of programs

Applications and Applets : An application is a program that runs on our

Computer under the operating system of that computer. It is more or less like one

creating using C or C++. Java’s ability to create Applets makes it important. An

Applet is an application designed to be transmitted over the Internet and executed

by a Java –compatible web browser. An applet is actually a tiny Java program,

Page 14: Visual Cryptography

dynamically downloaded across the network, just like an image. But the difference

is, it is an intelligent program, not just a media file. It can react to the user input

and dynamically change.

Features of Java Security

Every time you that you download a “normal” program, you are risking a viral

infection. Prior to Java, most users did not download executable programs

frequently, and those who did scan them for viruses prior to execution. Most users

still worried about the possibility of infecting their systems with a virus. In

addition, another type of malicious program exists that must be guarded against.

This type of program can gather private information, such as credit card numbers,

bank account balances, and passwords. Java answers both these concerns by

providing a “firewall” between a network application and your computer.

When you use a Java-compatible Web browser, you can safely download Java

applets without fear of virus infection or malicious intent.

Portability

For programs to be dynamically downloaded to all the various types of platforms

connected to the Internet, some means of generating portable executable code is

needed .As you will see, the same mechanism that helps ensure security also helps

create portability. Indeed, Java’s solution to these two problems is both elegant and

efficient.

The Byte code

The key that allows the Java to solve the security and portability problems is that

the output of Java compiler is Byte code. Byte code is a highly optimized set of

instructions designed to be executed by the Java run-time system, which is called

Page 15: Visual Cryptography

the Java Virtual Machine (JVM). That is, in its standard form, the JVM is an

interpreter for byte code.

Translating a Java program into byte code helps makes it much easier to run a

program in a wide variety of environments. The reason is, once the run-time

package exists for a given system, any Java program can run on it.

Although Java was designed for interpretation, there is technically nothing about

Java that prevents on-the-fly compilation of byte code into native code. Sun has

just completed its Just In Time (JIT) compiler for byte code. When the JIT

compiler is a part of JVM, it compiles byte code into executable code in real time,

on a piece-by-piece, demand basis. It is not possible to compile an entire Java

program into executable code all at once, because Java performs various run-time

checks that can be done only at run time. The JIT compiles code, as it is needed,

during execution.

Java Virtual Machine (JVM)

Beyond the language, there is the Java virtual machine. The Java virtual machine is

an important element of the Java technology. The virtual machine can be embedded

within a web browser or an operating system. Once a piece of Java code is loaded

onto a machine, it is verified. As part of the loading process, a class loader is

invoked and does byte code verification makes sure that the code that’s has been

generated by the compiler will not corrupt the machine that it’s loaded on. Byte

code verification takes place at the end of the compilation process to make sure that

is all accurate and correct. So byte code verification is integral to the compiling and

executing of Java code.

Overall Description

Page 16: Visual Cryptography

Picture showing the development process of JAVA Program

Java programming uses to produce byte codes and executes them. The first box

indicates that the Java source code is located in a. Java file that is processed with a

Java compiler called javac. The Java compiler produces a file called a. class file,

which contains the byte code. The .Class file is then loaded across the network or

loaded locally on your machine into the execution environment is the Java virtual

machine, which interprets and executes the byte code.

Java Architecture

Java architecture provides a portable, robust, high performing environment for

development. Java provides portability by compiling the byte codes for the Java

Virtual Machine, which is then interpreted on each platform by the run-time

environment. Java is a dynamic system, able to load code when needed from a

machine in the same room or across the planet.

Compilation of code

When you compile the code, the Java compiler creates machine code (called byte

code) for a hypothetical machine called Java Virtual Machine (JVM). The JVM is

supposed to execute the byte code. The JVM is created for overcoming the issue of

portability. The code is written and compiled for one machine and interpreted on all

machines. This machine is called Java Virtual Machine.

Java

Source

Java byte codeJavaVM

Java .Class

Page 17: Visual Cryptography

Compiling and interpreting Java Source Code

During run-time the Java interpreter tricks the byte code file into thinking that it is

running on a Java Virtual Machine. In reality this could be a Intel Pentium

Windows 95 or SunSARC station running Solaris or Apple Macintosh running

system and all could receive code from any computer through Internet and run the

Applets.

Simple

Java was designed to be easy for the Professional programmer to learn and to use

effectively. If you are an experienced C++ programmer, learning Java will be even

easier. Because Java inherits the C/C++ syntax and many of the object oriented

features of C++. Most of the confusing concepts from C++ are either left out of

Java or implemented in a cleaner, more approachable manner. In Java there are a

small number of clearly defined ways to accomplish a given task.

Source

Code

………..

………..

………..

…………

PC Compiler

Macintosh

Compiler

SPARC

Compiler

Java

Byte code

(Platform

Independent)

Java

Interpreter

(PC)

Java

Interpreter

(Macintosh)

Java

Interpreter

(Spare)

Page 18: Visual Cryptography

Object-Oriented

Java was not designed to be source-code compatible with any other language. This

allowed the Java team the freedom to design with a blank slate. One outcome of

this was a clean usable, pragmatic approach to objects. The object model in Java is

simple and easy to extend, while simple types, such as integers, are kept as high-

performance non-objects.

Robust

The multi-platform environment of the Web places extraordinary demands on a

program, because the program must execute reliably in a variety of systems. The

ability to create robust programs was given a high priority in the design of Java.

Java is strictly typed language; it checks your code at compile time and run time.

Java virtually eliminates the problems of memory management and de-allocation,

which is completely automatic. In a well-written Java program, all run time errors

can –and should –be managed by your program.

Page 19: Visual Cryptography

Java Collections

A collection — sometimes called a container — is simply an object that groups

multiple elements into a single unit. Collections are used to store, retrieve,

manipulate, and communicate aggregate data. Typically, they represent data items

that form a natural group, such as a poker hand (a collection of cards), a mail folder

(a collection of letters), or a telephone directory (a mapping of names to phone

numbers).

If you've used the Java programming language — or just about any other

programming language — you're already familiar with collections. Collection

implementations in earlier (pre-1.2) versions of the Java platform included Vector,

Hashtable, and array. However, those earlier versions did not contain a collections

framework.

A collections framework is a unified architecture for representing and manipulating

collections. All collections frameworks contain the following:

Interfaces: These are abstract data types that represent collections. Interfaces allow

collections to be manipulated independently of the details of their representation. In

object-oriented languages, interfaces generally form a hierarchy.

Implementations: These are the concrete implementations of the collection

interfaces. In essence, they are reusable data structures.

Algorithms: These are the methods that perform useful computations, such as

searching and sorting, on objects that implement collection interfaces. The

algorithms are said to be polymorphic: that is, the same method can be used on

Page 20: Visual Cryptography

many different implementations of the appropriate collection interface. In essence,

algorithms are reusable functionality.

Page 21: Visual Cryptography

Benefits of the Java Collections Framework

The Java Collections Framework provides the following benefits:

Reduces programming effort: By providing useful data structures and algorithms,

the Collections Framework frees you to concentrate on the important parts of your

program rather than on the low-level "plumbing" required to make it work. By

facilitating interoperability among unrelated APIs, the Java Collections Framework

frees you from writing adapter objects or conversion code to connect APIs.

Increases program speed and quality: This Collections Framework provides high

performance, high-quality implementations of useful data structures and

algorithms. The various implementations of each interface are interchangeable, so

programs can be easily tuned by switching collection implementations. Because

you're freed from the drudgery of writing your own data structures, you'll have

more time to devote to improving programs' quality and performance.

Allows interoperability among unrelated APIs: The collection interfaces are the

vernacular by which APIs pass collections back and forth. If my network

administration API furnishes a collection of node names and if your GUI toolkit

expects a collection of column headings, our APIs will interoperate seamlessly,

even though they were written independently.

Reduces effort to learn and to use new APIs: Many APIs naturally take collections

on input and furnish them as output. In the past, each such API had a small sub-API

devoted to manipulating its collections. There was little consistency among these

ad hoc collections sub-APIs, so you had to learn each one from scratch, and it was

easy to make mistakes when using them. With the advent of standard collection

interfaces, the problem went away.

Page 22: Visual Cryptography

Reduces effort to design new APIs: This is the flip side of the previous advantage.

Designers and implementers don't have to reinvent the wheel each time they create

an API that relies on collections; instead, they can use standard collection

interfaces.

Fosters software reuse: New data structures that conform to the standard

collection interfaces are by nature reusable. The same goes for new algorithms that

operate on objects that implement these interfaces.

The core collection interfaces:

A Set is a special kind of Collection, a SortedSet is a special kind of Set, and so

forth. Note also that the hierarchy consists of two distinct trees — a Map is not a

true Collection.

Note that all the core collection interfaces are generic. For example, this is the

declaration of the Collection interface.

public interface Collection<E>...

The following list describes the core collection interfaces:

Collection — the root of the collection hierarchy. A collection represents a group

of objects known as its elements. The Collection interface is the least common

Page 23: Visual Cryptography

denominator that all collections implement and is used to pass collections around

and to manipulate them when maximum generality is desired. Some types of

collections allow duplicate elements, and others do not.

Some are ordered and others are unordered. The Java platform doesn't provide any

direct implementations of this interface but provides implementations of more

specific sub interfaces, such as Set and List. Also see The Collection Interface

section.

Set — a collection that cannot contain duplicate elements. This interface models

the mathematical set abstraction and is used to represent sets, such as the cards

comprising a poker hand, the courses making up a student's schedule, or the

processes running on a machine. See also The Set Interface section.

List — an ordered collection (sometimes called a sequence). Lists can contain

duplicate elements. The user of a List generally has precise control over where in

the list each element is inserted and can access elements by their integer index

(position). If you've used Vector, you're familiar with the general flavor of List.

Also see The List Interface section.

Queue — a collection used to hold multiple elements prior to processing. Besides

basic Collection operations, a Queue provides additional insertion, extraction, and

inspection operations. Queues typically, but do not necessarily, order elements in a

FIFO (first-in, first-out) manner. Among the exceptions are priority queues, which

order elements according to a supplied comparator or the elements' natural,

ordering? Whatever the ordering used, the head of the queue is the element that

would be removed by a call to remove or poll. In a FIFO queue, all new elements

are inserted at the tail of the queue. Other kinds of queues may use different

Page 24: Visual Cryptography

placement rules. Every Queue implementation must specify its ordering properties.

Also see The Queue Interface section.

A Queue is a collection for holding elements prior to processing. Besides basic

Collection operations, queues provide additional insertion, removal, and inspection

operations.

Each Queue method exists in two forms: (1) one throws an exception if the

operation fails, and (2) the other returns a special value if the operation fails (either

null or false, depending on the operation). The regular structure of the interface is

illustrated in the following table.

Map — an object that maps keys to values. A Map cannot contain duplicate keys;

each key can map to at most one value. If you've used Hashtable, you're already

familiar with the basics of Map. Also see The Map Interface section. The last two

core collection interfaces are merely sorted versions of Set and

Map:

SortedSet — a Set that maintains its elements in ascending order. Several

additional operations are provided to take advantage of the ordering. Sorted sets are

used for naturally ordered sets, such as word lists and membership rolls. Also see

The SortedSet Interface section.

SortedMap — a Map that maintains its mappings in ascending key order. This is

the Map analog of SortedSet. Sorted maps are used for naturally ordered

collections of key/value pairs, such as dictionaries and telephone directories. Also

see The SortedMap Interface section.

Page 25: Visual Cryptography

Iterators: An Iterator is an object that enables you to traverse through a collection

and to remove elements from the collection selectively, if desired. You get an

Iterator for a collection by calling its iterator method. The following is the Iterator

interface.

public interface Iterator<E> {

boolean hasNext();

E next();

void remove(); //optional

}

The hasNext method returns true if the iteration has more elements, and the next

method returns the next element in the iteration. The remove method removes the

last element that was returned by next from the underlying Collection. The remove

method may be called only once per call to next and throws an exception if this rule

is violated.

Bulk operations perform an operation on an entire Collection. You could

implement these shorthand operations using the basic operations, though in most

cases such implementations would be less efficient. The following are the bulk

operations:

containsAll — returns true if the target Collection contains all of the elements in

the specified Collection.

addAll — adds all of the elements in the specified Collection to the target

Collection.

Page 26: Visual Cryptography

removeAll — removes from the target Collection all of its elements that are also

contained in the specified Collection.

retainAll — removes from the target Collection all its elements that are not also

contained in the specified Collection. That is, it retains only those elements in the

target Collection that are also contained in the specified Collection.

clear — removes all elements from the Collection.

The addAll, removeAll, and retainAll methods all return true if the target

Collection was modified in the process of executing the operation.

Java Swing

Swing Components enable the user to build functionally rich user interfaces. The

Swing graphical user interface components were introduced with the Java

Foundation Classes (JFC) as a downloadable extension to the Java 1.1 Platform

then became a standard extension in the Java 2 Platform. Swing provides a more

complete set of GUI components than the Abstract Windowing Toolkit (AWT),

including advanced features such as a pluggable look and feel, lightweight

component rendering and drag-and-drop capabilities.

Swing Text Components and HTML Rendering

Many applications present text to the user for viewing and editing. This text may

consist of plain, unformatted characters, or it may consist of richly styled characters

Page 27: Visual Cryptography

that use multiple fonts and extensive formatting. Swing provides three basic types

of text components for presenting and editing text. Class JTextComponent is the

base class for all Swing text components, including JTextField, JTextArea and

JEditorPane. JTextField is a single-line text component suitable for obtaining

simple user input or displaying information such as form field values, calculation

results and so on. JpasswordField is a subclass of JTextField suitable for obtaining

user passwords. These components do not perform any special text styling. Rather,

they present all text in a single font and color. JTextArea, like JTextField and

JPasswordField, also does not style its text. However, JTextArea does provide a

larger visible area and supports larger plain-text documents.

JEditorPane provides enhanced text-rendering capabilities. JEditorPane supports

styled documents that include formatting, font and color information. JEditor- Pane

is capable of rendering HTML documents as well as Rich Text Format (RTF)

documents. We use class JEditorPane to render HTML pages for a simple Web

browser application. JTextPane is a JEditorPane subclass that renders only styled

documents, and not plain text. JTextPane provides developers with fine-grained

control over the style of each character and paragraph in the rendered document.

Swing Toolbars

Toolbars are GUI containers typically located below an application’s menus.

Toolbars contain buttons and other GUI components for commonly used features,

such as cut, copy and paste, or navigation buttons for a Web browser. Figure 2.2

shows toolbars in Internet Explorer and Mozilla. Class javax.swing.JToolBar

enables developers to add toolbars to Swing user interfaces. JToolBar also enables

users to modify the appearance of the JToolBar in a running application. For

Page 28: Visual Cryptography

example, the user can drag the JToolBar from the top of a window and "dock" the

JToolBar on the side or bottom of the window.

JSplitPane and JTabbedPane

JSplitPane and JTabbedPane are container components that enable developers to

present large amounts of information in a small screen area. JSplitPane

accomplishes this by dividing two components with a divider users can reposition

to expand and contract the visible areas of the JSplitPane’s child components (Fig.

2.7). JTabbedPane uses a filefolder- style tab interface to arrange many

components through which the user can browse.

Java Swing provides classes JDesktopPane and JInternalFrame for building

multiple-document interfaces. These class names reinforce the idea that each

document is a separate window (JInternalFrame) inside the application’s desktop

(JDesktop-Pane), just as other applications are separate windows (e.g., JFrames) on

the operating system’s desktop. JInternalFrames behave much like JFrames. Users

can maximize, iconify, resize, open and close JInternalFrames. JInternalFrames

have title bars with buttons for iconifying, maximizing and closing. Users also can

move JInternal-Frames within the JDesktopPane.

Drag and drop is a common way to manipulate data in a GUI. Most GUIs emulate real world desktops, with icons that represent the objects on a virtual desk. Drag and drop enables users to move items around the desktop and to move and copy data among applications using mouse gestures. A gesture is a mouse movement that corresponds to a drag and-drop operation, such as dragging a file from one folder and dropping the file into another folder. Two Java APIs enable drag-and-

Page 29: Visual Cryptography

drop data transfer between applications. The data transfer API—package java.awt.datatransfer—enables copying and moving data within a single application or among multiple applications. The drag-and-drop API enables Java applications to recognize drag-and-drop gestures and to respond to drag-and drop operations. A drag-and-drop operation uses the data transfer API to transfer data from the drag source to the drop target. For example, a user could begin a drag gesture in a filemanager application (the drag source) to drag a file from a folder and drop the file on a Java application (the drop target). The Java application would use the drag-and-drop API to recognize that a drag-and-drop operation occurred and would use the data transfer API to retrieve the data transferred through the drag-and-drop operation.

i) Netbeans

NetBeans IDE The NetBeans IDE is an open-source integrated development environment.

NetBeans IDE supports development of all Java application types (Java SE

including Java FX, (Java ME, web, EJB and mobile applications) out of the box.

The NetBeans Platform is a reusable framework for simplifying the

development of Java Swing desktop applications. The NetBeans IDE bundle for

Java SE contains what is needed to start developing NetBeans plugins and

NetBeans Platform based applications and no additional SDK is required.

BENEFITS OF USING NETBEANS

The benefits of using the NetBeans for developing application include:

Page 30: Visual Cryptography

Graphical User Interface (GUI)

The major requirement of today’s developers is to have a good User

Interface for their users. They can provide whatever functionality they need but it

GUI that lets the user better knows the existence of that particular functionality and

its easier for them to click and select than type something on a black boring screen.

Thus, today’s developers need IDE’s such as netbeans that develop ready

made windows forms with all the required buttons, labels, text boxes and like that

can be tailor made for the program in question.

Database Integration

Database based program developers know how hard it is to interface your back-

end database to your front-end program. This is where netbeans packs the punch by

providing you a CRUD (create, Read, Update, Delete) application shell.

Page 31: Visual Cryptography

5. MODULE DESCRIPTION

5.1 MODULES

1. Sender

Load Image

2. Halftone Pattern

Share Image

3. Embedded RIVCS

Linear Program (Covering Subsets)

4. Recipient/Authentication

Modules Description:

1. Sender:

User provides a secret image and outputs of Original shares image which

relevant for secret .

We can satisfy with the two conditions: 1) any qualified subset of shares can

recover the secret image; 2) any forbidden subset of shares cannot obtain any

information of the secret image other than the size of the secret image.

Page 32: Visual Cryptography

2. Halftone Pattern:

We can obtain the original image with only k shares out of n shares,

then all the ‘n’ image shares are necessarily overlaid. When all the image

shares that are overlaid are authenticated to be from the same original image.

RIVCS share with transparent pixels and pixels from the cover images. RIVCS

by using half toning techniques, and hence can treat gray-scale input share images.

Their methods made use of the complementary images to cover the visual

information of the share images.

By using Patterning dithering matrix makes use of a certain percentage of

black and white pixels, often called patterns, to achieve a sense of gray scale in the

overall point of view.

3. Embedded RIVCS

Embedded RIVCS encode a secret image , the dealer takes gray-scale

original share images as inputs, and converts them into covering shares which

are divided into blocks of sub pixels.

Our embedded RIVCS contains three main steps: 1) Generate covering shares. 2) Generate the embedded shares by embedding the corresponding VCS into the ‘n’ covering shares. 3) Region Incrementing Visual Cryptography Scheme (RIVCS) can achieve the minimum pixel expansion and the maximal contrasts. Integer linear program aims at the minimization of the pixel expansion under the constraints for being a RIVCS.

Page 33: Visual Cryptography

a. Stacking (Covering Subsets):

The stacking results of the qualified shares are all black images, the

information of the original share images are all covered.

The stacking results are not necessarily to be all black images.

The covering shares have the advantage it’s a qualified subsets of

stacked.

All the information of the patterns in the original share images is

covered. Hence the visual quality of the recovered secret image is not affected.

4. Recipient/Authentication:

After send the share file the recipient can retrieve the secret shares using

the secret key given by the sender.

The recipient can retrieve the original data from the shares by the overlaying

process in vc Application.

6. SYSTEM DESIGN

6.1 SYSTEM ARCHITECTURE

User provides a secret image and outputs of Original shares image which

relevant for secret. We can satisfy with the two conditions: 1. any qualified subset

of shares can recover the secret image; any forbidden subset of shares cannot

Page 34: Visual Cryptography

obtain. 2. any information of the secret image other than the size of the secret

image.

We can obtain the original image with only k shares out of n shares, then all

the ‘n’ image shares are necessarily overlaid. When all the image shares that are

overlaid are authenticated to be from the same original image.VCS share with

transparent pixels and pixels from the cover images. RIVC by using halftoning

techniques, and hence can treat gray-scale input share images. Embedded RIVC

encode a secret image, the dealer takes gray-scale original share images as inputs,

and converts them into covering shares which are divided into blocks of sub pixels.

The stacking results of the qualified shares are all black images, the

information of the original share images are all covered.The stacking results are not

necessarily to be all black images.The covering shares have the advantage it’s a

qualified subsets of stacked. All the information of the patterns in the original share

images is covered. Hence the visual quality of the recovered secret image is not

affected.

Authentication has been verified by using Hash Authentication Code

algorithm.Authorized user (Recipient) only be able to access the image, transmitted

from Sender.

To detect whether or not a digital content has been tampered with in order to

alter its semantics, the use of multimedia hashes turns out to be an effective

solution

Page 35: Visual Cryptography

Fig 6.1 Architecture Diagram

6.2 DATA FLOW DIAGRAM

In the dataflow diagram can be representing the behavior of an operation as a

set of actions. It is a flow chart showing the flow of control from state to state

transitions.A data flow diagram shows the sequence of data that an object goes

Page 36: Visual Cryptography

through during its life in response to outside stimuli and messages. The level is set

of values that describes an object at a specific point in the user and is represented

by data symbols and the transitions are represented by arrows connecting the state

symbol

DATA FLOW DIAGRAM SYMBOLS

- Source or Destination of data

- Data Flow

- Process

- Storage

Fig 6.2 DFD symbols

Page 37: Visual Cryptography

THE DATAFLOW DIAGRAM IS GIVEN AS FOLLOWS

Page 38: Visual Cryptography
Page 39: Visual Cryptography

Fig 6.3 Data Flow Diagram

Page 40: Visual Cryptography

6.3 UML DIAGRAMS

6.3.1UML Notations

LIST OF SYMBOLS

S.NO SYMBOL

NAME

NOTATION DESCRIPTION

1. Initial Activity This shows the Starting point or first

activity of flow.

2. Final Activity The end of the Activity diagram is

shown by a bull’s eye symbol.

3. Activity Represented by a rectangle with

rounded edges.

Page 41: Visual Cryptography

4. Decision A logic where a decision is to be made.

5. Use Case Describe the interaction between a user

and a system.

6. Actor

A role that a user plays with respect to

system.

7. Object

A Real time Entity.

8. Message To send message between the life of an

object.

Page 42: Visual Cryptography

9. State

It represents situations during the life

of an object.

10. Initial State Represents the Object’s initial state.

11. Final State

Represents the Object’s Final state.

12. Transition

Label the transition with the event that

triggered it and the action that results

from it.

13. Class

A set of objects that share a common

Page 43: Visual Cryptography

structure & a common behavior.

14. Association Relationship between classes.

15. Generalization Relationship between more general

class & a more specific class.

Table 6.1 uml notation

UML DIAGRAMS:

Page 44: Visual Cryptography

The Unified Modeling Language (UML) is used to specify, visualize, modify,

construct and document the artifacts of an object-oriented software-intensive

system under development. UML offers a standard way to visualize a system's

architectural blueprints, including elements such as:

activities

actors

business processes

database schemas

(logical) components

programming language statements

reusable software components.

UML combines techniques from data modeling (entity relationship diagrams),

business modeling (work flows), object modeling, and component modeling. It can

be used with all processes, throughout the software development life cycle, and

across different implementation technologies. UML has synthesized the notations of the Booch method, the Object-modeling technique (OMT) and Object-oriented

software engineering (OOSE) by fusing them into a single, common and widely usable modeling language. UML aims to be a standard modeling language which

can model concurrent and distributed systems. UML is a de facto industry

standard, and is evolving under the auspices of the Object Management Group (OMG).

UML models may be automatically transformed to other representations (e.g. Java) by means of QVT-like transformation languages. UML is extensible, with two mechanisms for customization: profiles and stereotypes.

Page 45: Visual Cryptography

6.3.2 USE CASE DIAGRAM

A use case illustrates a unit of functionality provided by the system.

The main purpose of the use-case diagram is to help development teams visualize

the functional requirements of a system, including the relationship of "actors"

(human beings who will interact with the system) to essential processes, as well as

the relationships among different use cases.

Page 46: Visual Cryptography

Fig 6.4 Use Case Diagram

State chart Diagram

Statechart diagram is one of the five UML diagrams used to model dynamic nature of a system. They define different states of an object during its lifetime. And

these states are changed by events. So Statechart diagrams are useful to model reactive systems. Reactive systems can be defined as a system that responds to external or internal events.

Statechart diagram describes the flow of control from one state to another state. States are defined as a condition in which an object exists and it changes

when some event is triggered. So the most important purpose of Statechart diagram is to model life time of an object from creation to termination.

Statechart diagrams are also used for forward and reverse engineering of a system. But the main purpose is to model reactive system.

Following are the main purposes of using Statechart diagrams:

45

Page 47: Visual Cryptography

To model dynamic aspect of a system.

To model life time of a reactive system.

To describe different states of an object during its life time.

Define a state machine to model states of an object.

Activity Diagram

Activity diagram is another important diagram in UML to describe dynamic

aspects of the system.Activity diagram is basically a flow chart to represent the

flow form one activity to another activity. The activity can be described as an

47

Page 48: Visual Cryptography

operation of the system.

So the control flow is drawn from one operation to another. This flow can be

sequential, branched or concurrent. Activity diagrams deals with all type of flow

control by using different elements like fork, join etc.

The basic purposes of activity diagrams are similar to other four diagrams. It

captures the dynamic behaviour of the system. Other four diagrams are used to

show the message flow from one object to another but activity diagram is used to

show message flow from one activity to another.

Activity is a particular operation of the system. Activity diagrams are not

only used for visualizing dynamic nature of a system but they are also used to

construct the executable system by using forward and reverse engineering

techniques. The only missing thing in activity diagram is the message part.

It does not show any message flow from one activity to another. Activity

diagram is some time considered as the flow chart. Although the diagrams looks

48

Page 49: Visual Cryptography

like a flow chart but it is not. It shows different flow like parallel, branched,

concurrent and single.

So the purposes can be described as:

Draw the activity flow of a system.

Describe the sequence from one activity to another.

Describe the parallel, branched and concurrent flow of the system.

49

Page 50: Visual Cryptography

50

Page 51: Visual Cryptography

Class Diagram

The class diagram is a static diagram. It represents the static view of an

application. Class diagram is not only used for visualizing, describing and

documenting different aspects of a system but also for constructing executable code of the software application.

The class diagram describes the attributes and operations of a class and also the constraints imposed on the system. The class diagrams are widely used in the

modelling of object oriented systems because they are the only UML diagrams which can be mapped directly with object oriented languages.

The class diagram shows a collection of classes, interfaces, associations, collaborations and constraints. It is also known as a structural diagram.

The purpose of the class diagram is to model the static view of an application. The class diagrams are the only diagrams which can be directly mapped with object oriented languages and thus widely used at the time of construction.

The UML diagrams like activity diagram, sequence diagram can only give the sequence flow of the application but class diagram is a bit different. So it is the most popular UML diagram in the coder community.

So the purpose of the class diagram can be summarized as:

51

Page 52: Visual Cryptography

Analysis and design of the static view of an application.

Describe responsibilities of a system.

Base for component and deployment diagrams.

Forward and reverse engineering.

52

Page 53: Visual Cryptography

53

Page 54: Visual Cryptography

Sequence Diagram

A sequence diagram in a Unified Modeling Language (UML) is a kind of

interaction diagram that shows how processes operate with one another and in

what order. It is a construct of a Message Sequence Chart. A sequence diagram

shows object interactions arranged in time sequence. It depicts the objects and

classes involved in the scenario and the sequence of messages exchanged between

the objects needed to carry out the functionality of the scenario. Sequence

diagrams typically are associated with use case realizations in the Logical View of

the system under development.

Sequence diagrams are sometimes called event diagrams, event scenarios, and timing diagrams.

54

Page 55: Visual Cryptography

Collaboration Diagram

55

Page 56: Visual Cryptography

7. TESTING

7.1 SYSTEM TESTING:

56

Page 57: Visual Cryptography

Software testing is an important element of Software quality assurance and

represents the ultimate review of specification, design and coding. The increasing

visibility of S/W as a system element and the costs associated with Software failure

are motivating forces for well planned, through testing.

Though the test phase is often thought of as separate and distinct from the

development effort--first develop, and then test--testing is a concurrent process that

provides valuable information for the development team.

There are at least three options for integrating Project Builder into the test

phase:

Testers do not install Project Builder, use Project Builder functionality

to compile and source-control the modules to be tested and hand

them off to the testers, whose process remains unchanged.

The testers import the same project or projects that the developers use.

Create a project based on the development project but customized for

the testers (for example, it does not include support documents,

specs, or source), who import it.

7.2 UNIT TESTING:

This is the first level of testing. In this different modules are tested against

the specifications produced during the design of the module. During this testing the

number of arguments is compared to input parameters, matching of parameter and

arguments etc. It is also ensured whether the file attributes are correct, whether the

Files are opened before using, whether Input/output errors are handled etc. Unit

Test is conducted using a Test Driver usually.

57

Page 58: Visual Cryptography

7.3 OUTPUT TESTING:

After performing the validation testing, next step is output testing of the

proposed system since no system could be useful if it does not produces the

required output generated or considered in to two ways. One is on screen and

another is printed format. The output comes as the specified requirements by the

user. Hence output testing does not result in any correction in the system.

7.4 INTEGRATION TESTING:

Integration testing is a systematic testing for constructing the program

structure, while at the same time conducting test to uncover errors associated

within the interface. Bottom-up integration is used for this phase. It begins

construction and testing with atomic modules. This strategy is implemented with

the following steps.

Low-level modules are combined to form clusters that perform a

specific software sub function.

The cluster is tested.

Drivers are removed and clusters are combined moving upward in the

program structure.

7.5 TEST CASES:

This provides the final assurance that the software meets all functional,

58

Page 59: Visual Cryptography

behavioral and performance requirements. The software is completely assembled

as a package. Validation succeeds when the software functions in which the user

expects.After performing the validation testing, next step is output testing of the

proposed system since no system could be useful if it does not produces the

required output generated or considered in to two ways. One is on screen and

another is printed format. The output comes as the specified requirements by the

user. Hence output testing does not result in any correction in the system.

8. CONCLUSION

59

Page 60: Visual Cryptography

We established an efficient construction of n-RIVCS using the skill of linear

programming in this paper. The object function aims at minimizing the pixel

expansion subject to the constraints satisfying the region incrementing

requirements. Unit matrices are introduced as the building blocks and the

numbers of the unit matrices chosen to form the basis matrices of n-RIVCS are set

as the decision variables. A solution to these decision variables by our linear

program delivers a feasible set of basis matrices of the required n-RIVCS with the

minimum pixel expansion. The pixel expansions and contrasts derived from our n-

RIVCS are better than the previous results. Since no construction method has ever

been reported in the literature, our linear program formulation for n-RIVCS is

novel and innovative from both the theoretical and practical points of view. The

contrasts of different secret regions can also be designated in the constraints. This

enhances the adaptability and flexibility of our RIVCS in practical applications.

9. FUTURE ENHANCEMENTS

60

Page 61: Visual Cryptography

Embedded RIVC has many specific advantages against different well-known

schemes, such as the fact that it can deal with gray-scale input images, has smaller

pixel expansion, is always unconditionally secure, does not require complementary

share images, one participant only needs to carry one share, and can be applied for

general access structure.Furthermore, our construction is flexible in the sense that

there exist two trade-offs between the share pixel expansion and the visual quality

of the shares and between the secret image pixel expansion and the visual quality

of the shares.

APPENDIX I

SOURCE CODE

61

Page 62: Visual Cryptography

importjavax.swing.JApplet;

importjavax.swing.JFrame;

importjava.awt.Dimension;

importjava.awt.event.ActionEvent;

importjava.awt.event.ActionListener;

importjava.awt.event.ItemEvent;

importjava.awt.event.ItemListener;

importjava.io.File;

importjava.io.IOException;

import java.net.URL;

importjavax.swing.AbstractButton;

importjavax.swing.JEditorPane;

importjavax.swing.JFileChooser;

importjavax.swing.JFrame;

importjavax.swing.JOptionPane;

importjavax.swing.JScrollPane;

importjavax.swing.event.HyperlinkEvent;

importjavax.swing.event.HyperlinkListener;

importjavax.swing.filechooser.FileFilter;

importanon.util.ResourceLoader;

/** AppletListener for the VCApplet to listen on Actions and ItemState-Eventes

* @author Boßle Johannes

*/

public class VCAppletListener implements ActionListener, ItemListener, HyperlinkListener {

62

Page 63: Visual Cryptography

/** the applet which called this VCAppletListener */

VCAppletm_applet;

/** flag to see if there are loaded encrypted transparencies*/

booleanm_LoadEncFoil = false;

/** creates a new VCAppletListenerObject

*

* @param applet - the applet to listen to

*/

publicVCAppletListener(VCApplet applet){

m_applet = applet;

}

/** creates a filechooser to select images to load

*

* @paramdesc - description to display

* @paramloadEnc - true if encrypted foils are loaded, false otherwise

* @return - JFileChooserObject with filter, descritption,...

*/

privateJFileChoosergetFileChooser(String desc, booleanloadEnc){

JFileChooserjfc = new JFileChooser(desc);

jfc.setFileFilter(new FileFilter(){

publicboolean accept(File f){

boolean ret = false;

if (f.isDirectory()) {

return true;

}

63

Page 64: Visual Cryptography

if(ImagePanel.extension(f)!= null){

ret = true;

}

return ret;

}

public String getDescription(){

return "*.gif, *.png";

}

});

jfc.setAccessory(new ImagePreview(jfc));

returnjfc;

} public void actionPerformed(ActionEventevt) {

m_applet.setEncTFText();

String actionCommand = evt.getActionCommand();

try{

//File

if (actionCommand == (m_applet.loadItem.getText()) || actionCommand == m_applet.loadButton.getActionCommand()) {

JFileChooserjfc = this.getFileChooser("load a new original image",false);

if(jfc.showOpenDialog(m_applet)==JFileChooser.APPROVE_OPTION){

m_applet.m_fileImage = jfc.getSelectedFile();

m_applet.m_dispatcher.loadImage(m_applet.m_fileImage);

64

Page 65: Visual Cryptography

m_applet.inputPanel.setVisible(false);

m_applet.inputPanel.setVisible(true);

m_applet.updateMenu();

m_applet.enableFunctionsAfterEncrypt(false);

m_applet.inputPanel.validate();

}

}

}

//Show

else if(actionCommand == m_applet.zoomButton.getActionCommand()){

m_applet.m_dispatcher.zoom();

}else if(actionCommand == m_applet.show1Item.getText() || actionCommand == m_applet.show1Button.getActionCommand()){

m_applet.m_dispatcher.getEncCanvas(0);

m_applet.setEncTFText();

m_applet.show1Button.setBackground(m_applet.SELECTEDCOLOR);

}else if(actionCommand == m_applet.show2Item.getText() || actionCommand == m_applet.show2Button.getActionCommand()){

m_applet.m_dispatcher.getEncCanvas(1);

m_applet.setEncTFText();m_applet.show2Button.setBackground(m_applet.SELECTEDCOLOR);

}else if(actionCommand == m_applet.show3Item.getText() || actionCommand == m_applet.show3Button.getActionCommand()){

m_applet.m_dispatcher.getEncCanvas(2);

65

Page 66: Visual Cryptography

m_applet.setEncTFText();m_applet.show3Button.setBackground(m_applet.SELECTEDCOLOR);

}else if(actionCommand == m_applet.show4Item.getText() || actionCommand == m_applet.show4Button.getActionCommand()){

m_applet.m_dispatcher.getEncCanvas(3);

m_applet.setEncTFText()m_applet.show4Button.setBackground(m_applet.SELECTEDCOLOR);

}else if(actionCommand == m_applet.show5Item.getText() || actionCommand == m_applet.show5Button.getActionCommand()){

m_applet.m_dispatcher.getEncCanvas(4);

m_applet.setEncTFText();m_applet.show5Button.setBackground(m_applet.SELECTEDCOLOR);

}else if(actionCommand == m_applet.nextFoil.getText()){

m_applet.m_dispatcher.getEncCanvas(m_applet.m_dispatcher.getCurrentFoil()+1);

m_applet.setEncTFText();m_applet.markCurrentShowButton(m_applet.SELECTEDCOLOR);

}else if(actionCommand == m_applet.prevFoil.getText()){

m_applet.m_dispatcher.getEncCanvas(m_applet.m_dispatcher.getCurrentFoil()-1);

m_applet.setEncTFText();m_applet.markCurrentShowButton(m_applet.SELECTEDCOLOR);

}

}catch(SecurityException se){

JOptionPane.showMessageDialog(m_applet,"You are not privileged to do this operation. \nPlease check your security policy.","Alert",JOptionPane.ERROR_MESSAGE);

}

66

Page 67: Visual Cryptography

}

/**

* @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)

*/

public void itemStateChanged(ItemEvent e) {

Object o = e.getSource();

if (o == m_applet.overlay1Item || o == m_applet.ovl1Item) {

if(((AbstractButton) o).isSelected()){

m_applet.m_setForAccess[0] = true;

m_applet.overlay1Item.setSelected(true);

m_applet.ovl1Item.setSelected(true);

if(m_applet.count==1)

{

//m_applet.text1.setVisible(true);

//m_applet.lable1.setVisible(true);

m_applet.button1.setVisible(true);

}

}else{

m_applet.m_setForAccess[0] = false;

m_applet.overlay1Item.setSelected(false);

m_applet.ovl1Item.setSelected(false);

//m_applet.text1.setVisible(false);

//m_applet.lable1.setVisible(false);

m_applet.button1.setVisible(false);

67

Page 68: Visual Cryptography

}

}else if (o == m_applet.overlay2Item|| o == m_applet.ovl2Item) {

if(((AbstractButton) o).isSelected()){

m_applet.m_setForAccess[1] = true;

m_applet.overlay2Item.setSelected(true);

m_applet.ovl2Item.setSelected(true);

if(m_applet.count==2)

{

//m_applet.text1.setVisible(true);

//m_applet.lable1.setVisible(true);

m_applet.button1.setVisible(true);

}

}else{

m_applet.m_setForAccess[1] = false;

m_applet.overlay2Item.setSelected(false);

m_applet.ovl2Item.setSelected(false);

//m_applet.text1.setVisible(false);

//m_applet.lable1.setVisible(false);

m_applet.button1.setVisible(false);

}

}else if (o == m_applet.overlay3Item|| o == m_applet.ovl3Item) {

if(((AbstractButton) o).isSelected()){

m_applet.m_setForAccess[2] = true;

m_applet.overlay3Item.setSelected(true);

m_applet.ovl3Item.setSelected(true);

68

Page 69: Visual Cryptography

if(m_applet.count==3)

{

//m_applet.lable1.setVisible(true);

m_applet.button1.setVisible(true);

//m_applet.text1.setVisible(true);

}

}else{

m_applet.m_setForAccess[2] = false;

m_applet.overlay3Item.setSelected(false);

m_applet.ovl3Item.setSelected(false);

//m_applet.text1.setVisible(false);

//m_applet.lable1.setVisible(false);

m_applet.button1.setVisible(false);

}

}else if (o == m_applet.overlay4Item|| o == m_applet.ovl4Item) {

if(((AbstractButton) o).isSelected()){

m_applet.m_setForAccess[3] = true;

m_applet.overlay4Item.setSelected(true);

m_applet.ovl4Item.setSelected(true);

if(m_applet.count==4)

{

//m_applet.lable1.setVisible(true);

m_applet.button1.setVisible(true);

//m_applet.text1.setVisible(true);

}

69

Page 70: Visual Cryptography

}else{

m_applet.m_setForAccess[3] = false;

m_applet.overlay4Item.setSelected(false);

m_applet.ovl4Item.setSelected(false);

//m_applet.text1.setVisible(false);

//m_applet.lable1.setVisible(false);

m_applet.button1.setVisible(false);

}

}else if (o == m_applet.overlay5Item|| o == m_applet.ovl5Item) {

if(((AbstractButton) o).isSelected()){

m_applet.m_setForAccess[4] = true;

m_applet.overlay5Item.setSelected(true);

m_applet.ovl5Item.setSelected(true);

if(m_applet.count==5)

{

//m_applet.text1.setVisible(true);

//m_applet.lable1.setVisible(true);

m_applet.button1.setVisible(true);

}

}else{

m_applet.m_setForAccess[4] = false;

m_applet.overlay5Item.setSelected(false);

m_applet.ovl5Item.setSelected(false);

//m_applet.text1.setVisible(false);

//m_applet.lable1.setVisible(false);

70

Page 71: Visual Cryptography

m_applet.button1.setVisible(false);

}

}

m_applet.resultFlip.flip(false);

m_applet.m_dispatcher.overlay(m_applet.m_setForAccess);

m_applet.resultPanelLeft.doLayout();

// m_applet.resultPanel.doLayout();

m_applet.resultPanel.setVisible(false);

m_applet.resultPanel.setVisible(true);

// m_applet.validateTree();

}

/**

* @return Returns the m_LoadEncFoil.

*/

publicbooleanisLoadEncFoil() {

returnm_LoadEncFoil;

} public void setLoadEncFoil(booleanloadEncFoil) {

m_LoadEncFoil = loadEncFoil;

}

javax.swing.event.HyperlinkListener#hyperlinkUpdate(javax.swing.event.HyperlinkEvent)

public void hyperlinkUpdate(HyperlinkEvent e) {

if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {

JEditorPane pane = (JEditorPane) e.getSource();

71

Page 72: Visual Cryptography

try {

pane.setPage(e.getURL());

} catch (Throwable t) {

t.printStackTrace();

}

}

}

}

APPENDIX II

SCREEN SHOTS

72

Page 73: Visual Cryptography

73

Page 74: Visual Cryptography

74

Page 75: Visual Cryptography

75

Page 76: Visual Cryptography

76

Page 77: Visual Cryptography

77

Page 78: Visual Cryptography

78

Page 79: Visual Cryptography

79

Page 80: Visual Cryptography

80

Page 81: Visual Cryptography

81

Page 82: Visual Cryptography

82

Page 83: Visual Cryptography

83

Page 84: Visual Cryptography

84

Page 85: Visual Cryptography

85

Page 86: Visual Cryptography

86

Page 87: Visual Cryptography

87

Page 88: Visual Cryptography

88

Page 89: Visual Cryptography

REFERENCES

[1] M. Naor and A. Shamir, “Visual cryptography,” in Proc. Adv. Cryptography:

Eurpocrypt, LNCS 950. 1995, pp. 1–12.

[2] S. Droste, “New results on visual cryptography,” in Proc. Advances

Cryptography, LNCS 1109. 1996, pp. 401–415.

[3] T. Katoh and H. Imai, “An extended construction method for visual

secret sharing schemes,” Electron. Commun. Japan Part III: Fundam.

Electron. Sci., vol. 81, no. 7, pp. 55–63, Jul. 1998.

[4] C. Blundo, A. De Santis, and D. R. Stinson, “On the contrast in visual

cryptography schemes,” J. Cryptology, vol. 12, no. 4, pp. 261–289, 1999.

[5] T. Hofmeister, M. Krause, and H. U. Simon, “Contrast-optimal k out of

n secret sharing schemes in visual cryptography,” Theor. Comput. Sci.,

vol. 240, no. 2, pp. 471–485, Jun. 2000.

[6] G. Ateniese, C. Blundo, A. De Santis, and D. R. Stinson, “Visual

cryptography for general access structures,” Inform. Comput., vol. 129,

no. 2, pp. 86–106, 1996.

[7] Y.-C. Hou, “Visual cryptography for color images,” Pattern Recognit.,

vol. 36, no. 7, pp. 1619–1629, 2003.

[8] S. J. Shyu, “Efficient visual secret sharing scheme for color images,”

89

Page 90: Visual Cryptography

Pattern Recognit., vol. 39, no. 5, pp. 866–880, May 2006.

[9] D. Jin, W. Q. Yan, and M. S. Kankanhalli, “Progressive color visual

cryptography,” J. Electron. Imag., vol. 14, no. 3, p. 033019, 2005.

[10] W. P. Fang and J. C. Lin, “Progressive viewing and sharing of sensitive

images,” Pattern Recognit. Imag. Anal., vol. 16, no. 4, pp. 632–636,

2006.

[11] S. J. Shyu and K. Chen, “Visual multiple secrets sharing by circle

random grids,” SIAM J. Imag. Sci., vol. 3, no. 4, pp. 926–953, 2010.

[12] S. J. Shyu, S.-Y. Huang, Y.-K. Lee, R.-Z. Wang, and K. Chen, “Sharing

multiple secrets in visual cryptography,” Pattern Recognit., vol. 40, no.

12, pp. 3633–3651, Dec. 2007.

[13] R.-Z. Wang, “Region incrementing visual cryptography,” IEEE Signal

Process. Lett., vol. 16, no. 8, pp. 659–662, Aug. 2009.

[14] Free Software Foundation. (1999, Feb.). lp−solve Reference Guide Menu

[Online]. Available: http://lpsolve.sourceforge.net/5.5

90