Sie sind auf Seite 1von 72

Embedded Extended Visual Cryptography

Contents
Chapter 01 Abstract .. Project Purpose.. Project Scope Product Features..... Introduction Chapter 02 System Analysis .. Problem Definition. Existing System Limitations of Existing System Proposed System.. Advantages of Proposed System Feasibility Study.. Hardware and Software Requirements. Functional Requirements. Non Functional Requirements. Literature Survey Modules Description..

Chapter 03 System Design SDLC Spiral Model Project Architecture Module Description. UML Diagrams . Use case. Class Sequence. Activity..

Chapter 04 Process Specification (Techniques And Algorithm Used)..................... Screen Shots.. . Chapter 05 Technology Description. Full Project Coding, Database with Video Tutorial How to Install Document

Chapter 06 Testing Block & White Box Testing. Unit Testing System Testing.. Integration Testing Test Case Table . Chapter 07 Conclusion . Limitations & Future Enhancements Reference & Bibliography

Chapter 01 ABSTRACT:
A visual cryptography scheme (VCS) is a kind of secret sharing scheme which allows the encoding of a secret image into shares distributed to participants. The beauty of such a scheme is that a set of qualified participants is able to recover the secret image without any cryptographic knowledge and computation devices. An extended visual cryptography scheme (EVCS) is a kind of VCS which consists of meaningful shares (compared to the random shares of traditional VCS). In this paper, we propose a construction of EVCS which is realized by embedding random shares into meaningful covering shares, and we call it the embedded EVCS. Experimental results compare some of the well-known EVCSs proposed in recent years systematically, and show that the proposed embedded EVCS has competitive visual quality compared with many of the well-known EVCSs in the literature. In addition, it has many specific advantages against these well-known EVCSs, respectively.

PROJECT PURPOSE:
Purpose of project is secret sharing of images by using VCS with random shares or traditional VCS or simply the VCS. In general, a traditional VCS takes a secret image as input, and outputs shares that satisfy 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.

PROJECT SCOPE:
System provides a friendly environment to deal with images. Generally tools supports only one kind of image formats. Our application supports .gif and .png (portable network graphics) formatted images and our application has been developed using swing and applet technologies, hence provides a friendly environment to users.

VCS of an EVCS, we mean a traditional VCS that have the same access structure with the EVCS. Generally, an EVCS takes a secret image and original share images as inputs, and outputs shares that satisfy the following three option: 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; 3) All the shares are meaningful images.

PRODUCT FEATURES:
EVCS 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. This flexibility allows the dealer to choose the proper parameters for different applications. Comparisons on the experimental results show that the visual quality of the share of the proposed embedded EVCS is competitive with that of many of the well-known EVCSs in the literature.

INTRODUCTION:
THE basic principle of the visual cryptography scheme (VCS) was first introduced by Naor and Shamir. VCS is a kind of secret sharing scheme that focuses on sharing secret images. The idea of the visual cryptography model proposed in is to split a secret image into two random shares (printed on transparencies) which separately reveals no information about the secret image other than the size of the secret image. The secret image can be reconstructed by stacking the two shares. The underlying operation of this scheme is logical operation OR. In this paper, we call a VCS with random shares the traditional VCS or simply the VCS. In general, a traditional VCS takes a secret image as input, and outputs shares that satisfy 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. An example of traditional (2,2)-VCS can be found in Fig. 1, where, generally speaking, a VCS means any out of shares could recover the secret image. In the scheme of Fig. 1, shares (a) and (b) are distributed to two participants secretly, and each participant cannot get any information about the secret image, but after

stacking shares (a) and (b), the secret image can be observed visually by the participants. VCS has many special applications, for example, transmitting military orders to soldiers who may have no

cryptographic knowledge or computation devices in the battle field. Many other applications of VCS, other than its original objective (i.e., sharing secret image), have been found, for example, authentication and identification, watermarking and transmitting passwords etc. The associated secret sharing problem and its physical properties such as contrast, pixel expansion, and color were extensively studied by researchers worldwide. For example, showed constructions of threshold VCS with perfect reconstruction of the black pixels. Furthermore, Eisen et al. proposed a construction of threshold VCS for specified whiteness levels of the recovered pixels. The term of extended visual cryptography scheme (EVCS) was first introduced by Naor et al. in, where a simple example of (2, 2)-EVCS was presented. In this paper, when we refer to a corresponding VCS of an EVCS, we mean a traditional VCS that have the same access structure with the EVCS. Generally, an EVCS takes a secret image and original share images as inputs, and outputs shares that satisfy the following three 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; 3) all the shares are meaningful images. Examples of EVCS can be found in the experimental results of this paper, such as Figs. 29 (in Base Paper). EVCS can also be treated as a technique of steganography. One scenario of the applications of EVCS is to avoid the custom inspections, because the shares of EVCS are meaningful images, hence there are fewer chances for the shares to be suspected and detected.

Chapter 02

SYSTEM ANALYSIS: PROBLEM DEFINITION:


When ever we transmit the data(image) in the network, any unauthenticated person can read our data(image). In order to provide security to data(image) generally sender will encrypt the data(image) and send it the intended person and the receiver will decrypt the encrypted data(image) and uses it.

EXISTING SYSTEM:
Visual cryptography is the art and science of encrypting the image in such a way that no-one apart from the sender and intended recipient even realizes the original image, a form of security through obscurity. By contrast, cryptography obscures the original image, but it does not conceal the fact that it is not the actual image.

LIMITATIONS OF EXISTING SYSTEM:


The existing system does not provide a friendly environment to encrypt or decrypt the data (images).

PROPOSED SYSTEM:
Proposed system Visual cryptography provides a friendly environment to deal with images. Generally cryptography tools supports only one kind of image formats. Our application supports .gif and .png (portable network graphics) formatted images and our application has been developed using swing and applet technologies, hence provides a friendly environment to users.

ADVANTAGES OF PROPOSED SYSTEM:


EVCS 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. This flexibility allows the dealer to choose the proper parameters for different applications. Comparisons on the experimental results show that the visual quality of the share of the proposed embedded EVCS is competitive with that of many of the well-known EVCSs in the literature.

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 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. 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.

HARDWARE AND SOFTWARE REQUIREMENTS:


HARDWARE REQUIREMENTS:

System Hard Disk Monitor Mouse Ram

: : : : :

Pentium IV 2.4 GHz. 40 GB and above. VGA Colour. Standard Mouse. 512 Mb and above.

SOFTWARE REQUIREMENTS:

Operating system Coding Language Tools

: Windows XP. : JDK 1.6 : NetBeans IDE

FUNCTIONAL REQUIREMENTS:
Functional requirements specify which output file should be produced from the given file they describe the relationship between the input and output of the system, for each functional requirement a detailed description of all data inputs and their source and the range of valid inputs must be specified.

They are: 1. Browse secrete image 2. Select number of shares 3. Encryption of shares 4. Sending of shares 5. Decryption of Shares NON FUNCTIONAL REQUIREMENTS:
Describe user-visible aspects of the system that are not directly related with the functional behavior of the system. Non-Functional requirements include quantitative constraints, such as response time (i.e. how fast the system reacts to user commands.) or accuracy (i.e. how precise are the systems numerical answers.) For example in our project: Quality: Project fitness for purpose Maintainability: Make future maintenance of project easier Reliability: The ability of project to perform its required functions under stated conditions for a specified period of time. Robustness: The ability of project to cope with errors during execution. Security: Projects degree of protection against unauthorized access. Durability: Project guarantees the tasks/transactions that have committed will survive permanently.

