You are on page 1of 41

1.

INTRODUCTION
1.1 History of Cryptography
Cryptography today might be summed up as the study of techniques and applications that depend on the existence of difficult of problems. Cryptanalysis is the study of how to compromise cryptographic mechanisms, and cryptology is the discipline of cryptography and cryptanalysis combined. To most people, cryptography is concerned with keeping communications private. Indeed, the protection of sensitive communications has been the emphasis of cryptography throughout much of its history. However, this is only one part of todays cryptography. Encryption is the transformation of data into a form that is as close to impossible as possible to read without the appropriate knowledge. Its purpose is to ensure privacy by keeping information hidden from anyone for whom it is not intended, even those who have access to the encrypted data. Decryption is the reverse of encryption. It is the transformation of encrypted data back into an intelligible form. Good cryptographic systems should always be designed so that they are as difficult to break as possible. It is possible to build systems that cannot break in practice. This does not significantly increase system implementation effort. However some care and expertise is required. There is no excuse for a system designer to leave the system breakable. Any mechanisms that can be used to circumvent security must be made explicit, documented and brought into the attention of end users. In theory, trying all possible keys in sequence can break any cryptographic method with a key. If using brute force to try all keys is the only option, the required computing power increases exponentially with the length of the key. The distance visualization with different interfaces knows an important evolution. The interfaces permit to access to data of type text and images. Several domains see an expansion of using the web like e-commerce-business; e-domains .These transfer systems require a security system which protects these data during their transfer, because for reasons of confidentiality, Data should not be readable. Bill payment system is one of more important web application. Exchanged information is very important and should be protected.

Therefore we have to offer users fair, reliable and rational exchange information on different types of networks. It is necessary to make them encrypted. This project presents a system of crypto-analysis permitting the data transfer of an application .for this we implemented syversons protocol. 1.1.1 Cryptographic Techniques There are two types of crypto systems. Secret-Key and Public-Key Cryptography. In Secret-key cryptography, also referred to as Symmetric Cryptography. The same key is used for both encryption and decryption. The most popular secret-key cryptosystem in use today is the Data Encryption Standard. In public-key cryptography, each user has a public key and a private key. The public key is made public while the private key remains secret. Encryption is performed with public key while decryption is done with the private key. The public key is made public while the private key remains secret. Encryption is performed with the public key decryption is performed with private key. The RSA public-key crypto system is the popular form of public-key cryptography. RSA stands for Rivest, Shamir, Adleman, the inventors of the RSA crypto systems. The Digital Signature algorithm is also a popular public key technique, though it can only be used for signatures, not encryption. DiffieHelman key Agreement protocol is a popular public-key technique for establishing secret keys over an insecure channel. 1.1.2 Importance of Cryptography Cryptography over internet to carry over the confidence found in the physical world to the electronic world. Allowing people to do peacefully business electronically without worries of deceit and deception. Cryptography makes secure web sites and electronic safe transmissions possible. This allows people to do online banking, online trading, and online purchases with their credit cards, with out worrying that any of their account information is being compromised. Digital signatures can also be used to authenticate the origin and the content of the message.

1.2 Project Introduction


2

In recent years, there has been a rapid growth of Information Technology for human to communication on the Internet. Since Internet is public, anyone can easily read information and perform successful transmissions without protection. In order to avoid sensitive information being illegally read or modified, the information must be encrypted before Transmission. The observations from recent electronic business applications on the Internet, point out that the amount of exchanged data is small, but the exchanged data requires secrecy. In 1995, Naor and Shamir proposed a visual secret sharing scheme. The scheme provides secrecy to avoid being illegally read or modified; it is called Visual Cryptography. Visual Cryptography is a clever and simple scheme that partitions a secret image into a set of shadow images, and a dealer distributes those shadow images to participants. The scheme uses the human visual system to recover secret images by stacking several shadow images. Several studies have improved the quality of images and visual format such as graylevel images or color images. Visual Cryptography can be seen as a one-time pad system. We consider that the secret image S is partitioned into two shadow images S1 and S2 for each participant Alice and Bob, respectively. While S is recovered by stacking S1 and S2, Alice remembers S2, and Bob remembers S1. To encrypt twice, we assume that S1 is fixed, and a new secret image S is partitioned into two shadow images S1 and S3 for Alice and Bob, respectively. Because Bob has the ability to infer S1, he can recover S without communicating with Alice; therefore, we define it as a reusable problem in visual cryptography if one of the shadow images is the same as a previous one. However, there is very limited study on reusable visual cryptography. In 1976, Diffie and Hellman (D-H) proposed a key agreement scheme that two parties can agree on a common session key. In this paper, we apply Diffie and Hellman (D-H) key agreement method and Toral Automorphism (TA) to improve the reusable problem. In, Chang et al. showed a scheme to permute coordinates of the image by using Toral Automorphism to protect the image. According to the concept of Chang et al.s scheme, we generate a common image without revealing the shadow images. The main idea of our method is that a D-H key agreement scheme is used to compute a common image for encryption and decryption with two parties.

