Yashwanth
Yashwanth
Submitted By
K. Vandana (2017-1802021)
S. Yashwanth (2017-1802025)
B. Ganesh (2017-1802050)
Smt.U.Sahiti
Assistant Professor
(AUTONOMOUS)
RUSHIKONDA, VISAKHAPATNAM.
2017-2020
GAYATRI VIDYA PARISHAD COLLEGE FOR DEGREE and P.G
COURSES (Autonomous)
RUSHIKONDA, VISAKHAPATNAM
Department of Computer Application
CERTIFICATE
This is to certify that the project report titled “Encryption Using Modulo
Inverse Matrix Method” is the Bonafide record of project work carried out
by K. Vandana (Regd. No.2017-1802021), a student of this college, during the
academic year 2017-2020, in partial fulfilment of the requirements for the
award of the degree of Bachelor of Computer Applications.
Assistant Professor
External Examiner
GAYATRI VIDYA PARISHAD COLLEGE FOR DEGREE and P.G
COURSES (Autonomous)
RUSHIKONDA, VISAKHAPATNAM
Department of Computer Application
CERTIFICATE
This is to certify that the project report titled “Encryption Using Modulo
Inverse Matrix Method” is the Bonafide record of project work carried out by
S. Yashwanth (Regd. No.2017-1802025), a student of this college, during the
academic year 2017-2020, in partial fulfilment of the requirements for the
award of the degree of Bachelor of Computer Applications.
Assistant Professor
External Examiner
GAYATRI VIDYA PARISHAD COLLEGE FOR DEGREE and P.G
COURSES (Autonomous)
RUSHIKONDA, VISAKHAPATNAM
Department of Computer Application
CERTIFICATE
This is to certify that the project report titled “Encryption Using Modulo
Inverse Matrix Method” is the Bonafide record of project work carried out by
B. Ganesh (Regd. No.2017-1802050), a student of this college, during the
academic year 2017-2020, in partial fulfilment of the requirements for the
award of the degree of Bachelor of Computer Applications.
Assistant Professor
External Examiner
DECLARATION
(K. Vandana)
DECLARATION
(S. Yashwanth)
DECLARATION
I, B. Ganesh hereby declare that the project report entitled “Encryption Using
Modulo Inverse Matrix Method” is an original work done at Gayatri Vidya
Parishad College for Degree And P.G Courses (A), Visakhapatnam,
submitted in partial fulfilment of the requirements for the award of Bachelor of
Computer Applications, to Gayatri Vidya Parishad College for Degree And P.G
Courses (A), affiliated to Andhra University. I assure that this project is not
submitted in any other University or college.
(B. Ganesh)
ACKNOWLEDGEMENT
First of all I would like to thank our beloved principal Prof. S. Rajani
of Gayatri Vidya Parishad College for Degree And P.G Courses(A), who
has provided full- fledged lab and infrastructure for successful completion of
my project work.
I thank all the Teaching & Non-Teaching staff who has been a constant
source of support and encouragement during the study tenure.
(K. Vandana)
ACKNOWLEDGEMENT
First of all I would like to thank our beloved principal Prof. S. Rajani
of Gayatri Vidya Parishad College for Degree And P.G Courses(A), who
has provided full- fledged lab and infrastructure for successful completion of
my project work.
I thank all the Teaching & Non-Teaching staff who has been a constant
source of support and encouragement during the study tenure.
(S. Yashwanth)
ACKNOWLEDGEMENT
First of all I would like to thank our beloved principal Prof. S. Rajani
of Gayatri Vidya Parishad College for Degree And P.G Courses(A), who
has provided full- fledged lab and infrastructure for successful completion of
my project work.
I thank all the Teaching & Non-Teaching staff who has been a constant
source of support and encouragement during the study tenure.
(B. Ganesh)
ENCRYPTION USING
MODULO INVERSE
MATRIX METHOD
Content
Topic Page no
------------------------------------------------------------------------------------------------------------------------
1. Introduction 1
2. Literature Survey 5
2.1. Introduction 6
2.5 Objectives 6
3. UML Modelling 16
3.1.1 Actors 19
4. Design 30
4.2. Example 35
5. Coding 39
6. Testing 59
7. Results 68
7.1. Result 69
7.2. Conclusion 74
8. References 75
9. Appendix 78
The basic idea of cryptography is that information can be encoded using an encryption
scheme and decoded by anyone who knows the scheme. There are lots of encryption
schemes ranging from very simple to very complex. Most of them are mathematical in
nature.
It's not difficult to guess at the importance of this application. It is surmised that Hitler
may well have won WWII had not a bright British mathematician been able to break the
codes used by the Axis forces in their radio transmissions. Today, sensitive information
is sent over the Internet every second: credit card numbers, personal information, bank
account numbers, letters of credit, passwords for important databases, etc. Often, that
information is encoded or encrypted.
We are going to play with matrix encryption. The encoder is a matrix and the decoder is
it's inverse. Let's see just how that works. Let A be the encoding matrix, M the message
matrix, and X will be the encrypted matrix. Then, mathematically, the operation is
2.
(Note, the sizes of A and M will have to be consistent and will determine the size of X.)
OK, let's say someone has X and knows A. and wants to recover M, the original
message. That would be the same as solving the matrix equation for M. Multiplying both
sides of the equation on the left by we have
3.
Notice then that the encoding matrix, A, must have an inverse for this scheme to work.
Select a message . Now you need to convert it to numerical format. An underbar (_) is a
space ( ).
0=_
1=A
2=B
3=C
4=D
5=E
6 = F
7 = G
8 = H
9 = I
10 = J
11 = K
12 = L
13 = M
14 = N
15 = O
16 = P
17 = Q
18 = R
19 = S
20 = T
21 = U
22 = V
23 = W
24 = X
25 = Y
26 = Z
Notice the space on the end. This is because you must have an even number of characters,
because of how the encryption works (in groups of two letters).
But , we are doing this with matrixes and letters in groups of two, so it will be better if you
write it in this format:
[19 5] [14 4] [0 8] [5 12] [16 0]
You can’t use zeroes. Otherwise, you can use any integer, but the bigger the numbers, the
harder it will be to multiply out by hand.
Step 3: Multiply
Once you multiply out you matrixes, you get the encoded results.
[B1] = [101 42]
[B2] = [76 30]
[B3] = [40 -24]
[B4] = [80 -21]
[B5] = [64 48]
The picture in this step demonstrates how matrix multiplication works.
Step 4: Rewrite
Step 5: Decryption
Example 2:-
Write the plain text in alphabetic number order and every space after a word will count as
underscore (_) and the underscore will count as ‘0’.
By now using matrix key we have to encrypt the plain text to cipher text.
(There is no rules for take a particular key, We can assume any random 2*2 matrix.
Now the receiver have to decrypt the message by using inverse matrix key
By using inverse matrix key the receiver have to decrypt to cipher text
2.1 Introduction
ALGORITHM
EXAMPLE
56
MY_NAME_IS_VANDANA
A= CODING
M=MESSAGE
C=CIPHERTEXT
CIPHEREXT= JZNCPBOYSXVXQHDZPX
Decrypting the cipher text :
M=A-1 X
M1 = A-1 X
Rearranging the above letters in an order we get,
MY NAME IS VANDANA
Therefore, PLAINTEXT=CIPHERTEXT
A key is used to convert plaintext to ciphertext and vice versa. So this system more
chances for ciphertext to break the text.
Key: 7
Ciphertext = HIG
Here the encryption technique used can be easily decrypted by hacker and they can
misuse the information for malicious activities.It creates more memory footprint and Slower in
speed.
Requirement is the feature the system must have a constraint that it must satisfy to be
accepted by the clients. Requirements engineering aims at defining the requirements of the
system under construction. It includes two main activities namely Requirements Elicitation
and Analysis.
Requirements Elicitation focuses on describing the process of the system. The client,
the developer and the users identify the problem. Such a definition is called Requirement
Specification. This specification is structured and formulized during analysis to produce an
Analysis Model.
Requirements Elicitation and Analysis focuses only on the user’s view of the system.
Requirements Elicitation includes the following activities:
During this activity, developers identify the different types of users the future system will
support.
During this activity, developers observe users and develop a set if detailed scenarios for
typical functionality provided by the future system. Developers use these scenarios to
communicate with the users and deepen their understanding.
2.6.3 Identifying Use Cases:
Once developers and users agree on the set of scenarios, a set of use cases that completely
represent the future system.
During this activity, developers ensure that the requirements specifications completed
bydetailing each use case and describing the behavior of the system in the presence of errors
and exceptional conditions.
During this activity, developers identify the dependencies among the use cases and also
consolidate the use case model by factoring out common functionality.
During this activity, developers, users and clients agree on aspects like performance of
system, documentation, resources, security and its quality.
2.6.6.1 Actors: Actors are external entities that interact with the system. Actors typically
include a user role or Actors typically include a user role or Actors typically include a user
Sender receive
r
In this project the two actors are sender and receiver.
2.6.7 Functional Requirements:
Sender
Receiver
RAM : 4GB
Mouse : Standard
Applications of java
History
Java is a programming language developed by James Gosling with other team members
named Mike Sheridan and Patrick Naughton also called as Green Team in 1995 for Sun
Microsystems for digital devices such as set-top boxes, televisions etc. Now, let us explore
the language in detail.
What is Java?
It is an object-oriented language similar to C++, but with advanced and simplified features.
This language is free to access and can run on all platforms.
Java is: –
Features
Simple: Java has made life easier by removing all the complexities such as
pointers, operator overloading as you see in C++ or any other programming language.
Portable: This is platform independent which means that any application
written on one platform can be easily ported to another platform.
Components
JVM (Java Virtual Machine)
Compile
Document
Package Java programs.
The JDK completely includes JRE which contains tools for programmers. The Development
Kit is provided free of charge. Along with JRE, it includes an interpreter/loader, a compiler
(javac), an archiver (jar), a documentation generator and other tools needed in Java
development. In short, it contains JRE + development tools.
3.UML MODELING
One of the purposes of UML was to provide the development community with a
stable and common design language that could be used to develop and build computer
applications. UML years. Using UML, IT professionals could now read and disseminate
system structure and design plans -- just as construction workers have been doing for
years with blueprints of buildings.
The elements are like components which can be associated in different ways to make
complete UML pictures which is known as diagram. So it is very important to understand the
different diagrams to implement the knowledge in real life systems.
We prepare UML diagrams to understand a system in better and simple way. A single
diagram is not enough to cover all aspects of the system. So UML defines various kinds of
diagrams to cover most of the aspects of a system.
1
7
You can also create your own set of diagrams to meet your requirements. Diagrams
are generally made in an incremental and iterative way.
There are two broad categories of diagrams and then are again divided into sub-categories:
Structural Diagrams
Behavioral Diagrams
i. Structural Diagrams:
The structural diagrams represent the static aspect of the system. These static aspects
represent those parts of a diagram which forms the main structure and therefore stable.
These static parts are represents by classes, interfaces, objects, components and
nodes. The four structural diagrams are:
Class diagram
Object diagram
Component diagram
Deployment diagram
Any system can have two aspects, static and dynamic. So a model is considered as complete
when both the aspects are covered fully.
Activity diagram
1
8
3.1 Introduction to Use case diagram:
A use case diagram at its simplest is a representation of a user's interaction with the system
and depicting the specifications of a use case.
A use case diagram can portray the different types of users of a system and the
various ways that they interact with the system. This type of diagram is typically used in
conjunction with the textual use case and will often be accompanied by other types of
diagrams as well.
3.1.1 Actors
Actor:
Actors are external entities that interact with the system. Actors typically include a user role
or another system. They have unique names and descriptions.
sender receiver
Sender:
The sender sends the message to the user which is encrypted using matrix. The sender gives
the receiver a key to later encrypt the message.
Receiver:
He/she receive the encrypted message which is decrypted using the key shared by sender.
Actors initiate the use cases for accessing system’s functionality. When actors and use
cases exchange information, they are said to Communicate. To describe a use case we use a
template composed of six fields:
Requirements that do not belong to the use case but Constraint the functionality of the
system.
Use case diagrams include four types of relations. They are as follows:
Communication Relationships
Inclusion Relationships
Extension Relationships
Inheritance Relationships
3.4 USE CASE DIAGRAM
Description: In the use case diagram, initially the message sent by the sender is encrypted
using already generated matrix key then the ciper text is transported to receiver through
network where he/she decrypts it using the same key.
Scenario
A Scenario is an instance of a use case describing a concrete set of actions. Scenarios are
used as examples for illustrating common cases: their focus is on understandability.
A Use Case Scenario is a description that illustrates, step by step, how a user is
intending to use a system, essentially capturing the system behavior from the user's point of
view. A use case scenario can include stories, examples, and drawings. Use cases are
extremely useful for describing the problem domain in unambiguous terms and for
communicating with the potential users of a system.
1. use case 1:
Scenario 1:
Scenario 2:
Participating Actors Receiver: The person who receives the Encrypted text.
1. Receive the keys and encrypted text.
Flow of Events
2. Browse the message.
Interaction diagrams model the behaviour of use cases by describing the way groups of
objects interact to complete the task. The two kinds of interaction diagrams are Sequence and
Collaboration diagrams. Sequence diagrams generally show the sequence of events that
occur. Sequence diagrams demonstrate the behaviour of objects in a use case by describing
the objects and the messages they pass. The diagrams are read left to right and descending.
Following are the Sequence Diagrams for the system under consideration.
Analysis object model is represented by class and object diagrams. Analysis focuses
on producing a model of the system, called the analysis model, which is correct, complete,
consistent, and verifiable. Analysis is different from requirements elicitation in that
developer’s focus on structuring and formalizing the requirements elicited from users. This
formalization leads to new insights and discovery of errors in the requirements. As the
analysis model may not be understandable to the users and the client, developers need to
update the requirements specification to reflect insights gained during analysis, and then
review the changes with the client and users. In the end, the requirements, however large,
should be understandable by the client and the users.
The analysis model is composed of three individual models: the functional model
represented by use cases and scenarios, the analysis, represented by class and object
diagrams, and the dynamic model, represented by state chart and sequence diagrams. We
described how to elicit requirements from the users and describe them as use cases and
scenarios. We describe how to refine the functional model and derive the object and the
dynamic model. This leads to a more precise and complete specification as details is added to
the analysis model. We conclude by describing management activities related to analysis.
Here the sender sends the message to the receiver . When sender sends the
plain text it is converted into cipher text using the generated matrix key .The key is shared
with the receiver.
3.5.1.2 Sequence diagram for encryption using modulo inverse matrix method
Description : Here receiver receives the ciper text then ,he/she converts into plain text using
matrix key.
State diagrams are used to describe the behaviour of a system. State diagrams describe all of
the possible states of an object as events occur. Each diagram usually represents objects of a
single class and tracks the different states of its objects through the system. Not all classes
will require a state diagram and state diagrams are not useful for describing the collaboration
of all objects in a use case. State diagrams have very few elements. The basic elements are
rounded boxes representing the state of the object and arrows indicting the transition to the
next state. The activity section of the state symbol depicts what activities the object will be
doing while it is in that state. All state diagrams being with an initial state of the object. This
is the state of the object when it is created. After the initial state the object begins changing
states.
Control flow is the sequencing of actions in a system. It defines the order of execution
of operations. These decisions are based on external events generated by an actor or on the
passage of time.
Activity diagrams illustrate the dynamic nature of a system with modelling the flow
of control from activity to activity. In many ways Uml activity diagrams are the object-
oriented equivalent of flow charts and data-flow diagrams (DFD’s) from structured
development. They are used to explore the logic of:
A complex operation
A complex business rules
A single use case
Several use cases
A business process
Software processes
An activity represents an operation on some class in the system that results in a change in the
state of the system. Typically, activity diagrams are used to model workflow of business
processes and internal operation
3.6.1.1 Activity diagram for encryption using modulo inverse matrix method
Description: Here the sender sends the message to the receiver . When sender sends the plain
text it is converted into cipher text using the generated matrix key and mod 27.The key is
shared with the receiver. When the receiver receives the ciper text he/she converts into plain
text using key.
4. DESIGN
Design is the first step in development phase. It is the first step into the solution domain. The
analysis and specification deals with the problem domain. Analysis deals with what a
proposed system has to do, where design deals with how the system implements. It can be
defined as "the process of applying various techniques and principles for the purpose of
defining a device, a process or a system in sufficient detail to permit its physical realization".
A design should exhibit a hierarchical organization that makes intelligent use of control
among element of software. A design should be modular that is the software should be
logically partitioned into elements that perform specific functions and sub functions. A
design should contain both data and procedural abstractions. A design should lead to
modules that exhibit independent functional characteristics A design should lead to interface
that reduce the complexity of connections between modules and with the external
environment A design should be derived using a repeatable method that is driven by
information obtained during the software requirements analysis.
Software design is both a process and a model. The design process is a set of iterative steps
that enable the designer to describe all aspects of the software to be built. Basic design
principles enable the software engineer to navigate the design process. Some of the Design
Principles are
3
1
Design methodology is a systematic approach to create a design by applying a set of
techniques and guidelines. Most design methodologies focus on the system design. Problem
partitioning is a basic principle for guiding the design process. The goal is to effectively
handle the complexity involved in designing large systems, by partitioning their problem into
separate pieces so that each piece can be solved separately. Problem partitioning depends on
the effective use of abstraction. Abstraction of a component is a view of the component that
extracts the essential information relevant to particular focus and ignores the rest of the
information. It allows a module to be specified by its external behaviour only. Abstraction
permits concentrating on one component at a time by using the abstraction of other
components to decide the interaction between the components. Design is the first step in the
development phase for any system .it is the first of the three technical activities design; code
generation and testing that are required to build and verify the software. The design step
produces a data design, an architectural design an interface design and procedural design.
The data design transforms the information domain model created during the analysis into the
data structures that will be required to implement the software. The data objects and the
relationships defined in the data dictionary provide the basis for the design activity. The
architectural design defines the relationship among major structural elements of the program.
The interface design describes how the software communicates with itself, to systems that
interoperate with it, and humans who use it. The procedural design transforms the structural
elements of the programs architecture into procedural description of the software
components. Design is the only way that we accurately translate a customer's requirements
into finished software product or system. Without design we risk in building an unstable
system-one that will fail when small changes are made; one that may be difficult to test; one
whose quality cannot be accessed until late in the software engineering process, then time is
short and many dollars have been spent.
CODING
5. CODING
The goal of the coding or programming phase is to translate the design of the system
produced during the design phase into code in a given programming language, which can be
executed by a computer and that performs the computation specified by the design.
The coding phase affects both testing and maintenance. The goal of coding is not to
reduce the implementation cost but the goal should be to reduce the cost of later phases. In
other words the goal is not to simplify the job of programmer. Rather the goal should be to
simplify the job of the tester and maintainer.
There are two major approaches for coding any software system. They are Top-Down
approach and bottom up approach.
Bottom-up Approach can best suit for developing the object-oriented systems. During
system design phase of reduce the complexity. We decompose the system into an appropriate
number of subsystems, for which objects can be modelled independently. The Once objects
have been modelled they are implemented by means of coding. Even though related to the
same system as the objects are implemented of each other the Bottom-Up approach is more
suitable for coding these objects.
In this approach, we first do the coding of objects independently and then we integrate
these modules into one system to which they belong. In this System Entire Website was built
into different pages.
Any software system require some amount of information during its operation selection of
appropriate data structures can help us to produce the code so that objects of the system can
better operate with the available information decreased complexity.
The system handled information in Static Strings. For every intermediate stage, the
Cookies are built in every page to make security purpose. The system transforms this
4
0
information carefully from one page to another. This also helps in Reducing Burden on
server.
Programming style deals with act of rules that a programmer has to follow so that the
characteristics of coding such as Trace ability, Understand ability, Modifiability, and
Extensibility can be satisfied. As part of coding internal documentation is also provided that
help the readers to better understand the code
In my system, for every independent action statements, one method is created. Before
using any variable, our system checks whether this value is null so we can rectify the problem
of abnormal program termination.
Verification and Validation of the system is integrated into the system while it is
coded. All the code is tested using the Netbeans framework for unit level perfection at the
time of coding. However various tests and test cases are designed to employ on the system
for its effectiveness and efficiency.
Validation of all the inputs given to the system at various points in the forms are validated
while navigating to the next form. System raises appropriate custom and pre-defined
exceptions to alert the user about the errors occurred or likely to occur.
Validations at the level of individual controls are also applied wherever necessary. System
pops up appropriate and sensuous dialogs wherever necessary.
4
1
5.5 Sample Source Code:
#-------------------------------------------------------------------
#about page
#-------------------------------------------------------------------
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class AboutPage extends JFrame implements ActionListener
{
JPanel p1,p2,p3;
JLabel l1,l2,l3,l4,l5,l6;
JButton b1,b2;
AboutPage()
{
setTitle("AboutUs Page");
setLayout(null);
p1 = new JPanel();
p1.setLayout(null);
p1.setBounds(0,0,1100,150);
p1.setBackground(Color.white);
p2 = new JPanel();
p2.setLayout(null);
p2.setBounds(0,200,1100,500);
p2.setBackground(new Color(150,230,250));
p3 = new JPanel();
p3.setLayout(new FlowLayout());
p3.setBounds(0,150,1100,50);
p3.setBackground(Color.black);
l3.setBounds(100,-30,1090,150);
b1.setBounds(400,380,150,50);
b2.setBounds(560,380,150,50);
b1.addActionListener(this);
b2.addActionListener(this);
String names="<html><h1><u><b>TEAMS<b><u></h1><h2>A.
HEAMANTH : 2017-1802012\r\n" +
"</h2><h2>CH. KISHORE : 2017-1802020 </h2><h2>T. S. SAI
PRASHANTH : 2017-1802034 </h2><html>";
String name="<html><h1><u><b>PROJECT
GUIDE:</b></u></h1><h2>Smt. M. LAKSHMI MADHURI </h2><h2>ASSISTANT
PROFESSOR</h2><h3>Dept. of Computer Applications\r\n" +
"</h3></html>";
l5= new JLabel(names);
l6= new JLabel(name);
l5.setBounds(100,120,500,300);
l6.setBounds(750,120,500,300);
p1.add(l1);
p1.add(l2);
p3.add(l3);
p2.add(l5);
p2.add(l6);
p2.add(b1);
p2.add(b2);
add(p1);
add(p2);
add(p3);
setSize(1100, 700);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()== b1)
{
new HomePage();
setVisible(false);
}
if(ae.getSource()== b2)
{
System.exit(0);
}
}
public static void main(String s[])
{
new AboutPage();
}
}
---------------------------------------------------------------------------------------------------------------------------------------
Decryption
-------------------------------------------------------------------------------------------------------------
import java.io.*;
import java.util.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
DecryptionPage()
{
setTitle("Decryption Page");
setLayout(null);
p1 = new JPanel();
p1.setLayout(null);
p1.setBounds(0,0,1100,150);
p1.setBackground(Color.white);
p2 = new JPanel();
p2.setLayout(null);
p2.setBounds(0,200,1100,500);
p2.setBackground(new Color(150,230,250));
p3 = new JPanel();
p3.setLayout(new FlowLayout());
p3.setBounds(0,150,1100,50);
p3.setBackground(Color.black);
l5=new JLabel();
l5.setFont(new Font("Serif", Font.BOLD, 18));
l5.setOpaque(true);
l5.setBackground(Color.white);
l5.setBounds(220,90,35,35);
l6=new JLabel();
l6.setFont(new Font("Serif", Font.BOLD, 18));
l6.setOpaque(true);
l6.setBackground(Color.white);
l6.setBounds(260,90,35,35);
l7=new JLabel();
l7.setFont(new Font("Serif", Font.BOLD, 18));
l7.setOpaque(true);
l7.setBackground(Color.white);
l7.setBounds(220,130,35,35);
l8=new JLabel();
l8.setFont(new Font("Serif", Font.BOLD, 18));
l8.setOpaque(true);
l8.setBackground(Color.white);
l8.setBounds(260,130,35,35);
l14=new JLabel();
l14.setFont(new Font("Serif", Font.BOLD, 18));
l14.setOpaque(true);
l14.setBackground(Color.white);
l14.setBounds(460,90,35,35);
l15=new JLabel();
l15.setFont(new Font("Serif", Font.BOLD, 18));
l15.setOpaque(true);
l15.setBackground(Color.white);
l15.setBounds(500,90,35,35);
l16=new JLabel();
l16.setFont(new Font("Serif", Font.BOLD, 18));
l16.setOpaque(true);
l16.setBackground(Color.white);
l16.setBounds(460,130,35,35);
l17=new JLabel();
l17.setFont(new Font("Serif", Font.BOLD, 18));
l17.setOpaque(true);
l17.setBackground(Color.white);
l17.setBounds(500,130,35,35);
b2 = new JButton("BROWSE TEXT");
b2.setBounds(35,180,170,35);
b3 = new JButton("Calculate");
b3.setBounds(35,280,170,35);
b4 = new JButton("Split");
b4.setBounds(550,130,140,35);
b5 = new JButton("Values");
b5.setFont(new Font("Serif", Font.BOLD, 18));
b5.setBounds(550,180,140,35);
b7 = new JButton("HOME");
b7.setBounds(550,350,120,35);
b8 = new JButton("CLOSE");
b8.setBounds(680,350,120,35);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
b6.addActionListener(this);
b7.addActionListener(this);
b8.addActionListener(this);
b9.addActionListener(this);
b10.addActionListener(this);
b11.addActionListener(this);
p1.add(l1);
p1.add(l2);
p3.add(l3);
p2.add(l4);
p2.add(l5);
p2.add(l6);
p2.add(l7);
p2.add(l8);
p2.add(l9);
p2.add(l10);
p2.add(l11);
p2.add(l12);
p2.add(l13);
p2.add(l14);
p2.add(l15);
p2.add(l16);
p2.add(l17);
p2.add(jt1);
p2.add(jt2);
p2.add(jt3);
p2.add(b1);
p2.add(b2);
p2.add(b3);
p2.add(b4);
p2.add(b5);
p2.add(b6);
p2.add(b7);
p2.add(b8);
p2.add(b9);
p2.add(b10);
p2.add(b11);
add(p1);
add(p2);
add(p3);
setSize(1100, 700);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
String str[]=key.split("\\s+");
l5.setText(str[0]);
l6.setText(str[1]);
l7.setText(str[2]);
l8.setText(str[3]);
}
catch(Exception e1){}
}
if(ae.getSource()== b10)
{
Mat[0][0]=Integer.parseInt(l5.getText());
Mat[0][1]=Integer.parseInt(l6.getText());
Mat[1][0]=Integer.parseInt(l7.getText());
Mat[1][1]=Integer.parseInt(l8.getText());
Inv[0][0]=(int)(Mat[1][1]/d);
Inv[0][1]=(int)(-Mat[0][1]/d);
Inv[1][0]=(int)(-Mat[1][0]/d);
Inv[1][1]=(int)(Mat[0][0]/d);
l14.setText(""+Inv[0][0]);
l15.setText(""+Inv[0][1]);
l16.setText(""+Inv[1][0]);
l17.setText(""+Inv[1][1]);
}
if(ae.getSource()== b2)
{
ct="";ct1="";
l9.setText("");
try
{
String s="";
JFileChooser fileChooser = new JFileChooser();
fileChooser.setCurrentDirectory(new
File(System.getProperty("user.home")));
int result = fileChooser.showOpenDialog(this);
if (result == JFileChooser.APPROVE_OPTION)
{
File selectedFile = fileChooser.getSelectedFile();
s=selectedFile.getAbsolutePath();
q1=1;
}
arr=new int[ct.length()];
int i=0;
char chArr[]=ct.toCharArray();
for(char ch:chArr)
arr[i++]=(int)ch;
}
if(ae.getSource()== b3)
{
jt1.setText("");
jt2.setText("");
jt3.setText("");
String z="";
int k=0;
Mat2=new int[arr.length/2][2];
String R1="",R2="",R3="";
for(int i=0;i<arr.length/2;i++)
{
for(int j=0;j<2;j++)
{
Mat2[i][j]=arr[k++];
}
}
m=2;n=2;p=arr.length/2;q=2;
C=new int[n][p];
//-------------------------------------------
for(int i=0;i<1;i++)
{
for(int j=0;j<p;j++)
{
for(k=0;k<2;k++)
{
R1+=(Inv[k][i]*Mat2[j][k]);
if(k % 2==0)
R1+=" + ";
}
jt1.setText(jt1.getText()+"[ "+R1+" ]\n");
R1="";
}
}
//------------------------------
for(int i=1;i<n;i++)
{
for(int j=0;j<p;j++)
{
for(k=0;k<2;k++)
{
R2+=Inv[k][i]*Mat2[j][k];
if(k % 2==0)
R2+=" + ";
}
jt2.setText(jt2.getText()+"[ "+R2+" ]\n");
R2="";
}
}
//--------------------------------
for(int i=0;i<n;i++)
{
for(int j=0;j<p;j++)
{
C[i][j]=0;
for(k=0;k<2;k++)
{
C[i][j]+=Inv[k][i]*Mat2[j][k];
}
}
}
for(int i=0;i<p;i++)
{
for(int j=0;j<n;j++)
{
R3+=C[j][i]+" ";
}
jt3.setText(jt3.getText()+"= [ "+R3+" ]\n");
R3="";
}
}
if(ae.getSource()== b4)
{
l10.setText("");
ct="";
int k=0;
for(int i=0;i<p;i++)
{
for(int j=0;j<n;j++)
{
if(k%2==0)
ct+="["+C[j][i];
else
ct+=" "+C[j][i]+"],";
k++;
}
}
l10.setText(ct+"");
}
if(ae.getSource()== b5)
{
ct="";
l11.setText("");
for(int i=0;i<p;i++)
{
for(int j=0;j<n;j++)
{
ct+=C[j][i]+" ";
}
}
l11.setText(ct+"");
}
if(ae.getSource()== b6)
{ ct="";
l12.setText("");
for(int i=0;i<p;i++)
{
for(int j=0;j<n;j++)
{
if(C[j][i]==0)
ct+=" ";
else
ct+=(char)(C[j][i]+64)+"";
}
}
l12.setText(ct+"");
}
if(ae.getSource()== b7)
{
new HomePage();
setVisible(false);
}
if(ae.getSource()== b8)
{
System.exit(0);
}
if(ae.getSource()== b9)
{
new KeyGenerationPage();
setVisible(false);
}
}
6.1 Introduction
Testing is the process of finding differences between the expected behaviour specified by
system models and the observed behaviour of the system. Testing is a critical role in quality
assurance and ensuring the reliability of development and these errors will be reflected in the
code so the application should be thoroughly tested and validated.
Testing is the process of finding differences between the expected behaviour specified
by system models and the observed behaviour of the system. Testing is a critical role in
quality assurance and ensuring the reliability of development and these errors will be
reflected in the code so the application should be thoroughly tested and validated.
Unit testing finds the differences between the object design model and its
corresponding components. Structural testing finds differences between the system design
model and a subset of integrated subsystems. Functional testing finds differences between the
use case model and the system.
In this test each component is tested independent of the other thus allowing parallelism in
testing activity.
Many tested modules are combined into subsystem. The emphasis is on testing interface
between modules. This activity can be considered to test the design.
6.2.3 System Testing:
6
This is a series of testing whose purpose 0
is to fully exercise the entire software system.
System testing verifies that all elements mesh properly and the overall system
function/performance is achieved. System testing is done using real data. The system
performance was found to be working to be as per requirements specified.
System testing ensures that the complete system compiles with the functional
requirements and non-functional requirements of the system, the following are some
system testing activities.
Functional testing finds differences between the functional between the functional
requirements and the system. This is a black box testing technique. Test cases are
divided from the use case model.
Performance testing finds differences between the design and the system the design
goals are derived from the functional requirements.
Pilot testing the system is installed and used by a selected set of users – users exercise
the system as if it had been permanently installed.
Acceptance testing, I have followed benchmarks testing in a benchmarks testing the
client prepares a set of test cases represent typical conditions under which the system
operates. In our project, there are no existing benchmarks.
But, there are certain benchmarks available on the Internet regarding the minimum and
maximum time limits for generating the random Big Integer values. We have used these
to test the system. Installation testing, the system is installed in the target environment.
6.4Condition testing:
Condition testing is a test case design method that exercises the logical conditions contained
in a module the condition testing focuses on testing each condition in the operation.
These tests are designed to validate functional requirements without regard to working of the
program. Black box testing technique focuses on the information domain of the software
deriving test cases by partitioning input and output in a manner that provides thorough test
coverage. This approach also deals with the identification of class libraries or software
packages or other application systems, which are already present so that developer can
implement the object models with a decreased burden of testing.
Testing a large system is a complex activity and like any complex activity. It has to be broke
into smaller activities. Thus incremental testing was performed on the project i.e.,
components and subsystems of the system were tested separately before integrating them to
form the subsystem for system testing.
Unit testing focuses on the building blocks of the software system that is the objects and
subsystems. There are three motivations behind focusing on components. First unit testing
reduces the complexity of overall test activities allowing focus on smaller units of the system,
second unit testing makes it easier to pinpoint and correct faults given that few components
are involved in the rest. Third unit testing allows parallelism in the testing activities, that is
each component are involved in the test. Third unit testing allows parallelism in the testing
activities that is each component can be tested independently of one another.
In this system each module of segment display, encryption and decryption are treated
as individual units and are tested individually
Equivalence testing:
It is a black box testing technique that minimizes the number of test cases. The possible
inputs are partitioned into equivalence classes and a test case is selected for each class.
Boundary testing:
It is a special case of equivalence testing and focuses on the conditions at the boundary of the
equivalence classes. Boundary testing requires that the elements be selected from the edges of
the equivalence classes.
Path testing:
It is a white box testing technique that identifies faults in the implementation of the
component the assumption here is that exercising all possible paths through the code at least
once. Most faults will trigger failure. This acquires knowledge of source code.
In this project, Individual units like login page, registration page are etc., tested.
Integration Testing:
Integration testing defects faults that have not been detected. During unit testing by focusing
on small groups on components two or more components are integrated and tested and once
tests do not reveal any new faults, additional components are added to the group. This
procedure allows testing of increasing more complex parts on the system while keeping the
location of potential faults relatively small. I have used the following approach to
implements and integrated testing.
6
Top-down testing strategy unit tests the components of the top layer and then integrated the
components of the next layer down. When all components of the new layer have been tested
together, the next layer is selected. This was repeated until all layers are combined and
involved in the test.
In this project, we first perform individual testing on the modules. Later some
modules like different issues, transaction table, and transaction trimming will be integrated to
form single unit.
Validation Testing:
The systems completely assembled as package, the interfacing have been uncovered and
corrected, and a final series of software tests are validation testing. The validation testing is
nothing but validation success when system functions in a manner that can be reasonably
expected by the customer. The system validation had done by series of Black-box test
methods.
System Testing:
1. System testing ensures that the complete system compiles with the functional requirements
and non-functional requirements of the system, the following are some system testing
activities.
2. Functional testing finds differences between the functional between the functional
requirements and the system. This is a black box testing technique. Test cases are divided
from the use case model.
3. Performance testing finds differences between the design and the system the design goals
are derived from the functional requirements.
4. Pilot testing the system is installed and used by a selected set of users – users exercise the
system as if it had been permanently installed.
5. Acceptance testing, I have followed benchmarks testing in a benchmarks testing the client
prepares a set of test cases represent typical conditions under which the system operates. In
our project, there are no existing benchmarks. But, there are certain benchmarks available on
6
4
the Internet regarding the minimum and maximum time limits for generating the random Big
Integer values. We have used these to test the system. Installation testing, the system is
installed in the target environment.
Finally, test whether the application is able to trimming the transaction successfully
and eliminated the different issues and receipts. This involves testing all the individual
systems of the application. This is achieved through System testing.
Testing accounts for 45 - 75% of the typical project effort. It is also one of the most
commonly underestimated activities on a project. A test plan is a document that answers the
basic questions about your testing effort. It needs to be initiated during the requirements
gathering phase of your project and should evolve into a roadmap for the testing phase.
Test Planning enables a more reliable estimate of the testing effort up front.
It allows the project team time to consider ways to reduce the testing effort without
being under time pressure.
Test Plan helps to identify problem areas and focuses the testing team’s attention on
the critical paths.
Test plan reduces the probability of implementing non-tested components.
6.6.1 Test Case Report
7.3.2 : After clicking on “save data to file” option to save cipher text in a
text file
7.3.3: Saved text file of Cipher Text
7.5 : Conclusion:
This algorithm provides good security for the data with key matrix and inverse
key matrix with mod 27. In future works there is a scope to provide high
security to the messages by using different matrix applications.
8. REFERENCES
7
9
9.2. List of Figures:
9 4.2.1 Example
10 4.2.2 Encryption
11 4.2.3 Decryption
15 7.15 Encryption
16 7.16 Decryption