LITERATURE SURVEY:
Literature survey is the most important step in software development process. Before developing the tool it is necessary to determine the time factor, economy n company strength. Once these things r satisfied, ten next step is to determine which operating system and language can be used for developing the tool. Once the programmers start building the tool the programmers need lot of external support. This support can be obtained from senior programmers, from book or from websites. Before building the system the above consideration r taken into account for developing the proposed system. The associated secret sharing problem and its physical properties such as contrast, pixel expansion, and color were extensively studied by researchers worldwide. For example, Naor et al and Blundo et al. showed constructions of threshold VCS with perfect reconstruction of the black pixels. Ateniese et al. gave constructions of VCS for the general access structure. Krishna et al., Luo et al., Hou et al., and Liu et al. considered color VCSs.Shyu et al. proposed a scheme which can share multiple secret images . Furthermore, Eisen et al. proposed a construction of threshold VCS for specified whiteness levels of the recovered pixels. The term of extended visual cryptography scheme (EVCS) was first introduced by Naor et al. in, where a simple example of (2,2)-EVCS was presented. In this paper, when we refer to a corresponding VCS of an EVCS, we mean a traditional VCS that have the same access structure with the EVCS. Generally, an EVCS takes a secret image and original share images as inputs, and outputs shares that satisfy the following three 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; 3) all the shares are meaningful images. EVCS can also be treated as a technique of steganography. One scenario of the applications of EVCS is to avoid the custom inspections, because the shares of EVCS are meaningful images, hence there are fewer chances for the shares to be suspected and detected. There have been many EVCSs proposed in the literature. Furthermore, Zhou et al. presented an EVCS by using halftoning 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. Recently, Wang et al. proposed three EVCSs by using an error diffusion halftoning technique to obtain nice looking shares. Their first EVCS also made use of complementary shares to cover the visual information of the shares as the way proposed in. Their second EVCS imported auxiliary black pixels to cover the visual information of the shares. In such a way, each qualified participants did not necessarily require a pair of complementary share images. Their third EVCS modified the halftoned share images and imported extra black pixels to cover the visual information of the shares. 1) Visual Cryptography for General Access Structure by Multi-pixel Encoding with Variable Block Size: Authors: Haibo Zhang, Xiaofei Wang, Wanhua Cao, Youpeng Huang Multi-pixel encoding is an emerging method in visual cryptography for that it can encode more than one pixel for each run. However, in fact its encoding efficiency is still low. This paper presents a novel multi-pixel encoding which can encode variable number of pixels for each run. The length of encoding at one run is equal to the number of the consecutive same pixels met during scanning the secret image. The proposed scheme can work well for general access structure and chromatic images without pixel expansion. The experimental results also show that it can achieve high efficiency for encoding and good quality for overlapped images. 2) Halftone Visual Cryptography: Authors: Zhi Zhou, Member, IEEE, Gonzalo R. Arce, Fellow, IEEE, and Giovanni Di Crescenzo. Visual cryptography encodes a secret binary image (SI) into shares of random binary patterns. If the shares are xeroxed onto transparencies, the secret image can be visually decoded by superimposing a qualified subset of transparencies, but no secret information can be obtained from the superposition of a forbidden subset. The binary patterns of the shares, however, have no visual meaning and hinder the objectives of visual cryptography. Extended visual cryptography was proposed recently to construct meaningful binary images as shares using hypergraph colourings,

but the visual quality is poor. In this paper, a novel technique named halftone visual cryptography is proposed to achieve visual cryptography via halftoning. Based on the blue-noise dithering principles, the proposed method utilizes the void and cluster algorithm to encode a secret binary image into halftone shares (images) carrying significant visual information. The simulation shows that the visual quality of the obtained halftone shares are observably better than that attained by any available visual cryptography method known to date. 3) VISUAL CRYPTOGRAPHY FOR PRINT AND SCAN APPLICATIONS: Authors: Wei-Qi Yan, Duo Jin, Mohan S Kankanhalli Visual cryptography is not much in use in spite of possessing several advantages. One of the reasons for this is the difficulty of use in practice. The shares of visual cryptography are printed on transparencies which need to be superimposed. However, it is not very easy to do precise superposition due to the fine resolution as well as printing noise. Furthermore, many visual cryptography applications need to print shares on paper in which case scanning of the share is necessary. The print and scan process can introduce noise as well which can make the alignment difficult. In this paper, we consider the problem of precise alignment of printed and scanned visual cryptography shares. Due to the vulnerabilities in the spatial domain, we have developed a frequency domain alignment scheme. We employ the Walsh transform to embed marks in both of the shares so as to find the alignment position of these shares. Our experimental results show that our technique can be useful in print and scan applications.

4) JOINT VISUAL CRYPTOGRAPHY AND WATERMARKING:

Authors: Ming Sun Fu. Oscar C. Au In this paper, we discuss how to use watermarking technique for visual cryptography. Both halftone watermarking and visual cryptography involve a hidden secret image. However, their concepts are different. For visual cryptography, a set of share binary images is used to protect the content of the hidden image. The hidden image can only be revealed when enough share images are obtained. For watermarking, the hidden image is usually embedded in a single halftone image while preserving the quality of the watermarked halftone image. In this paper, we proposed a Joint Visual-cryptography and watermarking (JVW) algorithm that has the merits of both visual cryptography and watermarking. 5) AN IMPROVED VISUAL CRYPTOGRAPHY SCHEME FOR SECRET HIDING: Authors: R.Youmaran, A. Adler, A. Miri Visual Cryptography is based on cryptography where n images are encoded in a way that only the human visual system can decrypt the hidden message without any cryptographic computations when all shares are stacked together. This paper presents an improved algorithm based on Changs and Yu visual cryptography scheme for hiding a colored image into multiple colored cover images. This scheme achieves lossless recovery and reduces the noise in the cover images without adding any computational complexity.

Module Description:

1. INTERFACE DESIGN USING APPLET FRAME WORK 2. VISUAL CRYPTOGRAPHY IMPLEMENTATION 3. ENCODING

4. DECODING
5. CREATING TRANSPARENCIES

1. Interface design using Applet frame work Module


In this module, we design user interface using applet frame work. The user interface should be very easy and understandable to every user. So that anyone can access using our system. It must be supportable using various GUIs. The user interface also consists of help file. The help file assists on every concepts of the embedded visual cryptography. Help file should clearly depict the details of the project developed in simple language using various screen shoots.

2. VISUAL CRYPTOGRAPHY IMPLEMENTATION

Fig A:-Demonstration of visual cryptography


Each pixel of the image is divided into smaller blocks. There are always the same number of white (transparent) and black blocks. If a pixel is divided into two parts, there are one white and one black block. If the pixel is divided into four equal parts, there are two white and two black blocks. In the table on the right we can see that a pixel, divided into four parts

If the pixel of layer 2 is identical to layer 1, the overlayed pixel will be half black and half white. Such overlayed pixel is called grey or empty. If the pixels of layer 1 and 2 are inverted or opposite, the overlayed version will be completely black. This is an information pixel

1black 0- white
This module is the core for the project, where we implement the Visual Cryptography. We used LZW Data Compression algorithm. The LZW data compression algorithm is applied for the gray scale image here. As a preprocessing step, a dictionary is prepared for the gray scale image. In this dictionary, the string replaces characters with single quotes. Calculations are done using dynamic Huffman coding. In compression of greyscale image select the information pixels. Then generate halftone shares using error diffusion method. At last filter process is applied for the output gray scale images. Filters are used to improve the quality of reconstructed image to minimize the noises for sharpening the input secret image.