We suppose that the two parties are sender Alice and receiver Bob. The two parties select a common shadow image, and they can generate a common image from a common session key with the Toral Automorphism algorithm. The common image is computed from a D-H key agreement scheme, thus, it is random and independent. Alice computes an encrypted image from the common image and the secret image, and she sends the encrypted image to Bob. Bob can recover the secret image from the encrypted image and the common image. An attacker would have a hard time discovering the secret image and the common session key to decrypt the image.

Fig 1.1 Example of Visual Cryptography

2.SOFTWARE REQUIREMENTS SPECIFICATION


2.1 Functoinal Requirements
Inputs:

The inputs to the system will be manually fed by the One of authorized user. The inputs will be as follows.
Select image file:

This lever the selecting of common image betwwen teo parties for Encryption and Decryption for transfer data confidentially.
Select Text Fie:

This file contains the secure data or any visual information that will be transmitted over the network
Password or Key:

This key field holding the key to encrypt the image and secure data
Processing

The input data is processed by the model


Output

The output will be an image contains secret key and symmetric key.

Performance requirements

Due to the high scope of the software, the performance requirements are high. The speed at which the software is required to operate is nominal. A processing rate of 5-10 seconds per query is acceptable.
Error message design

The design of error messages is an important part of the user interface design. As user is bound to commit some errors or other while designing a system the system should be designed to be helpful by providing the user with information regarding the error he/she has committed.

Error detection:

Even though every effort is make to avoid the occurrence of errors , still a small portion of errors are always likely to occur , these type of errors can be discovered by using validations to check input data. The system is designed to be a user friendly one. In other words the system has been designed to communicate effectively with the user. The system has been designed with Button.

2.2 Software Requirements

Design Platform : J2SE(SWINGS) Operating system : windows xp

2.3 Hardware Requirements


Ram Hard disk Processor(p4) : : : 1GB 80GB 2.63GHZ

2.4 Non Functional Requirements


Performance is measured in terms of the output provided by the application.

Requirement specification plays an important part in the analysis of a system. Only when the requirement specifications are properly given, it is possible to design a system , which will fit into required environment. It rests largely in the part of users of the existing system to give the requirement specifications because they are the people who finally use the system. The requirement specification for any system can be broadly stated as given below:

The system should be able to interface with the existing system. The system should be accurate. Te system should be better than existing system.

3. LITERATURE SURVEY

3.1 Survey
Various existing VSSS techniques: 2 out of 2 Scheme: The secret image is hidden in 2 shares, both needed for a successful decryption. n out of n Scheme: The secret image is hidden in n shares; all the n shares are needed for a successful

