Project Report For Aes
Project Report For Aes
Project Report For Aes
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 : [email protected]
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
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
8
Encryption System
APPENDIX B
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.
10
Encryption System
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.4Achievements
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
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
Feasibility study
18
Encryption System
Behavioral Feasibility
Economic Feasibility
Technical feasibility
Operational Feasibility
19
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
21
Encryption System
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
22
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.
23
Encryption System
24
Encryption System
25
Encryption System
DESIGN
TEST CASES
CODING
QUALITY
ASSURANC
E
TESTING
BUILD
26
Encryption System
Hardware Requirements
27
Encryption System
About Java
28
Encryption System
29
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
30
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.
31
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.
32
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
33
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.
34
Encryption System
Fig 1
35
Encryption System
0 – Level DFD
ENCRYPTION
SYSTEM
USER REMOTE
NODE
1 – Level DFD
ADMIN
MODULE
ADMINUSER USER
FILE
CLIENT
MODULE
CLIENTUSER
36
Encryption System
ENCRYPTION MODULE
USER
MANAGEMENT
ADMIN USER
USER FILE
REMOTE NODE
DECRYPTION
MODULE
37
Encryption System
USER
USER
MANAGEMENT
MANAGEMENT
CLIENTUSER
CLIENT USER
USER FILE
RECEIVERECEIVE
DATA FROM
DATASERVER
FROM SERVER SERVER
DECRYPTION
DECRYPTION
MODULE
MODULE
REQUEST ENCRIPTION KEY
38
Encryption System
Select a file
Encrypt
Decrypt
Exit
Fig 2
39
Encryption System
4.1Basic Modules
After doing the onsite observation, interview in the authority, and by
studying all the materials collected, the new system designed to remove the
drawback of the existing 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.
40
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.
41
Encryption System
4.2Procedural Design
A design methodology combines a systematic set of rules for creating a
program design with diagramming tools needed to represent it. Procedural
design is best used to model programs that have an obvious flow of data from
input to output. It represents the architecture of a program as asset of
interacting processes that pass data from one to another.
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
42
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.
43
Encryption System
In these systems, keys are inverses of each other: could just as easily
encrypt with decryption key and then use encryption key to recover
clear text.
Each user keeps one key secret, publicizes the other.
Fig 5
44
Encryption System
45
Encryption System
and the Love Letter worm each infected thousands of computers when users
downloaded and opened files sent in email.
This project discusses how doing things that are contrary to user
expectations can cause a security risk, and gives hints for creating a user
interface that minimizes the risk from social engineering attacks. Secure
human interface design is a complex topic affecting operating systems as well
as individual programs. This project gives only a few hints and highlights.
4.4Security Issues
Does security provide some very basic protections that we are naive to
believe that we don't need? During this time when the Internet provides
essential communication between tens of millions of people and is being
increasingly used as a tool for commerce, security becomes a tremendously
important issue to deal with. There are many aspects to security and many
applications, Ranging from secure commerce and payments to private
Communications and protecting passwords. One essential aspect for secure
communications is that of cryptography.
Cryptography is the science of writing in secret code and is an ancient
art. The first documented use of cryptography in writing dates back to circa
1900 B.C. when an Egyptian scribe used non-standard hieroglyphs in an
inscription.
In data and telecommunications, cryptography is necessary when
communicating over any untreated medium, which includes just about any
network, particularly the Internet.
Within the context of any application-to-application communication,
there are some specific security requirements, including:
46
Encryption System
47
Encryption System
The system can be implemented only after through testing is done. This
method is also offers the greatest security since the existing system can take
over if the errors are found or inability to handle certain type of transaction.
While using the new system.
48
Encryption System
Login.java
packageadvancedencriptionsystem;
importjava.awt.Color;
importjava.io.BufferedReader;
importjava.io.FileReader;
importjava.io.IOException;
public Login() {
initComponents();
@SuppressWarnings("unchecked")
49
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);
50
Encryption System
else
jLabel4.setBackground(Color.red);
bin.close();
bin = null;
}catch(IOExceptionioe){
else
jLabel4.setBackground(Color.red);
this.dispose();
51
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);
52
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;
53
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;
54
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);
55
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");
56
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();
57
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);
58
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();
}
59
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;
60
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:
61
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);
}
62
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);
}
});
63
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();
}
64
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);
}
}
65
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;
66
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();
67
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);
68
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);
69
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:
70
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");
71
Encryption System
// jTextField1.setText(message);
}
catch (Exception exception)
{
exception.printStackTrace();
}
finally
{
//Closing the socket
try
{
socket4.close();
}
catch(Exception e)
72
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);
73
Encryption System
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
newUser_Home().setVisible(true);
}
});
}
74
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;
75
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))
File file;
76
Encryption System
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("");
jPasswordField1.setText("");
77
Encryption System
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;
privatejavax.swing.JLabel jLabel1;
privatejavax.swing.JLabel jLabel2;
78
Encryption System
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;
79
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:
Unit testing.
Integration testing.
80
Encryption System
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.
81
Encryption System
82
Encryption System
Encryption files
Decryption files
Download files
Upload Files
Key Files
Login Form
Admin MainForm
83
Encryption System
84
Encryption System
85
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:
86
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:
87
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
88
Encryption System
89