3. Encoding Module
A high level view of the encoding algorithm is shown here: a. Initialize the dictionary to contain all strings of length one. b. Find the longest string W in the dictionary that matches the current input. c. Emit the dictionary index for W to output and remove W from the input. d. Add W followed by the next symbol in the input to the dictionary. e. Go to Step 2 A dictionary is initialized to contain the single-character strings corresponding to all the possible input characters (and nothing else except the clear and stop codes if they're being used). The algorithm works by scanning through the input string for successively longer substrings until it finds one that is not in the dictionary. 4.

Decoding Module
The decoding algorithm works by reading a value from the encoded input and outputting the corresponding string from the initialized dictionary. At the same time it obtains the next value from the input, and adds to the dictionary the concatenation of the string just output and the first character of the string obtained by decoding the next input value. The decoder then proceeds to the next input value (which was already read in as the "next value" in the previous pass) and repeats the process until there is no more input, at which point the final input value is decoded without any more additions to the dictionary.

5 Creating Transparencies Module


This scheme provides theoretically perfect secrecy. An attacker who obtains either the transparency image or the screen image obtains no information at all about the encoded image since a black-white square on either image is equally likely to encode a clear or dark square in the original image. Another valuable property of visual cryptography is that we can create the second layer after distributing the first layer to produce any image we want. Given a known transparency image, we can select a screen image by choosing the appropriate squares to produce the desired image.

Chapter 03

SYSTEM DESIGN:

SDLC METHDOLOGIES
This document play a vital role in the development of life cycle (SDLC) as it describes the complete requirement of the system. It means for use by developers and will be the basic during testing phase. Any changes made to the requirements in the future will have to go through formal change approval process. SPIRAL MODEL was defined by Barry Boehm in his 1988 article, A spiral Model of Software Development and Enhancement. This model was not the first model to discuss iterative development, but it was the first model to explain why the iteration models. As originally envisioned, the iterations were typically 6 months to 2 years long. Each phase starts with a design goal and ends with a client reviewing the progress thus far. Analysis and engineering efforts are applied at each phase of the project, with an eye toward the end goal of the project. The steps for Spiral Model can be generalized as follows: The new system requirements are defined in as much details as possible. This usually involves interviewing a number of users representing all the external or internal users and other aspects of the existing system. A preliminary design is created for the new system. A first prototype of the new system is constructed from the preliminary design. This is usually a scaled-down system, and represents an approximation of the characteristics of the final product. A second prototype is evolved by a fourfold procedure: 1. Evaluating the first prototype in terms of its strengths, weakness, and risks. 2. Defining the requirements of the second prototype. 3. Planning an designing the second prototype. 4. Constructing and testing the second prototype. At the customer option, the entire project can be aborted if the risk is deemed too great. Risk factors might involved development cost overruns, operating-cost miscalculation, or any other factor that could, in the customers judgment, result in a less-than-satisfactory final product. The existing prototype is evaluated in the same manner as was the previous prototype, and if necessary, another prototype is developed from it according to the fourfold procedure outlined above.

The preceding steps are iterated until the customer is satisfied that the refined prototype represents the final product desired. The final system is constructed, based on the refined prototype. The final system is thoroughly evaluated and tested. Routine maintenance is carried on a continuing basis to prevent large scale failures and to minimize down time.

The following diagram shows how a spiral model acts like:

Fig -Spiral Model

ADVANTAGES Estimates(i.e. budget, schedule etc .) become more relistic as work progresses, because important issues discoved earlier. It is more able to cope with the changes that are software development generally entails. Software engineers can get their hands in and start woring on the core of a project earlier.

APPLICATION DEVELOPMENT N-TIER APPLICATIONS N-Tier Applications can easily implement the concepts of Distributed Application Design and Architecture. The N-Tier Applications provide strategic benefits to Enterprise Solutions. While 2tier, client-server can help us create quick and easy solutions and may be used for Rapid Prototyping, they can easily become a maintenance and security night mare The N-tier Applications provide specific advantages that are vital to the business continuity of the enterprise. Typical features of a real life n-tier may include the following: Security Availability and Scalability Manageability Easy Maintenance Data Abstraction

The above mentioned points are some of the key design goals of a successful n-tier application that intends to provide a good Business Solution.

DEFINITION Simply stated, an n-tier application helps us distribute the overall functionality into various tiers or layers: Presentation Layer Business Rules Layer Data Access Layer Database/Data Store

Each layer can be developed independently of the other provided that it adheres to the standards and communicates with the other layers as per the specifications. This is the one of the biggest advantages of the n-tier application. Each layer can potentially treat the other layer as a Block-Box. In other words, each layer does not care how other layer processes the data as long as it sends the right data in a correct format.

Fig -N-Tier Architecture

1. THE PRESENTATION LAYER Also called as the client layer comprises of components that are dedicated to presenting the data to the user. For example: Windows/Web Forms and buttons, edit boxes, Text boxes, labels, grids, etc. 2. THE BUSINESS RULES LAYER This layer encapsulates the Business rules or the business logic of the encapsulations. To have a separate layer for business logic is of a great advantage. This is because any changes in Business Rules can be easily handled in this layer. As long as the interface between the layers remains the same, any changes to the functionality/processing logic in this layer can be made without impacting the others. A lot of client-server apps failed to implement successfully as changing the business logic was a painful process. 3. THE DATA ACCESS LAYER This layer comprises of components that help in accessing the Database. If used in the right way, this layer provides a level of abstraction for the database structures. Simply put changes made to the database, tables, etc do not affect the rest of the application because of the Data Access layer. The different application layers send the data requests to this layer and receive the response from this layer. 4. THE DATABASE LAYER This layer comprises of the Database Components such as DB Files, Tables, Views, etc. The Actual database could be created using SQL Server, Oracle, Flat files, etc. In an n-tier application, the entire application can be implemented in such a way that it is independent of the actual Database. For instance, you could change the Database Location with minimal changes to Data Access Layer. The rest of the Application should remain unaffected.

UML Diagrams: Use case

Browse Secrete Image

SElecting no. of Shares

SENDER Encryption of Shares SYSTEM

Sending of Shares

RECEPIENT

Decryption of Shares

CLASSDIAGRAM:
class Class Model Runnable Encryptor ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + + + + + + + + + + + + + + + + + BLACKPIXEL: int = (255 << 24) {readOnly} m_Cblack: IntMatrix ([]) m_Cwhite: IntMatrix ([]) m_pixels: Pixel ([][]) m_resultFoil: Foil m_rnd: Random = new SecureRandom() m_sequence: ArrayList m_sourceFoil: Foil m_wEnc: int m_wSrc: int THRESHOLD: int = 128 {readOnly} WHITEPIXEL: int = (255 << 24) | (... {readOnly} computeSubpixel() : void doPermutation() : void encrypt() : void Encryptor(int, int, int) getDescription() : String getEncryptedFoils() : Vector getFactorHeight() : int getFactorWidth() : int getMaxSubpixel() : int getPermutationInstance() : Permutation getRandom() : int getWidthEnc() : int grabImage(Image, int[], int, int) : void initEncrypt(Image) : boolean overlayFoils(boolean[]) : void setImage(Image) : void setM_Foils(Vector) : void setMatrixToPixel(int[]) : void ~ ~ ~ ~ ~ ~ ~ ~ ~ + + + + + + + + + + + Dispatcher GREYPIC: String = "monalisa.jpg" {readOnly} HEIGHT: int = 100 {readOnly} m_applet: VCApplet m_loadImage: Image m_loadImage2: Image m_nrOfFoils: int m_option: int = NOOPTION m_ovlImagePanel: ImagePanel = new ImagePanel(... m_srcImagePanel: ImagePanel = new ImagePanel(... Dispatcher(VCApplet) getAccessStructure() : boolean[] getCurrentFoil() : int getSrcCanvas() : ImagePanel getVctype() : int initNewMode() : void loadAsEncFoil(File[]) : boolean loadImage(File) : void saveAll() : void saveCurrent() : void zoom() : void

~m_encryptor Pixel ~ ~ ~ ~m_pixels ~ ~ + + + + + + + m_color: int m_cryptMatrix: IntMatrix m_maxFoil: int m_maxSubpixel: int m_subPixel: int ([][]) computeSubpixels() : void getColor() : int getSubpixel(int, int) : int isInSet(int[], int) : boolean Pixel(int, int) setColor(int) : void setMatrix(IntMatrix) : void

Enc2_2_Grey ~ ~ ~ ~ ~ ~ ~ ~ ~ + + + + + + + + + DESCRIPTION: String = "creates two tr... {readOnly} m_Grey0: IntMatrix ([]) m_Grey1: IntMatrix ([]) m_Grey2: IntMatrix ([]) m_Grey3: IntMatrix ([]) m_initMatrixG0: IntMatrix m_initMatrixG1: IntMatrix m_initMatrixG2: IntMatrix m_initMatrixG3: IntMatrix doPermutation() : void Enc2_2_Grey(int, int, int) getDescription() : String getFactorHeight() : int getFactorWidth() : int getFoil(int) : Foil getMaxSubpixel() : int getPermutationInstance() : Permutation setMatrixToPixel(int[]) : void ~ + + + + + + +

Enc2_2 DESCRIPTION: String = "This is the ba... {readOnly} Enc2_2(int, int, int) getDescription() : String getFactorHeight() : int getFactorWidth() : int getFoil(int) : Foil getMaxSubpixel() : int getPermutationInstance() : Permutation

class Class Model

ClassUtil ImageIconLoader {leaf} + + ms_iconCache: Hashtable = new Hashtable() ImageIconLoader() loadImageIcon(String) : ImageIcon loadImageIcon(String, boolean) : ImageIcon + + + + + + + + + {leaf} FILE: String = "file:" {readOnly} JAR_FILE: String = "jar:file:" {readOnly} ms_loadedClasses: Hashtable = new Hashtable() ms_loadedDirectories: Vector = new Vector() ClassUtil() findSubclasses(Class) : Vector getCallingClassStatic() : Class getClassDirectory(Class) : File getClassStatic() : Class getFirstClassFound(File) : Class getShortClassName(Class) : String loadClasses() : Enumeration loadClasses(Class) : Enumeration loadClassesInternal(Class) : void toClass(File, File) : Class toRelativeResourcePath(Class) : String

ResourceLoader {leaf} + + DIR_UP: String = "../" {readOnly} ms_classpath: String ms_classpathFiles: Vector ms_classpathResourceTypes: Vector SYSTEM_RESOURCE_TYPE_FILE: String = "FILE" {readOnly} SYSTEM_RESOURCE_TYPE_JAR: String = "JAR" {readOnly} SYSTEM_RESOURCE_TYPE_ZIP: String = "ZIP" {readOnly} createByteArrayInstantiator() : ByteArrayInstantiator createFileTypeInstantiator() : FileTypeInstanti ator formatResourcePath(String) : String getCurrentResourcePath(File, File) : String getCurrentResourcePath(ZipEntry) : String getResourceURL(String) : URL readFilesFromClasspath() : Vector replaceFileSeparatorsSystemSpecific(String) : String ResourceLoader() trimByteArray(byte[], int, byte[]) : byte[]

ImageDescriptor + + + + + + + + + + + + byte_: byte height_: short leftPosition_: short separator_: byte topPosition_: short width_: short ImageDescriptor(short, short, char) SetInterlaceFlag(byte) : void SetLocalColorTableFlag(byte) : void SetLocalColorTableSize(byte) : void SetReserved(byte) : void SetSortFlag(byte) : void Write(OutputStream) : void

Sequence Diagram:

: SENDER

BROWSE BROWSED FILE DISPLAYED

: SY STEM BROWISING

: RECEPIENT

MODE

M ODES ENA BLED

ENCRYPT
ENCRIPTING SHARES

DISPLAYING ENCRPYTED SHARES

SEND ENCRPYTED SHARES


SENDING ENCRYPTED SHARES

ENCRYPTED SHARES DISPLAYED

DECRYPT SHARES
DECRYPTING SHA RES

INFORMATION DISPLAYED

Activity Diagram:

START

SELECT IMAGE MODE

ENCRYPT IMAGE GENERATE SHARES

SEND SHARES

RECEIVE SHARES

DECRYTED IMAGE

END

Chapter 04

PROCESS SPECIFICATION:

INPUT DESIGN: The input design is the link between the information system and the user. It comprises the developing specification and procedures for data preparation and those steps are necessary to put transaction data in to a usable form for processing can be achieved by inspecting the computer to read data from a written or printed document or it can occur by having people keying the data directly into the system. The design of input focuses on controlling the amount of input required, controlling the errors, avoiding delay, avoiding extra steps and keeping the process simple. The input is designed in such a way so that it provides security and ease of use with retaining the privacy. Input Design considered the following things: What data should be given as input? How the data should be arranged or coded? The dialog to guide the operating personnel in providing input. Methods for preparing input validations and steps to follow when error occur. OBJECTIVES: 1.Input Design is the process of converting a user-oriented description of the input into a computer-based system. This design is important to avoid errors in the data input process and show the correct direction to the management for getting correct information from the computerized system. 2. It is achieved by creating user-friendly screens for the data entry to handle large volume of data. The goal of designing input is to make data entry easier and to be free from errors. The data entry screen is designed in such a way that all the data manipulates can be performed. It also provides record viewing facilities.

3.When the data is entered it will check for its validity. Data can be entered with the help of screens. Appropriate messages are provided as when needed so that the user will not be in maize of instant. Thus the objective of input design is to create an input layout that is easy to follow OUTPUT DESIGN: A quality output is one, which meets the requirements of the end user and presents the information clearly. In any system results of processing are communicated to the users and to other system through outputs. In output design it is determined how the information is to be displaced for immediate need and also the hard copy output. It is the most important and direct source information to the user. Efficient and intelligent output design improves the systems relationship to help user decision-making. 1. Designing computer output should proceed in an organized, well thought out manner; the right output must be developed while ensuring that each output element is designed so that people will find the system can use easily and effectively. When analysis design computer output, they should Identify the specific output that is needed to meet the requirements. 2.Select methods for presenting information. 3.Create document, report, or other formats that contain information produced by the system. The output form of an information system should accomplish one or more of the following objectives. Convey information about past activities, current status or projections of the Future. Signal important events, opportunities, problems, or warnings. Trigger an action. Confirm an action.

TECHNIQUES AND ALGORITHM USED:

In this technology, the end user identifies an image, which is going to act as the carrier of data. The data file is also selected and then to achieve greater speed of transmission the data file and image file are compressed and sent. Prior to this the data is embedded into the image and then sent. The image if hacked or interpreted by a third party user will open up in any image previewed but not displaying the data. This protects the data from being invisible and hence is secure during transmission. The user in the receiving end uses another piece of code to retrieve the data from the image.

ALGORITHM:
Input: The c x d dithering matrix D and a pixel with gray-level g in input image I. Output: The halftoned pattern at the position of the pixel For i=0 to c-1 do For j=0 to d-1 to do If g<=Dij then print a black pixel at position (i,j); Else print a white pixel at position (i,j); For embedding

SCREEN HOTS:

Fig: User interface which allows the users to work with Steganography tool

To encrypt a image proceed with the following procedure: Select file menu Select load file sub menu Load .gif or .png formatted images

Fig: We can select mode of encryption by selecting Mode menu

Fig: Generate encrypted transparencies submenu generates transparencies

Fig: decrypted image

Fig: Zooming option supports zooming of transparencies

Chapter 04

TECHNOLOGY DESCRIPTION:
JAVA TECHNOLOGY: Java technology is both a programming language and a platform. The Java Programming Language The Java programming language is a high-level language that can be characterized by all of the following buzzwords: Simple Architecture neutral Object oriented Portable Distributed High performance Interpreted Multithreaded Robust Dynamic Secure

With most programming languages, you either compile or interpret a program so that you can run it on your computer. The Java programming language is unusual in that a program is both compiled and interpreted. With the compiler, first you translate a program into an intermediate language called Java byte codes the platform-independent codes interpreted by the interpreter on the Java platform. The interpreter parses and runs each Java byte code instruction on the computer. Compilation happens just once; interpretation occurs each time the program is executed. The following figure illustrates how this works.

You can think of Java byte codes as the machine code instructions for the Java Virtual Machine (Java VM). Every Java interpreter, whether its a development tool or a Web browser that can run applets, is an implementation of the Java VM. Java byte codes help make write once, run anywhere possible. You can compile your program into byte codes on any platform that has a Java compiler. The byte codes can then be run on any implementation of the Java VM. That means that as long as a computer has a Java VM, the same program written in the Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac.

The Java Platform A platform is the hardware or software environment in which a program runs. Weve already mentioned some of the most popular platforms like Windows 2000, Linux, Solaris, and MacOS. Most platforms can be described as a combination of the operating system and hardware. The Java platform differs from most other platforms in that its a software-only platform that runs on top of other hardware-based platforms. The Java platform has two components:

The Java Virtual Machine (Java VM)

The Java Application Programming Interface (Java API)

Youve already been introduced to the Java VM. Its the base for the Java platform and is ported onto various hardware-based platforms. The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages. The next section, What Can Java Technology Do? Highlights what functionality some of the packages in the Java API provide. The following figure depicts a program thats running on the Java platform. As the figure shows, the Java API and the virtual machine insulate the program from the hardware.

Native code is code that after you compile it, the compiled code runs on a specific hardware platform. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time byte code compilers can bring performance close to that of native code without threatening portability. What Can Java Technology Do? The most common types of programs written in the Java programming language are applets and applications. If youve surfed the Web, youre probably already familiar with applets. An applet is a program that adheres to certain conventions that allow it to run within a Java-enabled browser. However, the Java programming language is not just for writing cute, entertaining applets for the Web. The general-purpose, high-level Java programming language is also a powerful software platform. Using the generous API, you can write many types of programs. An application is a standalone program that runs directly on the Java platform. A special kind of application known as a server serves and supports clients on a network. Examples of servers are Web servers, proxy servers, mail servers, and print servers. Another specialized program is a servlet. A servlet can almost be thought of as an applet that runs on the server side. Java Servlets are a popular choice for building interactive web applications, replacing the use of CGI scripts.

Servlets are similar to applets in that they are runtime extensions of applications. Instead of working in browsers, though, servlets run within Java Web servers, configuring or tailoring the server. How does the API support all these kinds of programs? It does so with packages of software components that provides a wide range of functionality. Every full implementation of the Java platform gives you the following features:

The essentials: Objects, strings, threads, numbers, input and output, data structures, system properties, date and time, and so on. Applets: The set of conventions used by applets. Networking: URLs, TCP (Transmission Control Protocol), UDP (User Data gram Protocol) sockets, and IP (Internet Protocol) addresses. Internationalization: Help for writing programs that can be localized for users worldwide. Programs can automatically adapt to specific locales and be displayed in the appropriate language.

Security: Both low level and high level, including electronic signatures, public and private key management, access control, and certificates. Software components: Known as JavaBeansTM, can plug into existing component architectures. Object serialization: Allows lightweight persistence and communication via Remote Method Invocation (RMI). Java Database Connectivity (JDBCTM): Provides uniform access to a wide range of relational databases.

The Java platform also has APIs for 2D and 3D graphics, accessibility, servers, collaboration, telephony, speech, animation, and more. The following figure depicts what is included in the Java 2 SDK.

How Will Java Technology Change My Life? We cant promise you fame, fortune, or even a job if you learn the Java programming language. Still, it is likely to make your programs better and requires less effort than other languages. We believe that Java technology will help you do the following:

Get started quickly: Although the Java programming language is a powerful object-oriented language, its easy to learn, especially for programmers already familiar with C or C+ +.

Write less code: Comparisons of program metrics (class counts, method counts, and so on) suggest that a program written in the Java programming language can be four times smaller than the same program in C++.

Write better code: The Java programming language encourages good coding practices, and its garbage collection helps you avoid memory leaks. Its object orientation, its JavaBeans component architecture, and its wide-ranging, easily extendible API let you reuse other peoples tested code and introduce fewer bugs.

Develop programs more quickly: Your development time may be as much as twice as fast versus writing the same program in C++. Why? You write fewer lines of code and it is a simpler programming language than C++.

Avoid platform dependencies with 100% Pure Java: You can keep your program portable by avoiding the use of libraries written in other languages. The 100% Pure JavaTM Prod-

uct Certification Program has a repository of historical process manuals, white papers, brochures, and similar materials online.

Write once, run anywhere: Because 100% Pure Java programs are compiled into machine-independent byte codes, they run consistently on any Java platform. Distribute software more easily: You can upgrade applets easily from a central server. Applets take advantage of the feature of allowing new classes to be loaded on the fly, without recompiling the entire program.

JAVA HA TWO THINGS: A PROGRAMMING LANGUAGE AND A PLATFORM. JAVA IS A HIGH-LEVEL PROGRAMMING LANGUAGE THAT IS ALL OF THE FOLLOWING

SIMPLE OBJECT-ORIENTED DISTRIBUTED

ARCHITECTURE-NEUTRAL PORTABLE

HIGH-PERFORMANCE INTERPRETED ROBUST SECURE


MULTITHREADED

DYNAMIC

JAVA WITH JAVA

IS ALSO UNUSUAL IN THAT EACH A COMPILE YOU TRANSLATE A

JAVA

PROGRAM IS BOTH COMPILED AND INTERPRETED .

JAVA

PROGRAM INTO AN INTERMEDIATE LANGUAGE CALLED

BYTE CODES THE PLATFORM -INDEPENDENT CODE INSTRUCTION IS PASSED AND RUN ON THE

COMPUTER.

COMPILATION
EXECUTED.

HAPPENS JUST ONCE; INTERPRETATION OCCURS EACH TIME THE PROGRAM IS

THE FIGURE ILLUSTRATES HOW THIS WORKS.

Java Program

Interpreter

Compilers

My Program

YOU

CAN THINK OF

JAVA

BYTE CODES AS THE MACHINE CODE INSTRUCTIONS FOR THE INTERPRETER, WHETHER ITS A

JAVA JAVA

VIRTUAL MACHINE (JAVA VM). EVERY JAVA


DEVELOPMENT TOOL OR A OF THE

WEB

BROWSER THAT CAN RUN

JAVA

APPLETS, IS AN IMPLEMENTATION

JAVA VM. THE JAVA VM CAN ALSO BE IMPLEMENTED IN HARDWARE.

JAVA
YOUR

BYTE CODES HELP MAKE

WRITE

ONCE, RUN ANYWHERE POSSIBLE .

YOU

CAN COMPILE

JAVA

PROGRAM INTO BYTE CODES ON MY PLATFORM THAT HAS A

JAVA

COMPILER.

THE

BYTE CODES CAN THEN BE RUN ANY IMPLEMENTATION OF THE SAME

JAVA VM. FOR

EXAMPLE, THE

JAVA PROGRAM CAN RUN WINDOWS NT, SOLARIS, AND MACINTOSH.

Networking TCP/IP stack The TCP/IP stack is shorter than the OSI one:

TCP is a connection-oriented protocol; UDP (User Datagram Protocol) is a connectionless protocol.

IP datagrams The IP layer provides a connectionless and unreliable delivery system. It considers each datagram independently of the others. Any association between datagram must be supplied by the higher layers. The IP layer supplies a checksum that includes its own header. The header includes the source and destination addresses. The IP layer handles routing through an Internet. It is also responsible for breaking up large datagram into smaller ones for transmission and reassembling them at the other end.

UDP UDP is also connectionless and unreliable. What it adds to IP is a checksum for the contents of the datagram and port numbers. These are used to give a client/server model - see later.

TCP TCP supplies logic to give a reliable connection-oriented protocol above IP. It provides a virtual circuit that two processes can use to communicate. Internet addresses In order to use a service, you must be able to find it. The Internet uses an address scheme for machines so that they can be located. The address is a 32 bit integer which gives the IP address. This encodes a network ID and more addressing. The network ID falls into various classes according to the size of the network address. Network address Class A uses 8 bits for the network address with 24 bits left over for other addressing. Class B uses 16 bit network addressing. Class C uses 24 bit network addressing and class D uses all 32. Subnet address Internally, the UNIX network is divided into sub networks. Building 11 is currently on one sub network and uses 10-bit addressing, allowing 1024 different hosts. Host address 8 bits are finally used for host addresses within our subnet. This places a limit of 256 machines that can be on the subnet.

Total address

The 32 bit address is usually written as 4 integers separated by dots. Port addresses A service exists on a host, and is identified by its port. This is a 16 bit number. To send a message to a server, you send it to the port for that service of the host that it is running on. This is not location transparency! Certain of these ports are "well known".

Sockets A socket is a data structure maintained by the system to handle network connections. A socket is created using the call socket. It returns an integer that is like a file descriptor. In fact, under Windows, this handle can be used with Read File and Write File functions. #include <sys/types.h> #include <sys/socket.h> int socket(int family, int type, int protocol); Here "family" will be AF_INET for IP communications, protocol will be zero, and type will depend on whether TCP or UDP is used. Two processes wishing to communicate over a network create a socket each. These are similar to two ends of a pipe - but the actual pipe does not yet exist.

JFree Chart JFreeChart is a free 100% Java chart library that makes it easy for developers to display professional quality charts in their applications. JFreeChart's extensive feature set includes: A consistent and well-documented API, supporting a wide range of chart types; A flexible design that is easy to extend, and targets both server-side and client-side applications; Support for many output types, including Swing components, image files (including PNG and JPEG), and vector graphics file formats (including PDF, EPS and SVG); JFreeChart is "open source" or, more specifically, free software. It is distributed under the terms of the GNU Lesser General Public Licence (LGPL), which permits use in proprietary applications. 1. Map Visualizations Charts showing values that relate to geographical areas. Some examples include: (a) population density in each state of the United States, (b) income per capita for each country in Europe, (c) life expectancy in each country of the world. The tasks in this project include: Sourcing freely redistributable vector outlines for the countries of the world, states/provinces in particular countries (USA in particular, but also other areas); Creating an appropriate dataset interface (plus default implementation), a rendered, and integrating this with the existing XYPlot class in JFreeChart; Testing, documenting, testing some more, documenting some more. 2. Time Series Chart Interactivity Implement a new (to JFreeChart) feature for interactive time series charts --- to display a separate control that shows a small version of ALL the time series data, with a sliding "view" rectangle that allows you to select the subset of the time series data to display in the main chart.

3. Dashboards There is currently a lot of interest in dashboard displays. Create a flexible dashboard mechanism that supports a subset of JFreeChart chart types (dials, pies, thermometers, bars, and lines/time series) that can be delivered easily via both Java Web Start and an applet. 4. Property Editors The property editor mechanism in JFreeChart only handles a small subset of the properties that can be set for charts. Extend (or reimplement) this mechanism to provide greater end-user control over the appearance of the charts.

How to run: Open netbeans ide In netbeans Click on file->open project Browse project folder VCapplte1 and run See video in how to run video fo;der

Coding: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jb; import java.awt.Image; import java.awt.image.ImageObserver; import java.awt.image.ImageProducer; import java.awt.image.PixelGrabber; import java.security.SecureRandom; import java.util.ArrayList; import java.util.Random; import java.util.Vector; /** abstract class for doing encryption with visual cryptography and * for getting the result of the foils * @author Bole Johannes * */ public abstract class Encryptor { /**Pixel colors - represented as byte alpha | byte red | byte green | byte blue*/ final int WHITEPIXEL = (255 << 24) | (255 << 16) | (255 << 8) | 255; final int BLACKPIXEL = (255 << 24); /** the threshold of this scheme * used to decide the pixel color*/ final int THRESHOLD = 128; /** Instance of SecureRandom()*/ Random m_rnd = new SecureRandom(); /** height source pic*/ int m_hSrc; /** width of the source pic*/ int m_wSrc; /** height of the encrypted and result pic*/ int m_hEnc; /** width of the encrypted and result pic*/ int m_wEnc; /** Pixel[][] to store the pixels of a pic. Each Pixel

* contains several Subpixel on several Foils * represented by an IntMatrix */ Pixel m_pixels[][]; /** Vector m_foils to store the encrypted Pics*/ Vector m_foils; /** store the Foil with the source*/ Foil m_sourceFoil; /** store the Foil with the result*/ Foil m_resultFoil; /** ArrayList to store the sequence of the random*/ ArrayList m_sequence; /** the number of foils used for this scheme * it is initialized by the constructor */ int m_maxFoil; /** the number of subpixel used for a concrete scheme * it is initialized by the abstract method * @link{Encryptor#getMaxSubpixel()} */ int m_maxSubpixel; /** the number of the permutations which are possible * it is initialized by the constructor in dependeny of * the instance of permutation */ int m_maxPerm; /** the instance of the permutation*/ Permutation m_permutation; /** store the init-matrices*/ IntMatrix m_initMatrixC0, m_initMatrixC1; /** store the permuted init-matrices as an Array for black and white*/ IntMatrix m_Cblack[], m_Cwhite[]; /** * Constructs an ImageEncrypter with given dimensions and * the number of foils * * @param height - height of image * @param width - width of image * @param maxFoil - number of foils */ public Encryptor(int height, int width, int maxFoil) { System.out.println(" Encryptor: init with " + maxFoil);

//

m_maxFoil = maxFoil; //set dimensions m_hSrc = height; m_wSrc = width; m_hEnc = this.getFactorHeight() * m_hSrc; m_wEnc = this.getFactorWidth() * m_wSrc; //init the Vector and the ArrayList m_foils = new Vector(); m_sequence = new ArrayList(); m_maxSubpixel = this.getMaxSubpixel(); m_permutation = this.getPermutationInstance(); m_maxPerm = m_permutation.getTotal(); } /** returns a Description of this VisualCryptography * mode * @return - description of this mode */ public abstract String getDescription(); /** returns the number of the foils used for this scheme * * @return number of the foils */ public abstract int getMaxSubpixel(); /** returns an instance of Permutation * * @return a instance of Permutation */ public abstract Permutation getPermutationInstance(); /** returns a factor, alternatively how many subpixel * there are in a row * * @return number of subpixel per row */ public abstract int getFactorWidth(); /** returns a factor, alternatively how many subpixel * there are in a column * @return number of subpixel in a column */ public abstract int getFactorHeight(); /** extracts a encrypted pic from the Pixel[] and * wraps it in a Foil * @param numberOfFoil which foil to extract * @return a foil with an encrypted pic */ public abstract Foil getFoil(int numberOfFoil);

/** prepares the encryption by calling @link{#setImage(Image)} * and performs @link{#encrypt()} * * @param newImage the image to encrypt */ public boolean initEncrypt(Image newImage){ this.doPermutation(); this.setImage(newImage); return true; } /** method to create all possible permutations of a * init matrix * */ public void doPermutation(){ m_Cwhite = new IntMatrix[m_maxPerm]; m_Cblack = new IntMatrix[m_maxPerm]; int[][] orderArray = m_permutation.getPermArray(); Vector c0 = m_initMatrixC0.getPermMatrixVector(orderArray); Vector c1 = m_initMatrixC1.getPermMatrixVector(orderArray); for(int i=0; i<m_maxPerm; i++){ m_Cwhite[i] = (IntMatrix)c0.get(i); m_Cblack[i] = (IntMatrix)c1.get(i); } } /** prepares an given image to be encrypted * it calls a PixelGrabber and grabs the pixel of * the image. There are done some further steps * to encrypt a picture. * * @param newImage - the image to encrypt */ public void setImage(Image newImage){ int[] tempPix = new int[m_hSrc * m_wSrc]; // array for grabbing pic this.grabImage(newImage, tempPix,m_wSrc,m_hSrc); //init the pixels m_pixels = new Pixel[m_hSrc][m_wSrc]; for (int y = 0; y < m_hSrc; y++) { for (int x = 0; x < m_wSrc; x++) { m_pixels[x][y] = new Pixel(m_maxFoil, m_maxSubpixel); }

} m_sourceFoil = new Foil(tempPix,m_wSrc,m_hSrc); } /** Grabs the pixel of an given image to the given int[] * * @param newImage - the image to grab * @param tempPix - the int[] to store the rastered pic * @return tempPix - with the rastered pic */ public void grabImage(Image newImage, int[] tempPix, int width, int height) { // read picture and copy to array System.out.println(" Encryptor: grabbing image"); PixelGrabber pixelGrabber = new PixelGrabber(newImage, 0, 0, width, height, tempPix, 0, width); try { //System.out.println(pixelGrabber.getColorModel()+""); pixelGrabber.grabPixels(); } catch (InterruptedException e) { System.err.println(" Error: interrupted waiting for pixels"); } if ((pixelGrabber.getStatus() & ImageObserver.ABORT) != 0) { System.err.println(" Error: image fetch aborted or errored"); } } /** sets up the pixels by giving a matrix and the original colour * * @param tempPix */ public void setMatrixToPixel(int[] tempPix){ // store grabbed image for encryption System.out.println(" Encryptor: setting matrix to each Pixel"); for (int y = 0; y < m_hSrc; y++) { for (int x = 0; x < m_wSrc; x++) { int pixel = tempPix[x + y * m_hSrc]; m_pixels[x][y].setColor(pixel); int red = (pixel >> 16) & 0xff; int green = (pixel >> 8) & 0xff; int blue = (pixel ) & 0xff; int factor = (int) (red * 0.299 + green * 0.587 + blue * 0.114); if (factor >THRESHOLD) { m_pixels[x][y].setMatrix(m_Cwhite[this.getRandom()]); } else {

//

m_pixels[x][y].setMatrix(m_Cblack[this.getRandom()]); } } }//end for - store }//end prepareMatrix /** * Encrypts the image and saves the encrypted images * in a vector named m_foils * */ public void encrypt() { System.out.println(" Encryptor: encrypting"); int[] tempPix = m_sourceFoil.getGrabbedImage(); this.setMatrixToPixel(tempPix); this.computeSubpixel(); m_foils.clear(); m_foils = getEncryptedFoils(); } /** stores all foils with encrypted pics to * a vector and returns it * @return a vector with the encrypted pic foils */ private Vector getEncryptedFoils(){ Vector v = new Vector(); for(int i = 0; i<m_maxFoil; i++){ v.add(i,this.getFoil(i)); } return v; } /** computes the subpixels, calls for each subpixel * the @link{Pixel#computeSubpixel()} * */ public void computeSubpixel(){ for (int y = 0; y < m_hSrc; y++) { for (int x = 0; x < m_wSrc; x++) { m_pixels[x][y].computeSubpixels(); } } } /** * Returns a random number, which is a valid number of a permutation. * This means that, it is 0 <= rnd < m_maxPerm

//

*/ public int getRandom() { int random = java.lang.Math.abs(m_rnd.nextInt()) % m_maxPerm; m_sequence.add(new Integer(random)); return random; } /** generates the foil by directly computing the * overlay of the foils * @param set - the number of foils which shall be overlayed */ public void overlayFoils(boolean[] set){ Foil result = null; if(set != null){ for(int i=0; i<set.length && i<m_maxFoil; i++){ if(set[i]){ Foil foil = (Foil)m_foils.get(i); if(result==null){ result = foil; }else{ result = result.computeOverlayOfTwoFoils(foil); } } } } if(result==null){ result = new Foil(new int[m_wEnc*m_hEnc], m_wEnc, m_hEnc); } m_resultFoil = result; } /** Returns the rastered original image. * * @return ImageProducer for the original image */ public ImageProducer getImageProducerSource(){ return m_sourceFoil.getImage(); } /** Returns the image of the encrypted foils. * * @param foilNr - number of foil to return * @return ImageProducer for the foil image */ public ImageProducer getImageProducerEncrypted(int foilNr) { Foil f = (Foil)m_foils.get(foilNr); Foil f = this.getFoil(foilNr);

//

return f.getImage(); } /** Returns the image of the encrypted foils. * * @param foilNr - number of foil to return * @return ImageProducer for the foil image */ public ImageProducer getImageProducerEncryptedFromVector(int foilNr) { Foil f = (Foil)m_foils.get(foilNr); return f.getImage(); } /** Returns the image of the overlayed foils. * * @return ImageProducer for the overlayed foils image */ public ImageProducer getImageProducerOverlay(){ return m_resultFoil.getImage(); } /** * @return Returns the height of the encrypted Pic */ public int getHeightEnc() { return m_hEnc; } /** * @return Returns the width of the encrypted Pic */ public int getWidthEnc() { return m_wEnc; } /** * @return Returns the m_initMatrixC0. */ public IntMatrix getInitMatrixC0() { return m_initMatrixC0; } /** * @return Returns the m_initMatrixC1. */ public IntMatrix getInitMatrixC1() { return m_initMatrixC1; }

/** sets the given vector to the vector which is used * to save the foils for decryption * @param foils - the new loaded Foils */ public void setM_Foils(Vector foils){ m_foils = foils; } /** * @return m_foils - the vector with the encrypted foils */ public Vector getM_Foils(){ return m_foils; } } _____________________________________________________________________________ /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jb; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JFileChooser; /** ImagePreview was taken from the Java Tutorial of Sun. * It is used by FileChooserDemo2.java. * * @author Sun; java.sun.com */ public class ImagePreview extends JComponent implements PropertyChangeListener { /** * */ private static final long serialVersionUID = 5185303551796533267L;

ImageIcon thumbnail = null; File file = null; public ImagePreview(JFileChooser fc) { setPreferredSize(new Dimension(100, 50)); fc.addPropertyChangeListener(this); } public void loadImage() { if (file == null) { thumbnail = null; return; } ImageIcon tmpIcon = new ImageIcon(file.getPath()); if (tmpIcon != null) { if (tmpIcon.getIconWidth() > 90) { thumbnail = new ImageIcon(tmpIcon.getImage().getScaledInstance(90, -1,Image.SCALE_DEFAULT)); } else { //no need to miniaturize thumbnail = tmpIcon; } } } public void propertyChange(PropertyChangeEvent e) { boolean update = false; String prop = e.getPropertyName(); //If the directory changed, don't show an image. if (JFileChooser.DIRECTORY_CHANGED_PROPERTY.equals(prop)) { file = null; update = true; //If a file became selected, find out which one. } else if (JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(prop)) { file = (File) e.getNewValue(); update = true; } //Update the preview accordingly. if (update) { thumbnail = null; if (isShowing()) { loadImage(); repaint(); }

} } protected void paintComponent(Graphics g) { if (thumbnail == null) { loadImage(); } if (thumbnail != null) { int x = getWidth()/2 - thumbnail.getIconWidth()/2; int y = getHeight()/2 - thumbnail.getIconHeight()/2; if (y < 0) { y = 0; } if (x < 5) { x = 5; } thumbnail.paintIcon(this, g, x, y); } } }

/* * To change this template, choose Tools | Templates * and open the template in the editor. */

Chapter 06 TYPE OF TESTING: BLOCK & WHITE BOX TESTING: Black Box Testing Black Box Testing is testing the software without any knowledge of the inner workings, structure or language of the module being tested. Black box tests, as most other kinds of tests, must be written from a definitive source document, such as specification or requirements document, such as specification or requirements document. It is a testing in which the software under test is treated, as a black box .you cannot see into it. The test provides inputs and responds to outputs without considering how the software works. White Box Testing White Box Testing is a testing in which in which the software tester has knowledge of the inner workings, structure and language of the software, or at least its purpose. It is purpose. It is used to test areas that cannot be reached from a black box level. UNIT TESTING: Unit testing is usually conducted as part of a combined code and unit test phase of the software lifecycle, although it is not uncommon for coding and unit testing to be conducted as two distinct phases. Test strategy and approach Field testing will be performed manually and functional tests will be written in detail.

Test objectives All field entries must work properly.

Pages must be activated from the identified link. The entry screen, messages and responses must not be delayed.

Features to be tested Verify that the entries are of the correct format No duplicate entries should be allowed

All links should take the user to the correct page. 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. INTEGRATION TESTING: Software integration testing is the incremental integration testing of two or more integrated software components on a single platform to produce failures caused by interface defects. The task of the integration test is to check that components or software applications, e.g. components in a software system or one step up software applications at the company level interact without error.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.

FUNCTIONAL TESTING: Functional tests provide systematic demonstrations that functions tested are available as specified by the business and technical requirements, system documentation, and user manuals. Functional testing is centered on the following items: Valid Input Invalid Input Functions Output : identified classes of valid input must be accepted. : identified classes of invalid input must be rejected. : identified functions must be exercised. : identified classes of application outputs must be exercised.

Systems/Procedures : interfacing systems or procedures must be invoked. Organization and preparation of functional tests is focused on requirements, key functions, or special test cases. In addition, systematic coverage pertaining to identify Business process flows; data fields, predefined processes, and successive processes must be considered for testing. Before functional testing is complete, additional tests are identified and the effective value of current tests is determined. TEST CASE TABLE: TABLE: A database is a collection of data about a specific topic. VIEWS OF TABLE: We can work with a table in two types, 1. Design View 2. Datasheet View

Design View To build or modify the structure of a table we work in the table design view. We can specify what kind of data will be hold. Datasheet View To add, edit or analyses the data itself we work in tables datasheet view mode. QUERY: A query is a question that has to be asked the data. Access gathers data that answers the question from one or more table. The data that make up the answer is either dynaset (if you edit it) or a snapshot (it cannot be edited).Each time we run query, we get latest information in the dynaset. Access either displays the dynaset or snapshot for us to view or perform an action on it, such as deleting or updating.

Chapter 07 CONCLUSION:
In this paper, we proposed a construction of EVCS which was realized by embedding the random shares into the meaningful covering shares. 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. We also proposed a method to improve the visual quality of the share images. According to comparisons with many of the well-known EVCS in the literature the proposed embedded EVCS 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.

LIMITATIONS & FUTURE ENHANCEMENTS:


In this paper, we propose a construction of EVCS which is realized by embedding random shares into meaningful covering shares, and we call it the embedded EVCS. Experimental results compare some of the well-known EVCSs proposed in recent years systematically, and show that the proposed embedded EVCS has competitive visual quality compared with many of the well-known EVCSs in the literature. In addition, it has many specific advantages against these well-known EVCSs, respectively.

REFERENCE & BIBLIOGRAPHY:

[1] A. Shamir, How to share a secret, Commun. ACM, vol. 22, no. 11, pp. 612613, 1979. [2] G. R. Blakley, Safeguarding cryptographic keys, in Proc. National Computer Conf., 1979, vol. 48, pp. 313317. [3] M. Naor and A. Shamir, Visual cryptography, in Proc. EUROCRYPT 94, Berlin, Germany, 1995, vol. 950, pp. 112, Springer-Verlag, LNCS. [4] M. Naor and B. Pinkas, Visual authentication and identification, in Proc. CRYPTO97, 1997, vol. 1294, pp. 322336, Springer-Verlag LNCS. [5] T. H. Chen and D. S. Tsai, Owner-customer right protection mechanism using a watermarking scheme and a watermarking protocol, Pattern Recognit., vol. 39, pp. 15301541, 2006. [6] P. Tuyls, T. Kevenaar, G. J. Schrijen, T. Staring, and M. Van Dijk, Security displays enabling secure communications, in Proc. First Int. Conf. Pervasive Computing, Boppard Germany, Springer-Verlag Berlin LNCS, 2004, vol. 2802, pp. 271284. [7] C. Blundo, A. De Bonis, and A. De Santis, Improved schemes for visual cryptography, Designs, Codes and Cryptography, vol. 24, pp. 255278, 2001. [8] G. Ateniese, C. Blundo, A. De Santis, and D. R. Stinson, Visual cryptography for general access structures, Inf. Computat., vol. 129, pp. 86106, 1996. [9] N. K. Prakash and S. Govindaraju, Visual secret sharing schemes for color images using halftoning, in Proc. Int. Conf. Computational Intelligence and Multimedia Applications (ICCIMA 2007), 2007, vol. 3, pp. 174178.

[10] H. Luo, F.X.Yu, J. S. Pan, and Z. M. Lu, Robust and progressive color image visual secret sharing cooperated with data hiding, in Proc. 2008 Eighth Int. Conf. Intelligent Systems Design and Applications, 2008, vol. 3, pp. 431436. SITES REFERRED: http://java.sun.com http://www.sourcefordgde.com http://www.networkcomputing.com/ http://www.roseindia.com/ http://www.java2s.com/

Das könnte Ihnen auch gefallen