Decryption. k out of n Scheme: The secret image is encrypted in to n shares but only k shares are needed for decryption where k n. If k-1 shares are presented, this will give no information about secret message. The 2-out-of-2 VSSS proposed by Rijmen and Preneel claimed that the sub pixels with different colors can be stacked together to show a third color and the mixing result of two color sub pixels is interpreted by the additive model. Yet, the color sub pixels are painted on the transparencies, the additive model, which explains the mixture of light, is not appropriate. Thus, Hou adopted the subtract model of colorants to interpret the result of color mixture in their VSSSs. The color model applied by Verheul and Van Tilborg and Blundo et al. insisted that the mixing result of different colors be black. Formally, let C = {c1, c2. . . cc} be a set of c colors. The general or of elements (colors) in {c1, c2. . . cc} equals ci if all elements are equal to ci, 1 i c, otherwise it equals black. That is, two sub pixels with different colors ci and cj, 1 i j c, show color black when stacked together. Yang and Laih modified this color model by adding a stronger restriction that any two non-black color sub pixels with different colors ci and cj , that is, ci cj 1 (1 denotes color black), cannot be stacked together. Note that under these two color models, the schemes by Rijmen and Preneel and Hou do not work anymore. Phishing is a relatively new Internet crime in comparison with other forms, e.g., virus and hacking. More and more phishing Web pages have been found in recent years in an accelerative way. A report from the Anti-Phishing Working Group shows that the number of phishing Web pages is increasing each month by 50 percent and usually 5 percent of the phishing e-mail receivers will respond to the scams. Also, there were 15,050 phishing cases reported simply in one month in June 2005. This problem has drawn high attention from both industry and the academic research domain since it is a severe security and privacy problem and has caused huge negative impacts on the Internet world

A {k, n}-threshold visual cryptography scheme [2], often called {k, n} visual secret sharing (VSS) or simply {k, n}- VSS, is used to encrypt an input image by splitting the original content into n, seemingly random, shares S1, S2, . . . , Sn. The procedure is termed visual since the secret information is recovered through visual inspection of the stacked k (or more) allowed shares without the need for complicated cryptographic mechanisms and computations.

4. ANALYSIS & DESIGN


4.1 Analysis
4.1.1 Purpose 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 the secrets are stacked together. It can be seen as a onetime pad system. Then, it cannot be reused. We apply Diffie and Hellman (D-H) key agreement method and Toral Automorphism (TA) such that visual cryptography can be reused. Both secret and symmetry-key are represented in binary image. The main purpose of the scheme is simple and easy to be implemented for any type of images. Therefore, it can be used in many electronic business applications. 4.1.2 Scope

These Visual Cryptography techniques are applicable for the color images and shadow images also which are in small size. It can show the size variant on the encrypted image compare to the original one. This is meant for following people 4.1.3 Users This can be used by the authorized person
4.1.4 Constraints

Any authorized person It will be applicable to all type of images The Encrypted text must be smaller size.

i) This will be applicable to all type images. ii) Encrypted image was (*.PNG) file only.

4.2 System overview


4.2.1 Existing system: In 1995, Naor and Shamir proposed a visual secret sharing scheme. The scheme provides secrecy to avoid being illegally read or modified; it is called visual cryptography. Visual cryptography is a clever and simple scheme that partitions a secret image into a set of shadow images, and a dealer distributes those shadow images to participants. The scheme uses the human visual system to recover secret images by stacking several shadow images. Several studies have improved the quality of images and visual format such as gray-level images or color images. Visual cryptography can be seen as a one-time pad system. We consider that the secret image S is partitioned into two shadow images S1 and S2 for each participant Alice and Bob, respectively. While S is recovered by stacking S1 and S2, Alice remembers S2, and Bob remembers S1. To encrypt twice, we assume that S1 is fixed, and a new secret image S is partitioned into two shadow images S1 and S3 for Alice and Bob, respectively. Because Bob

10

