Professional Documents
Culture Documents
Encryption System
By
SHAKKIRA.K
Enrolment no. 126596130
Dr. KABEER
COURSE COORDINATOR
AL FAROOK, FROOK COLLEGE, KOZHIKODE
1
Encryption System
Enrolment No : 126596130
Study Center : Al-Farook Educational Center
Regional Center : Vadakara, RCCode : 83
E-mail : shakkira.shaki@gmail.com
Telephone No : 9567398299
1. Name and Address of the Student : SHAKKIRA.K, KACHAKKARAN
(H),KIZHAKKUMPARAMBA,MALAPPURAM (DST)
2. Title of the Project : Encryption System
3. Name and Address of the counselor : Dr. V.KABEER
Date: Date:
2
Encryption System
CERTIFICATE
Date: Date:
SHAKKIRA.K
KACHAKKARAN(HOUSE)
PANDALLUR (PO),KIZHAKKUMPARAMBA
MALAPPURAM
Enrolment No:126596130
3
Encryption System
1. Shakkira
2. Subeesh
3. Lipin
4. Vinaya
4
Encryption System
ABSTRACT
In today’s world the networking plays a very important role in our life.
Most of the activities occur through the network. For the safe and secured
exchange of information, we need to have security. The encryption has very
wide applications for securing data.Encryption refers to set of algorithms,
which are used to convert the documents and any files to code or the
unreadable form of files, and provides privacy. To decrypt the file to receiver
uses the “key” for the encrypted files.
5
Encryption System
ACKNOWLEDGEMENT
With all praises to the almighty God whose abundant Grace and
Mercies enabled me to complete this project. I would like to express my
profound gratitude to all the people who have inspired and motivated me to
make this project a success.
Thanks are also due to all my faculties and friends, in my college for
their timely help during the tenure of the project. Once again I think one and
all who have helped me directly and indirectly in the successful completion of
the project work.
Thanking you
6
Encryption System
TABLE OF CONTENTS
TITLE PAGE
Abstract 5
Acknowledgement 6
Table of content 7
CHAPTER 1: INTRODUCTION
1.1 Background 10
1.2 Objectives 11
1.3 Purpose, Scope & Applicability 12
1.3.1 Purpose
1.3.2 Scope
1.3.3 Applicability
1.4 Achievements
1.5 Organization of Report 14
CHAPTER 2: SURVEY OF TECHNOLOGIES 15
7
Encryption System
7.1 Conclusion
REFERENCES
GLOSSARY
APPENDIX A
APPENDIX B
8
Encryption System
LIST OF FIGURES
Figure 3: Encryption 42
Figure 4: Decryption 43
9
Encryption System
CHAPTER 1: INTRODUCTION
1.1 Background
1.2 Objectives
The main objective of our project is to encrypt or decrypt the any files for
personal and professional security. Encryption and Decryption protects
privacy of our documents and sensitive files by encrypting them using
Advanced Encryption Standard (AES) algorithm to provide high protection
against unauthorized data access.
In today’s world the networking plays a very important role in our life.
Most of the activities occur through the network. For the safe and secured
exchange of information, we need to have security. The encryption has very
wide applications for securing data.Encryption refers to set of algorithms,
10
Encryption System
which are used to convert the documents and any files to code or the
unreadable form of files, and provides privacy. To decrypt the file to receiver
uses the “key” for the encrypted files.
If you want to send sensitive information via email, simply paste the
encrypted text or any files into your email or attach the encrypted file.
All the recipient has to do is to decrypt your text or any file. Encryption
and Decryption works with text information and any files. Just select what you
want to encrypt, and Encryption and Decryption software helps you keep
documents, private information and files in a confidential way.
11
Encryption System
1.3.1 Purpose
1.3.2 Scope
Each step is clearly stated and user will not face any ambiguity
in using the software.
The software provides clarity in its functionality even to naïve
users.
No complexity is involved.
12
Encryption System
1.3.3 Applicability
1.4 Achievements
Goal of Encryption
13
Encryption System
The 1st chapter the basic definition of terms that are used this report
and purpose of project and also gives the motivation behind implementing this
project.
The 2nd chapter gives the details of survey of technologies this project.
The 3rd chapter gives the details of requirement and analyzing the
project. It gives hardware, software and user requirements.
The 4th chapter gives the details of each modules used in this project.
The 6th chapter gives test reports and user documentation in this
project.
The 7th chapter gives conclusion, limitations and further scope of the
project.
14
Encryption System
There are a wide variety of languages available for doing this project
like C, C++, C#, VC++, JAVA etc.
15
Encryption System
Project Mission
Target
Our target is the common man who wants to interact client and server,
whether it is through messages, documents and any files etc. Through network
via file sending sensitive messages or documents over the network is very
dangerous.So, our project helps him to interact in a safe and secure manner in
order to keep their private information confidential.
Target Users
The main target users of our project are the people who transmit
confidential information network via file sending sensitive messages or
documentst hrough the client server interaction.
The scope of our project is presently specific. Both the sender and the
receiver must have this software installed on their systems to encrypt/decrypt
and compress/decompress the files transmitted between them. The system
provides the security and integrity of data or information.
16
Encryption System
During the analysis the data are collected from the available resources
for analysis. Information from the existing system, dataflow diagram, on site
observations and interviews are the various tools used during the analysis to
collect information. The natural problem solving process consists of the
following steps.
Identification of Need
17
Encryption System
Encryption is only one method which can be used when you want to
be able to protect your computer from harm and hackers. Encryption is
when you put a secret key or password on your work that will then
transform your data into an unreadable file if you don't have the secret
key and password. It is best to encrypt something that you will transfer
over the network because it has high chances of being stolen because it
is rather easy when it is being transferred so much from computer to
computer. Now the best way to transfer this secret key is face to face
because otherwise then the secret key might be taken by someone else
will you transfer it across the network. Encryption is a pretty easy
thing to do but if one of your documents really needs to be encrypted
for its safety it is extremely easy to find software to help you increase
your security.
Feasibility study
Behavioral Feasibility
Economic Feasibility
Technical feasibility
Operational Feasibility
18
Encryption System
Behavioral Feasibility
Technical Feasibility
Economic Feasibility
Operational Feasibility
no special training for the users. Encryption and Decryption was found to be
feasible in this regard. The system developed would be user friendly and no
complexities would be involved in its functionalities.
Existing System
In the existing system, the encrypted key is send with the document;
any user can view the encrypted document with that key. It means the security
provided for the encryption is not handled properly. And also the Key byte
(encrypted key) generate with random byte. Without the user interaction the
Key byte is generated. As observed the current encryption/decryption
software’s doing the encryption and decryption task are all very complicated
in their functionality. The method of encryption/decryption and key generation
of current system for a new user to understand is complex in nature.
Drawbacks
Some of the drawbacks are:
1. Lack of security
Proposed System
If you want to send sensitive information via network, simply paste the
encrypted file. All the recipient has to do is to decrypt your file.Encryption
20
Encryption System
and Decryption works with any information and files. Just select what you
want to encrypt, and Encryption and Decryption software helps you keep
documents, private information and files in a confidential way. The proposed
system will help the user to reduce consuming time. The system requires very
low system resources and the system will work only in network connections.
Benefits
Some of the difficulty is due to the scope of this phase. The software
project is imitated by the client needs. In the beginning these needs are in the
minds of various people in the client organization. The requirement analyst
has to identify the requirements by tacking to these people and understanding
their needs. In situations where the software is to automated a currently
21
Encryption System
The SRS is a means of translating the ideas in the minds of the clients
(the output) into formal document (the output of the requirements phase). Thus
the output of the phase is a set of formally specified requirements, which
hopefully are complete and consistent, while the input has none of these
properties.
Performance Requirements
The project must the end user requirements. Accuracy and fast must be
imposed in the Project. The project is development as easy as possible for the
sake of end user. The project has to be developed with view of satisfying the
future requirements and future enhancement. The tool has been finally
implemented satisfying the needs specified by the company. As per the
performance is concerned this system said is performing This processing as
well as tine taken to generate well reports were also even when large amount
of data was used.
Security Requirements
Design Requirements
To create project, add base masters and masters to the project, assign
behaviors to the master, create and assign behavior sets, and then apply, test
and validate those behaviors. It also shows how to create and build a stencil to
hold the shapes.
22
Encryption System
23
Encryption System
24
Encryption System
REQUIREM
ENT
GATHERIN
G
DESIGN
TEST CASES
CODING
QUALITY
ASSURANC
E
TESTING
BUILD
25
Encryption System
Hardware Requirements
26
Encryption System
About Java
27
Encryption System
28
Encryption System
JAVA Features:
As we know that the Java is an object oriented programming language
developed by Sun Microsystems of USA in 1991. Java is first programming
language which is not attached with any particular hardware or operating
system. Program developed in Java can be executed anywhere and on any
system.
Features of Java are as follows:
1. Compiled and Interpreted
2. Platform Independent and portable
3. Object- oriented
4. Robust and secure
5. Distributed
6. Familiar, simple and small
7. Multithreaded and Interactive
8. High performance
9. Dynamic and Extensible
29
Encryption System
First way is, Java compiler generates the byte code and that can be
executed on any machine. Second way is, size of primitive data types are
machine independent.
3. Object- oriented
Java is truly object-oriented language. In Java, almost everything is an
Object. All program code and data exist in objects and classes. Java comes
with an extensive set of classes; organize in packages that can be used in
program by Inheritance. The object model in Java is trouble-free and easy to
enlarge.
5. Distributed
Java is called as Distributed language for construct applications on
networks which can contribute both data and programs. Java applications can
open and access remote objects on Internet easily. That means multiple
programmers at multiple remote locations to work together on single task.
30
Encryption System
8. High performance
Java performance is very extraordinary for an interpreted language,
majorly due to the use of intermediate byte code. Java architecture is also
designed to reduce overheads during runtime. The incorporation of
multithreading improves the execution speed of program.
Net Beans IDE is a free, open source, popular (with approximately 1 million
downloads), integrated development environment used by many developers.
Out of the box, it provides built-in support for developing in Java, C, C++,
XML, and HTML. And this author especially likes the support for
editingJSPs, including syntax highlighting, HTML tag completion, JSP tag
completion, and Java codecompletion.
31
Encryption System
Functions
Features
The system is highly user friendly.
It uses different keys (a key pair) for encryption and decryption. These
algorithms are called "AES".
Benefits
32
Encryption System
Data flow oriented techniques advocate that the major data items
handled by a system must be first identified and then the processing required
on these data item to produce the desired output should be determined. The
DFD is a simple graphical information that can be used to represent a system
in terms of input data to the system, various processing carried out on these
data, and the output generated by the system. It was introduced by de
macro(1978), Gane and Sarson (1979). The primitive symbols used for
constructing DFD;s are:-
Source/Sink.
33
Encryption System
Encryptio Decryption
ORIGI n ENCRIP ENCRIPTED DATA ENCRI ORIGI
NAL TED PTED Using AES NAL
FILE
DATA COMMUNICATED DATA
FILE
Using
AES THROUGH NETWORK
Fig 1
34
Encryption System
0 – Level DFD
ENCRYPTIO
USER N SYSTEM REMOTE
NODE
1 – Level DFD
CLIENTU CLIENT
SER
MODULE
35
Encryption System
ENCRYPTIO
N MODULE STORE
ENCRIPTION
KEY
USER
ADMIN MANAGEMENT
USER
FILE
USER
TRANSFER DATA
INTO REMOTE
NODE
REMOTE
NODE
DECRYPTION
MODULE STORE
ENCRIPTION
KEY
36
Encryption System
USER
USER
CLIENT
CLIENT MANAGEME
MANAGEME
USER
USER
USER NT
NT
FILE
RECEIVE
RECEIVE
SERVER
DATA
DATA FROM
FROM
SERVER
SERVER
DECRYPTION
DECRYPTION
MODULE
MODULE REQUEST
ENCRIPTION
KEY
37
Encryption System
Select a file
Encrypt
Decrypt
Exit
Fig 2
38
Encryption System
The most challenging and creative phase of system life cycle is the
system design. In the design phase detailed design of the system selected in
study phase is accomplished. System design is a disciplined approach to
computer system designed that is easy to understand, reliable, long lasting, and
efficient. It should also be cost effective. It provides the understanding and
procedural details necessary for implementing the system recommended in the
feasibility study.
Input design
Input design is the process of coverting the user –originated input to a
computer based format. The design decision for handling input specify how
data are accepted for computer processing. Input design is a part of overall
system design that needs careful attention.
The collection of input data is considerd to be the most expensive part
of the system design.Since the inputs have to be planned in such a way so as to
get the relevant information,extreme care is taken to obtain the pertinent
information. If the data going into the system is incorrect then the processing
and outputs will magnify these errors. The goal of designing input data is to
make data entry as easy, logical and free from erors as possible.
39
Encryption System
Output Design
The output design phase of the system design is concerned with the
conveyance of information to the end users in a user friendly manneer. The
output design should be efficient, intelligible so that the systems relationship
with the end user is improved and thereby enhancing the process of decision
making.
The output design is an ongoing activity almost from the beginning of
the project, and follows the principles of form design. Efficient and well-
defined output design improves the relation of the system and the user, thus
facilitating decision making. The primary considerations in the design of the
output are the requirement of the information and the objectives of the end
users.The system ouput may be of any of the following.
A document.
A message.
40
Encryption System
Encryption
Start with text to be protected. Initial readable text is called clear text.
Encrypt the clear text so that it does not make any sense at all. The
nonsense text is called cipher text. The encryption is controlled by a
secret password or number; this is called the encryption key.
Fig 3
41
Encryption System
Fig 4
Secret key encryption: new mechanism for encryption where knowing the
encryption key does not help you to find decryption key, or vice versa.
42
Encryption System
Fig 5
43
Encryption System
44
Encryption System
45
Encryption System
46
Encryption System
47
Encryption System
Login.java
packageadvancedencriptionsystem;
importjava.awt.Color;
importjava.io.BufferedReader;
importjava.io.FileReader;
importjava.io.IOException;
public Login() {
initComponents();
@SuppressWarnings("unchecked")
48
Encryption System
String s = null,p=null;
String user=jTextField1.getText();
String pass=jPasswordField1.getText();
booleannullCheck=nullCheck(user, pass);
if (nullCheck) {
if(user.equals("admin")&&pass.equals("admin"))
newAdminHome().setVisible(true);
else
booleanisFound = false;
FileReader in = null;
try{
if (jTextField1.getText().contentEquals(record))
record=bin.readLine();
if(jPasswordField1.getText().contentEquals(record))
newUser_Home().setVisible(true);
49
Encryption System
else
jLabel4.setBackground(Color.red);
bin.close();
bin = null;
}catch(IOExceptionioe){
else
jLabel4.setBackground(Color.red);
this.dispose();
50
Encryption System
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(Login.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Login.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Login.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Login.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
new Login().setVisible(true);
51
Encryption System
});
if (userName.equals("") || password.equals("")) {
return false;
} else {
return true;
privatejavax.swing.JButton jButton1;
privatejavax.swing.JButton jButton2;
privatejavax.swing.JLabel jLabel1;
privatejavax.swing.JLabel jLabel2;
privatejavax.swing.JLabel jLabel3;
privatejavax.swing.JLabel jLabel4;
privatejavax.swing.JPanel jPanel1;
privatejavax.swing.JPasswordField jPasswordField1;
privatejavax.swing.JTextField jTextField1;
AdminHome.java
packageadvancedencriptionsystem;
importjava.io.BufferedReader;
importjava.io.BufferedWriter;
importjava.io.File;
52
Encryption System
importjava.io.FileNotFoundException;
importjava.io.FileReader;
importjava.io.IOException;
importjava.io.InputStream;
importjava.io.InputStreamReader;
importjava.io.ObjectOutputStream;
importjava.io.OutputStream;
importjava.io.OutputStreamWriter;
importjava.io.PrintWriter;
importjava.net.InetAddress;
importjava.net.ServerSocket;
importjava.net.Socket;
importjava.net.UnknownHostException;
importjava.util.logging.Level;
importjava.util.logging.Logger;
importjavax.swing.DefaultListModel;
String number=null;
publicAdminHome() {
initComponents();
try {
String files;
53
Encryption System
if (listOfFiles[i].isFile())
files = listOfFiles[i].getName();
resultList.addElement(files);
jList1.setModel(resultList);
Logger.getLogger(AdminHome.class.getName()).log(Level.SEVERE,
null, ex);
newUser_Registration().setVisible(true);
newEncriptionform().setVisible(true);
54
Encryption System
String input,output;
try {
InputStreamReader(skt.getInputStream()));
System.out.println("Server:" + in.readLine());
out.println("lalala");
out.close();
in.close();
skt.close();
catch(Exception e) {
System.out.println("haiiiiiiiiii");
55
Encryption System
private void
jButton7ActionPerformed(java.awt.event.ActionEventevt) {
try {
// TODO add your handling code here:
String files2;
File folder2 = new File(path2);
File[] listOfFiles2 = folder2.listFiles();
DefaultListModel resultList2 = new DefaultListModel();
for (int i = 0; i < listOfFiles2.length; i++)
{
if (listOfFiles2[i].isFile())
{
files2 = listOfFiles2[i].getName();
resultList2.addElement(files2);
}
}
ServerSocketmyServerSocket = new ServerSocket(9999);
Socket skt = myServerSocket.accept();
ObjectOutputStreamobjectOutput = new
ObjectOutputStream(skt.getOutputStream());
objectOutput.writeObject(resultList2);
objectOutput.flush();
skt.close();
myServerSocket.close();
56
Encryption System
}
try {
while(true)
{
//Reading the message from the client
socket = serverSocket.accept();
InputStream is = socket.getInputStream();
isr = new InputStreamReader(is);
br = new BufferedReader(isr);
number = br.readLine();
System.out.println("Message received from client is "+number);
is.close();
serverSocket.close();
socket.close();
jTextField2.setText(number);
}
} catch (IOException ex) {
Logger.getLogger(AdminHome.class.getName()).log(Level.SEVE
RE, null, ex);
57
Encryption System
private void
jButton4ActionPerformed(java.awt.event.ActionEventevt) {
// TODO add your handling code here:
}
private void
jButton3ActionPerformed(java.awt.event.ActionEventevt) {
}
Private void
jButton9ActionPerformed(java.awt.event.ActionEventevt) {
this.dispose();
}
58
Encryption System
privatejavax.swing.JButton jButton7;
privatejavax.swing.JButton jButton8;
privatejavax.swing.JButton jButton9;
privatejavax.swing.JLabel jLabel1;
privatejavax.swing.JLabel jLabel2;
privatejavax.swing.JLabel jLabel3;
privatejavax.swing.JList jList1;
privatejavax.swing.JList jList2;
privatejavax.swing.JScrollPane jScrollPane1;
privatejavax.swing.JScrollPane jScrollPane2;
privatejavax.swing.JSeparator jSeparator1;
privatejavax.swing.JSeparator jSeparator2;
privatejavax.swing.JTextField jTextField1;
privatejavax.swing.JTextField jTextField2;
// End of variables declaration
}
Encryptionform.java
packageadvancedencriptionsystem;
59
Encryption System
importjava.util.logging.Logger;
importjavax.crypto.Cipher;
importjavax.crypto.CipherInputStream;
importjavax.crypto.CipherOutputStream;
importjavax.crypto.SecretKey;
importjavax.crypto.SecretKeyFactory;
importjavax.crypto.spec.DESKeySpec;
importjavax.swing.JFileChooser;
public class Encriptionform extends javax.swing.JFrame {
String fname=null;
publicEncriptionform() {
initComponents();
}
private void
jButton1ActionPerformed(java.awt.event.ActionEventevt) {
// TODO add your handling code here:
finalJFileChooser fc = new JFileChooser();
fc.showOpenDialog(this);
String f = fc.getSelectedFile().getAbsolutePath();
fname=fc.getSelectedFile().getName();
jTextField1.setText(f);
private void
jButton2ActionPerformed(java.awt.event.ActionEventevt) {
// TODO add your handling code here:
60
Encryption System
try {
Key = encrypt(key);
//new AdminHome().setVisible(true);
this.dispose();
} catch (Exception ex) {
Logger.getLogger(Encriptionform.class.getName()).log(Level.SEV
ERE, null, ex);
}
String strkey=null;
strkey=Key.toString();
System.out.println("....."+strkey);
FileInputStreamfis;
try {
String s=jTextField1.getText();
String result = s.replace("\\","/");
fis = new FileInputStream(result);
FileOutputStreamfos = new
FileOutputStream("C:\\aes\\upload\\"+fname+"");
encrypt(strkey, fis, fos);
} catch (FileNotFoundException ex) {
Logger.getLogger(Encriptionform.class.getName()).log(Level.SEV
ERE, null, ex);
} catch (Throwable ex) {
Logger.getLogger(Encriptionform.class.getName()).log(Level.SEV
ERE, null, ex);
}
61
Encryption System
String NL = System.getProperty("line.separator");
bw.write(fname+NL);
bw.write(strkey+NL);
bw.write("$$$"+NL);
bw.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fop != null) {
try {
fop.close();
}
catch (IOException ex) {
Logger.getLogger(User_Registration.class.getName()).log(Level.S
EVERE, null, ex);
}
}
}
private void
jButton3ActionPerformed(java.awt.event.ActionEventevt) {
this.dispose();
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
newEncriptionform().setVisible(true);
}
});
62
Encryption System
}
public static byte[] encrypt(String x) throws Exception {
digest =
java.security.MessageDigest.getInstance("SHA-1");
digest.reset();
digest.update(x.getBytes("UTF-8"));
returndigest.digest();
}
63
Encryption System
SecretKeydesKey = skf.generateSecret(dks);
Cipher cipher = Cipher.getInstance("DES"); //
DES/ECB/PKCS5Padding for SunJCE
if (mode == Cipher.ENCRYPT_MODE) {
cipher.init(Cipher.ENCRYPT_MODE, desKey);
CipherInputStreamcis = new
CipherInputStream(is, cipher);
doCopy(cis, os);
} else if (mode == Cipher.DECRYPT_MODE) {
cipher.init(Cipher.DECRYPT_MODE, desKey);
CipherOutputStreamcos = new
CipherOutputStream(os, cipher);
doCopy(is, cos);
}
}
64
Encryption System
privatejavax.swing.JLabel jLabel1;
privatejavax.swing.JTextField jTextField1;
// End of variables declaration
}
User_Home.java
packageadvancedencriptionsystem;
import static advancedencriptionsystem.CipherExample.decrypt;
import static advancedencriptionsystem.Encriptionform.doCopy;
importjava.io.BufferedReader;
importjava.io.BufferedWriter;
importjava.io.File;
importjava.io.FileInputStream;
importjava.io.FileNotFoundException;
importjava.io.FileOutputStream;
importjava.io.FileReader;
importjava.io.IOException;
importjava.io.InputStream;
importjava.io.InputStreamReader;
importjava.io.ObjectInputStream;
importjava.io.OutputStream;
importjava.io.OutputStreamWriter;
importjava.io.PrintWriter;
importjava.net.InetAddress;
importjava.net.ServerSocket;
importjava.net.Socket;
importjava.net.UnknownHostException;
importjava.util.logging.Level;
importjava.util.logging.Logger;
importjavax.crypto.Cipher;
importjavax.crypto.CipherInputStream;
importjavax.crypto.CipherOutputStream;
65
Encryption System
importjavax.crypto.SecretKey;
importjavax.crypto.SecretKeyFactory;
importjavax.crypto.spec.DESKeySpec;
importjavax.swing.DefaultListModel;
public class User_Home extends javax.swing.JFrame {
private static Socket socket3;
private static Socket socket4;
publicUser_Home() {
initComponents();
try {
Socket socket = new Socket("192.168.1.26",9999);
DefaultListModel resultList2 = new DefaultListModel();
try {
ObjectInputStreamobjectInput = new
ObjectInputStream(socket.getInputStream()); //Error Line!
try {
Object object = objectInput.readObject();
resultList2 = (DefaultListModel) object;
socket.close();
jList1.setModel(resultList2);
} catch (ClassNotFoundException e) {
System.out.println("The title list has not come from the server");
e.printStackTrace();
}
} catch (IOException e) {
System.out.println("The socket for reading the object has
problem");
e.printStackTrace();
}
} catch (UnknownHostException e) {
e.printStackTrace();
66
Encryption System
} catch (IOException e) {
e.printStackTrace();
}
}
private void
jButton2ActionPerformed(java.awt.event.ActionEventevt) {
try {
String msg=null;
Object obj=jList1.getSelectedValue();
msg=String.valueOf(obj);
67
Encryption System
BufferedReader br1;
try
{
System.out.println("aaa");
String host = "192.168.1.26";
int port = 25005;
System.out.println("bbb");
InetAddress address = InetAddress.getByName(host);
socket4 = new Socket(address, port);
// Send the message to the server
System.out.println("aaaaa");
//Get the return message from the server
InputStream is = socket4.getInputStream();
System.out.println("ccc");
isr = new InputStreamReader(is);
System.out.println("ccc");
br1 = new BufferedReader(isr);
System.out.println("ccs");
System.out.println(""+br1.readLine());
String message = br1.readLine().toString();
System.out.println("ccc");
System.out.println("Message received from the server : "
+message);
// jTextField1.setText(message);
68
Encryption System
}
catch (Exception exception)
{
exception.printStackTrace();
}
finally
{
//Closing the socket
try
{
socket4.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
private void
jButton1ActionPerformed(java.awt.event.ActionEventevt) {
// TODO add your handling code here:
69
Encryption System
private void
jButton3ActionPerformed(java.awt.event.ActionEventevt) {
InputStreamReaderisr;
BufferedReader br1;
try
{
System.out.println("aaa");
String host = "192.168.1.26";
int port = 25005;
System.out.println("bbb");
70
Encryption System
// jTextField1.setText(message);
}
catch (Exception exception)
{
exception.printStackTrace();
}
finally
{
//Closing the socket
try
{
socket4.close();
}
catch(Exception e)
71
Encryption System
{
e.printStackTrace();
}
}
}
private void
jButton4ActionPerformed(java.awt.event.ActionEventevt) {
this.dispose(); // TODO add your handling code here:
}
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(User_Home.class.getName()).l
og(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(User_Home.class.getName()).l
og(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(User_Home.class.getName()).l
og(java.util.logging.Level.SEVERE, null, ex);
72
Encryption System
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
newUser_Home().setVisible(true);
}
});
}
73
Encryption System
if (mode == Cipher.ENCRYPT_MODE) {
cipher.init(Cipher.ENCRYPT_MODE, desKey);
CipherInputStreamcis = new
CipherInputStream(is, cipher);
doCopy(cis, os);
} else if (mode == Cipher.DECRYPT_MODE) {
cipher.init(Cipher.DECRYPT_MODE, desKey);
CipherOutputStreamcos = new
CipherOutputStream(os, cipher);
doCopy(is, cos);
}
}
// Variables declaration - do not modify
privatejavax.swing.JButton jButton1;
privatejavax.swing.JButton jButton2;
privatejavax.swing.JButton jButton3;
privatejavax.swing.JButton jButton4;
privatejavax.swing.JLabel jLabel1;
privatejavax.swing.JLabel jLabel2;
74
Encryption System
privatejavax.swing.JList jList1;
privatejavax.swing.JScrollPane jScrollPane1;
privatejavax.swing.JTextField jTextField1;
// End of variables declaration
}
User_Registration.Java
packageadvancedencriptionsystem;
importjava.awt.Color;
importjava.io.BufferedWriter;
importjava.io.File;
importjava.io.FileOutputStream;
importjava.io.FileWriter;
importjava.io.IOException;
importjava.util.logging.Level;
importjava.util.logging.Logger;
publicUser_Registration() {
initComponents();
String user=jTextField2.getText();
String pass=jPasswordField1.getText();
String conf=jPasswordField2.getText();
if(pass.equals(conf))
75
Encryption System
File file;
try {
bw.newLine();
String NL = System.getProperty("line.separator");
bw.write(user+NL);
bw.write(pass+NL);
bw.write("$$$"+NL);
bw.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fop != null) {
try {
fop.close();
Logger.getLogger(User_Registration.class.getName()).log(Level.SEVERE,
null, ex);
jTextField1.setText("");
jTextField2.setText("");
76
Encryption System
jPasswordField1.setText("");
jPasswordField2.setText("");
jLabel5.setText("");
else
jLabel5.setBackground(Color.red);
jLabel5.setText("password incorrect");
java.awt.EventQueue.invokeLater(new Runnable() {
newUser_Registration().setVisible(true);
});
privatejavax.swing.JButton jButton1;
privatejavax.swing.JButton jButton2;
77
Encryption System
privatejavax.swing.JLabel jLabel1;
privatejavax.swing.JLabel jLabel2;
privatejavax.swing.JLabel jLabel3;
privatejavax.swing.JLabel jLabel4;
privatejavax.swing.JLabel jLabel5;
privatejavax.swing.JLabel jLabel6;
privatejavax.swing.JPasswordField jPasswordField1;
privatejavax.swing.JPasswordField jPasswordField2;
privatejavax.swing.JTextField jTextField1;
privatejavax.swing.JTextField jTextField2;
78
Encryption System
Testing objectives.
The testing phase involves the testing of the development system using
various test data. After preparing the test data the system under study is
tested using these test data. While testing the system using the test data,
errors were found and corrected. Thus a series of test were performed system
before the system was ready for implementation. The various types of testing
done on the system are:
79
Encryption System
Unit testing.
Integration testing.
Validation testing
Output testing.
User acceptance testing.
Black box testing.
White box testing.
Using integrated test plans prepared in the design phase of the system
developed as a guide, the integration was carried out. All the errors found in the
system were corrected for the next testing steps.
80
Encryption System
81
Encryption System
Encryption files
Decryption files
Download files
Upload Files
Key Files
Login Form
82
Encryption System
Admin MainForm
83
Encryption System
84
Encryption System
CHAPTER 7: CONCLUSIONS
7.1 Conclusion
The whole system has been evaluated with simple data. It is absolutely
a menu driven system. The present system is free from all sorts’ problem and
drawbacks of existing system. This also feasible.
Technology constraint:
85
Encryption System
Time constraint:
The time giving for the submission of this project work was not really
enough for the researcher to extensively carry out more research on this work.
Financial constraint:
There was not enough money to extensively carry out this work.
86
Encryption System
REFERENCES
www.google.com
http://en.wikipedia.org/wiki/AES_algorithm
“Data Communications and Networking”, 4th Edition, by Behrouz A.
Forouzan, Tata McGraw Hill
GLOSSARY
APPENDIX A
APPENDIX B
87
Encryption System
88