has the ability to infer S1, he can recover S without communicating with Alice; therefore, we define it as a reusable problem in visual cryptography 4.2.2 Proposed system: Visual cryptography is a clever and simple scheme that partitions a secret image into a set of shadow images, and a dealer distributes those shadow images to participants. The scheme uses the human visual system to recover secret images by stacking several shadow images. Several studies have improved the quality of images and visual format such as graylevel images or color images. Visual cryptography can be seen as a one-time pad system. Then, it cannot be reused. In this project, we apply Diffie and Hellman (D-H) key agreement method and Toral Automorphism (TA) such that visual cryptography can be reused. Both secret and symmetrykey are represented in binary image. 4.2.2.1 Diffie-Hellman (D-H) Key Agreement The famous key agreement scheme was proposed by Diffie and Hellman in 1976. If Alice and Bob want to transfer a secret by Diffie-Hellman key agreement scheme, then Alice selects a random secret and sends g (mod N) to Bob, where N is a large prime number. Then, Bob selects another random secret and sends g (mod N) to Alice. Finally, Alice and Bob compute a common session key K=g =g mod N. Thus, Alice and Bob can use the common key K for encryption and decryption in the session. No one can derive the session key K from the public information g (mod N) and g (mod N). The Security is based on the computational Diffie-Hellman problem. The session key generation phase is based on the D-H key agreement scheme (1) Alice selects a random integer and sends g (mod N) to Bob. (2) Bob selects a random integer and sends g (mod N) to Alice. (3) Alice computes k=g (g) (mod N). (4) Bob computes k=g (g) (mod N). After performing the above steps, Alice and Bob can obtain a common session key g or g .

11

That is

(4)

Alice and Bob keep the common session key k for later encryption and decryption. 4.2.2.2 Visual Cryptography (VC) VC is a secret sharing scheme for digital images which uses the human visual system to recover secrets; therefore, it has low computation. A (k, n)-threshold VC scheme is defined as a dealer who partitions a secret image into n shadow images, and the dealer distributes one of those shadow images for each participant. Each participant obtains a distinct shadow image. In order to recover the secret information, any k or more participants can reconstruct the secret image by stacking any k or more shadow images, but the secret image cannot be reconstructed by less than k shadow images. For example: when k = n = 2, we can partition an N M secret image into two 2N 2M shadow images. Formally, we can represent the encrypt/decrypt function as shown in Following formula (1) and (2), where S denotes the secret image, and (S1, S2) denotes the shadow images. (S1, S2) = Partition N M (S) S = Recover N M (S1, S2) 4.2.2.3 Toral Automorphism (TA) TA is a two-dimensional matrix that permutes a set of coordinates [1]. It can be used to generate a chaotic arrangement of digital images. Voyatzis and Pitas [3] defined a twodimensional matrix as shown in formula 3. (1) (2)

(3) Here (x, y) is a new position for a two-dimensional coordinate after randomly selecting its permutation, N N is denoted as the image size, and k is denoted as the secret key of TA

12

matrix M. For instance, we assume that the secret image size is 2 2 pixels, and k is 3. The TA matrix is shown in Table 1 (a). The pixel value of the image is shown in Table 1 (b). Table 1: (a) TA matrix, (b) Pixel value of image before using TA, (c) Pixel value of image after using TA

For example, the pixel value of the image is p3 at location (1, 2) before using TA. The location (1, 2) moves to location (2, 2) after using TA. Steganography is the art and science of writing hidden messages in such a way that no one apart from the intended recipient knows of the existence of the message; this is in contrast to cryptography, where the existence of the message itself is not disguised, but the content is obscured. . . .Generally, a steganographic message will appear to be something else: a picture, an article, a shopping list, or some other message. This apparent message is the cover text. For instance, a message may be hidden by using invisible ink between the visible lines of innocuous documents. The advantage of steganography over cryptography alone is that messages do not attract attention to themselves, to messengers, or to recipients. An unhidden coded message, no matter how unbreakable it is, will arouse suspicion and may in itself be incriminating, as in countries where encryption is illegal. In our final laboratory project this semester you will implement a very basic steganographic system. The program you complete will implement two pairs of data transformations. First it will provide the ability to hide a secret image within the pixels of a cover image and to reveal such secret images. You have already seen an example illustrating how this can be accomplished. Remember how we hid a picture of the Pentagon inside a picture of Griffin Hall? In that case we used the low 3 bits of each pixel to encode the image of the Pentagon while the high order 5 bits were used to encode the image of Griffin Hall. The variation in the brightness of a pixel that results when only its low 3 bits are changed is so small that we could use those bits to record the brightness values of the Pentagon image without perceptibly changing the image of Griffin. On the other hand, when we extracted the

13

low 3 bits and expanded the range of those bits, a clear picture of the Pentagon emerged, even though only 8 distinct shades of gray could be encoded for each pixel.

14

4.2.2.4

Glossary:

15

5. IMPLEMENTATION & TESTING


5.1 Technologies
5.1.1 Java:

16

The java programming language and environment is designed to solve a number of problems in modern programming practice. Java started as apart of a larger project to develop advanced software for consumer electronics. These devices are small, reliable, portable, distributed, real time embedded systems. When SUN started the project it intended to use c+ +, but encountered a number of problems. Initially these were just compiler technology problems, but as time passed more problems emerged that were best solved by changing the language.

Java is simple, object-oriented, network-savvy, interpreted, architectural neutral, portable, high-performance, multithreaded, dynamic language. One way to characterize a system is with a set of buzzwords. SUN uses a standard set of them in describing java.

Concept classes The java.imageio and javax.writebleraster packages have classes and interfaces that represent the cryptographic concepts. They are summarized as follows:

Class or interfaces

Description
17

Java.imageio..getread Javax.writebleraster Java.security.Key, Java.security.PrivateKey, Java.security.PrIvateKey, Javax.crypto.SecretKey Javax.crypto.KeyAgreement Java.security.keyFactory

A image reader class A raster group of pixel class

A key ,used for signing or encryption

A secret key exchange protocol Translates public and private keys from one form to another

Javax.crypto.KeyGenerator Java.security.KeyPairGenerator

Create pairs of Symmetric ciphers Creates pair of public and private keys for signing or encryption

5.1.2 SWINGS
Swing is a widget toolkit for java. It is part of Sun Microsystems' Java Foundation Classes (JFC) an API for providing a graphical user interface (GUI) for Java programs. Swing was developed to provide a more sophisticated set of GUI components then the earlier Abstract Window Toolkit. Swing provides a native look and feel that emulates the look and feel of several platforms, and also supports a pluggable look and feel that allows applications to have a look and feel unrelated to the underlying platform. Swing is a platform-independent, Model-View-Controller GUI framework for Java. It follows a single-threaded programming model, and possesses the following traits:

18

Foundations Platform Independence Swing is platform independent both in terms of its expression (Java) and its implementation (non-native universal rendering of widgets).

Extensible Swing is a highly partitioned architecture, which allows for the "plugging" of various custom implementations of specified framework interfaces: Users can provide their own custom implementation(s) of these components to override the default implementations. In general, Swing users can extend the framework by extending existing (framework) classes and/or providing alternative implementations of core components. Swing is a component-based framework. The distinction between objects and components is a fairly subtle point: concisely, a component is a well-behaved object with a known/specified characteristic pattern of behavior. Swing objects asynchronously fire events, have "bound" properties, and respond to a well-known set of commands (specific to the component.) Specifically, Swing components are Java Beans components, compliant with the Java Beans Component Architecture specifications. Customizable Given the programmatic rendering model of the Swing framework, fine control over the details of rendering of a component is possible in Swing. As a general pattern, the visual representation of a Swing component is a composition of a standard set of elements, such as a "border", "inset", decorations, etc. Typically, users will programmatically customize a standard Swing component (such as a JTable) by assigning specific Borders, Colors, Backgrounds, opacities, etc., as the properties of that component. The core component will then use these property (settings) to determine the appropriate renderers to use in painting its various aspects. However, it is also completely possible to create unique GUI controls with highly customized visual representation.

Configurable

19

Swing's heavy reliance on runtime mechanisms and indirect composition patterns allows it to respond at runtime to fundamental changes in its settings. For example, a Swingbased application can change its look and feel at runtime. Further, users can provide their own look and feel implementation, which allows for uniform changes in the look and feel of existing Swing applications without any programmatic change to the application code.

Lightweight UI Swing's configurability is a result of a choice not to use the native host OS's GUI controls for displaying itself. Swing "paints" its controls programmatically through the use of Java 2D APIs, rather than calling into a native user interface toolkit. Thus, a Swing component does not have a corresponding native OS GUI component, and is free to render itself in any way that is possible with the underlying graphics APIs. However, at its core every Swing component relies on an AWT container since (Swing's) JComponent extends (AWT's) Container. This allows Swing to plug into the host OS's GUI management framework, including the crucial device/screen mappings and user interactions, such as key presses or mouse movements. Swing simply "transposes" its own (OS agnostic) semantics over the underlying (OS specific) components. So, for example, every Swing component paints its rendition on the graphic device in response to a call to component. Paint (), which is defined in (AWT) Container. But unlike AWT components, which delegated the painting to their OS-native "heavyweight" widget, Swing components are responsible for their own rendering. This transposition and decoupling is not merely visual, and extends to Swing's management and application of its own OS-independent semantics for events fired within its component containment hierarchies. Generally speaking, the Swing Architecture delegates the task of mapping the various flavors of OS GUI semantics onto a simple, but generalized, pattern to the AWT container. Building on that generalized platform, it establishes its own rich and complex GUI semantics in the form of the JComponent model. A review of the source of Container java and JComponent java classes is recommended for further insights into the nature of the interface between Swing's lightweight components and AWT's heavyweight widgets. Loosely-Coupled and MVC

20

The Swing library makes heavy use of the Model/View/Controller software design pattern, which conceptually decouples the data being viewed from the user interface controls through which it is viewed. Because of this, most Swing components have associated models (which are specified in terms of Java interfaces), and the programmer can use various default implementations or provide their own. The framework provides default implementations of model interfaces for all of its concrete components. Typically, Swing component model objects are responsible for providing a concise interface defining events fired, and accessible properties for the (conceptual) data model for use by the associated JComponent. Given that the overall MVC pattern is a loosely-coupled collaborative object relationship pattern, the model provides the programmatic means for attaching event listeners to the data model object. Typically, these events are model centric (ex: a "row inserted" event in a table model) and are mapped by the JComponent specialization into a meaningful event for the GUI component. Relationship to AWT

Fig 5.1 Relationships to AWT

Since early versions of Java, a portion of the Abstract Window Toolkit (AWT) has provided platform-independent APIs for user interface components. In AWT, each component is rendered and controlled by a native peer component specific to the underlying windowing system. By contrast, Swing components are often described as lightweight because they do not require allocation of native resources in the operating system's windowing toolkit. The AWT components are referred to as heavyweight components.

21

Much of the Swing API is generally a complementary extension of the AWT rather than a direct replacement. In fact, every Swing lightweight interface ultimately exists within an AWT heavyweight component because all of the top-level components in Swing (JApplet, JDialog,JFrame, and JWindow) extend an AWT top-level container. However, the use of both lightweight and heavyweight components within the same window is generally discouraged due to Z-order incompatibilities. The core rendering functionality used by Swing to draw its lightweight components is provided by Java 2D, another part of JFC.

Relationship to SWT The Standard Widget Toolkit (SWT) is a competing toolkit originally developed by IBM and now maintained by the Eclipse community. SWT's implementation has more in common with the heavyweight components of AWT. This confers benefits such as more accurate fidelity with the underlying native windowing toolkit, at the cost of an increased exposure to the native platform in the programming model. The advent of SWT has given rise to a great deal of division among Java desktop developers, with many strongly favoring either SWT or Swing. Sun's development on Swing continues to focus on platform look and feel (PLAF) fidelity with each platform's windowing toolkit in the approaching Java SE 7 release (as of December 2006). There has been significant debate and speculation about the performance of SWT versus Swing; some hinted that SWT's heavy dependence on JNI would make it slower when the GUI component and Java need to communicate data, but faster at rendering when the data model has been loaded into the GUI]. A fairly thorough set of benchmarks concluded that neither Swing nor SWT clearly outperformed the other in the general case. SWT serves the Windows platform very well but is considered by some ] to be less effective as a technology for cross-platform development. By using the high-level features of each native windowing toolkit, SWT returns to the issues seen in the mid 90's (with toolkits like zApp, Zinc, XVT and IBM/Smalltalk) where toolkits attempted to mask differences in focus behaviour, event triggering and graphical layout. Failure to match behavior on each

22

platform can cause subtle but difficult-to-resolve bugs that impact user interaction and the appearance of the GUI. Debugging Swing application debugging can be difficult because of the toolkit's visual nature. In contrast to non-visual applications, GUI applications cannot be as easily debugged using step-by-step debuggers. The main reason is that Swing normally performs painting into an off-screen buffer (double buffering) first and then copies the entire result to the screen. This is to not let the user observe the painting process which would be perceived as flickering. This makes it difficult to observe the impact of each separate graphical operation on the user interface using a general-purpose Java debugger. To help with this problem, one can turn off double buffering, and have the drawing operations visualized using the built-in DebugGraphics object. Also, a free and open source GUI-based debugging application called Swing Explorer will be of help with drawing problems: It will locate which component painted every single pixel in a window, where each component was instantiated, displays the time line for each drawing operation, and will present a "DOM-like" tree of all Components in the JVM along with visualization of where the selected component painted. All operations are done through a side GUI which injects itself into the application, thus making Swing debugging considerably more effective. There are also some common problems related to the painting thread. Swing uses the AWT event dispatching thread for painting components. In accordance with Swing standards, all components must be created and accessed only from the AWT event dispatch thread. If the application violates this rule, it may cause unpredictable behavior.. The thirdparty, free and open source pluggable Look and Feel called Substance can help here, as it refuses to handle any components off of the Event Dispatch Thread, thus pinpointing violations to this rule. If long-running operations are performed in the AWT event dispatch thread, repainting of the Swing user interface temporarily becomes impossible causing screen freezes. Such operations must be moved into a separate thread. It is worth emphasizing that these problems are not in any way unique to Swing - most GUI toolkits necessarily have similar problem spaces with threading and buffering.

23

5.2 Sample Code


Encrypting

The Encrypt button encrypts the secret image inside the cover image. The result is an encrypted image. We encrypt the secret image into the cover image by first clearing the low bit of every pixel of the cover image. This has the side-effect of making every pixel value even. For example, 253 becomes 252 but 68 remains the same since its lowest bit is already 0. Next we re-scale the secret image down to 0 / 1 brightness values. Finally, we add the brightness values for the scaled version of the secret image to the bit-cleared cover image. That is, for each pixel in the encrypted image, we add the pixel at that point in the cover image to the pixel at that point in the secret image hiding the secret image in the cover image. The result of this additionis the displayed on the right as the encrypted image. Since we only alter the lowest bits, its essentially indistinguishable from the original cover image. Decrypting The Decrypt button takes the image in the rightmost ImageViewer and extracts the low order bit from each pixel to obtain an image where each pixel has value either 0 or 1. To do this, we make a copy of the encrypted image, clear the low order bit for each brightness value, and subtract this copy from the original encrypted image. Finally, we scale the pixel values of the image by multiplying each value by 128 because looking at black images isnt that much fun. This should yield a two-tone version of the secret image.

5.3 System Testing


Testing is done to ensure reliability of the software, to recover form errors and from errors and unknown bugs that are present. During testing , the programs to be tested is executed with a set of test cases and the out put of the program for the test cases is evaluated to determines if the program delivers the performance as expected. There are chances for various errors to occur during any phase of the software development cycle. Verifications are done at the output of each phase. Each modules and sub modules are checked for errors at the output of each phase.

5.3.1 Testing Objectives Objective of software testing is to check whether a software has errors or not and if it has then remove those errors. Before releasing software last step or process is software testing and it is performed and it is performed at the end of software development life cycle. Many people think that software testing is different from quality assurance. As quality
24

assurance is a process which take place throughout the software development lifecycle (SDLC) and testing is a phase in quality assurance.

Actually, we perform software testing to give quality products to the users and for maintaining quality of software, software testing is essential. In different situations, different strategies are used. For example, if we want to test a web based software or a website then we have to use load testing. If we want to test software and we know about its internal functionalities and source code then we will use White Box testing. However if we want to test software but we dont know about its source code and internal function then now our strategy will be different. As this time depending on the situations we will perform Black BOX testing.

5.3.2 Levels of Testing Unit Testing: contract to test a single unit of code Integration Testing: combines software modules or units into an effective test groups System Testing: combines components into a complete system to verify a specified requirement. This could also be called functional testing or application testing. Load Testing: Determines is system can support a specified load Stress Testing: Load testing over an extended period of time Capacity Testing: maximum load a system can sustain White Box (or glass box) Testing: testing is done with knowledge of the code. Programmer knows internal implementation and verified tests results. Black Box Testing: Also functional testing, tester does not know internal implementation and verifies results returned

25

5.3.3 Test cases


ID Description

Test Condition

Verify message was encrypted or not. Only textual data will be possible for encryption

Test Inputs

1.symmetric key encryption 2.Enter name to save the encrypted image 3. Loading the textual data

Excepted Output Actual output Pass/fail

Encrypted image The secure data is encrypted in the image Pass

ID Test Condition Test Inputs

Description Verify the image contains secret data or not Comparing the Symmetric key for decryption. 1.Selcteing or loading Encrypted image 2. Enter symmetric key for decryption

Excepted Output Actual output

The secure data will be displayed The secret message will be displayed

Test Case ID

Test Case

Expecting behavior

Exhibiting behavior

Result

26

1.

Enter the wrong password for image.

Error message has to be displayed.

It is displayed the error message.

Pass

2.

Load either image file or text file

Alert box will be displayed Error message has to be displayed.

It displays the alert box Alert box will be displayed with appropriate message

Pass

3.

Enter key or save file name to save encrypted file

Pass

4.

If password length is less than 20 characters

Error message has to be displayed

Alert box will be displayed with appropriate message

Pass

5.

If password or key is Error message not correct selected has to be displayed

Alert box will be displayed with appropriate message

Pass

6.

In appropriate image Error message loaded and password has to be entered. displayed

Alert box will be displayed with appropriate message

Pass

6.SCREEN SHOTS

27

Fig 6.1 Home Page

28

Fig 6.2 Selecting Image file

29

Fig 6.3 Error in Seleting Image File

30

Fig 6.4 Successful Loading of Image File

31

Fig 6.5 Loading of Text File

32

Fig 6.6 Error In Loading Text File

33

Fig 6.7 Successful Loading of Text File

34

Fig 6.8 Verification

35

Fig 6.9 Error In Verification

36

Fig 6.10 Password and File name Loading

37

Fig 6.11 Successful Loading of Password and File name

38

Fig 6.12 Successful Completion of Encryption

7. CONCLUSION AND FUTURE SCOPE

We propose a new visual cryptography scheme which combines the key agreement scheme with a shadow image without building a secure connection. Even if many

39

eavesdroppers listen over the public Communication channel, we can immediately transmit a secret message to others. Moreover, we enhance shadow image structure to reduce the chances for an attacker to guess the secret. The proposed scheme involves Diffie and Hellman and Toral Automorphism with the help of Steganography such that it can be reused. Hence, the proposed scheme is flexible, easily implemented, and more secure for shadow images. The future scope of the project is very bright. We have tried to implement this technique for secure text data. This can be extended to every type of application i.e. any type of secure data. This can be further extending to design full-fledged software.

9. REFERENCES

40

S.No 1

Author

Book/Paper

Publisher

Volume

Year

Chin-Chen Jun-Chou

Chang, Sharing a Secret Chuang Two-Tone Image in Two Gray-Level Images.

11th International pp. 300Conference Parallel and Distributed Systems Workshops (ICPADS'05) on 304

200 5

and Pei-Yu Lin.

G. L.

Alvarez,

A. A secure scheme

Computer Physics Communication s

vol. 173, issue 1-2, pp. 9-16

Dec . 200 5

Hernndez Encinas, to share secret Hernndez color images and A. Encinas

Martin del Rey


3

R. Lukac and K. N. Plataniotis

Bit-level based secret sharing

Patter Recognition

vol. 38, no. 5, pp. 767-772

200 5

W. Diffie and M. E. Hellman

New Directions in Cryptography

IEEE Transactions on Information Theory

vol. 22, issue 6, pp. 644654 vol. 15, pp. 24412453

1976

Z. Zhou, G. R. Arce and G. D. Crescenzo

Halftone visual cryptography

Image Processing, IEEE Transactions

200 0

41

You might also like