0% found this document useful (0 votes)
91 views44 pages

Suspicious Email

This document describes a project to detect suspicious emails by identifying keywords. The purpose is to flag emails containing offensive or anti-social content and block them, in order to identify suspicious users. The system architecture uses a three-tier structure with presentation, business logic and data layers. Key modules include login, registration, encryption, user functions like email composition, and a mailing system.

Uploaded by

ishita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views44 pages

Suspicious Email

This document describes a project to detect suspicious emails by identifying keywords. The purpose is to flag emails containing offensive or anti-social content and block them, in order to identify suspicious users. The system architecture uses a three-tier structure with presentation, business logic and data layers. Key modules include login, registration, encryption, user functions like email composition, and a mailing system.

Uploaded by

ishita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 44

1.

INTRODUCTION

1.1 SCOPE
In this project, suspicious users are identified by determining the keywords used by
him/her. The keywords such as bomb, sex, terrorist, RDX etc. are found in the mails which
are sent by the user. All these blocked mails are checked by the administrator and identify the
users who sent such mails. This is very useful in real-time scenario in which you can resume
the anti-social activities.

1.2 PURPOSE OF THE PROJECT

The purpose of the project is to suspect the E-mails which consist of offensive, anti-
social elements and block them which help in identifying the suspicious user.

3.1 OVERVIEW OF PROJECT


1) Login Module

2) Registration Module

3) Encryption Module

4) User Module

5) Mailing Module

3.1.1 Login Module

This module is used by administrator and users (who are authenticated) to login into
the Colors mail. The login details of the specified person will be entered and hence can enter
into the Colors mail.

SUSPICIOUS EMAIL DETECTION 1


1.3.2 Registration Module

This module is used by the unauthenticated users who are unregistered. The users
must register themselves such that they can login into the Colors mail.

1.3.3 Encryption Module

This module is used by the administrator to perform the functions like encryption of
the words. The encrypted words are sent to the database and hence managed by the
administrator.

1.3.4 User Module

This module is used by the users to do operations like composing mail, checking out
the mails in inbox and finally sending the mails to the authenticated users by attaching a
message.

1.3.5 Mailing Module

This module is used by the users perform mailing system. The mailing system
consists of composing the mails, sending the mails and checking out the mails in inbox.

This module allows employees to register and manage patient details. When a request
is made, an employee immediately dispatches an ambulance with available doctor and other
attendants. Employee keeps track of patient status and in case of emergency consults a
hospital for admitting the patient.

SUSPICIOUS EMAIL DETECTION 2


1.4 SYSTEM ARCHITECTURE

Below architecture diagram represents mainly flow of requests from users to


database through servers. In this scenario overall system is designed in three tires separately
using three layers called presentation layer, business logic layer and data link layer. This
project was developed using 3-tire architecture.

User

SERVER
Request Response

Dat
a
Bas
e

SUSPICIOUS EMAIL DETECTION 3


URL Pattern:

Presentatio
n Layer
Response URL
sent from Request
the servlet sent
through the
SERVLETS
browser
AT THE
SERVER
Reply from SIDE Verifying or
the database updating the
according to database
the through a
statement statement

DATABASE

URL pattern represents how the requests are flowing through one layer to another layer
and how the responses are getting by other layers to presentation layer through server in
architecture diagram.

SUSPICIOUS EMAIL DETECTION 4


1.5 LITERATURE SURVEY

1.5.1 ABOUT JAVA

Initially the language was called as “oak” but it was renamed as “java” in 1995.The
primary motivation of this language was the need for a platform-independent (i.e. architecture
neutral) language that could be used to create software to be embedded in various consumer
electronic devices.

 Java is a programmer’s language


 Java is cohesive and consistent
 Except for those constraint imposed by the Internet environment. Java gives
the programmer, full control
Finally Java is to Internet Programming where c was to System Programming.

Initially the language was called as “oak” but it was renamed as “java” in 1995.The
primary motivation of this language was the need for a platform-independent (i.e. architecture
neutral) language that could be used to create software to be embedded in various consumer
electronic devices.

 Java is a programmer’s language


 Java is cohesive and consistent
 Except for those constraint imposed by the Internet environment. Java gives
the programmer, full control
Finally Java is to Internet Programming where c was to System Programming.

1.5.1.1 IMPORTANCE OF JAVA TO THE INTERNET

Java has had a profound effect on the Internet. This is because; java expands the
Universe of objects that can move about freely in Cyberspace. In a network, two categories of
objects are transmitted between the server and the personal computer. They are passive
information and Dynamic active programs. in the areas of Security and probability. But Java
addresses these concerns and by doing so, has opened the door to an exciting new form of
program called the Applet.

SUSPICIOUS EMAIL DETECTION 5


1.5.1.2 APPLICATIONS AND APPLETS

An application is a program that runs on our Computer under the operating system of
that computer. It is more or less like one creating using C or C++ .Java’s ability to create
Applets makes it important. An Applet I san application, designed to be transmitted over the
Internet and executed by a Java-compatible web browser. An applet I actually a tiny Java
program, dynamically downloaded across the network, just like an image. But the difference
is, it is an intelligent program, not just a media file. It can be react to the user input and
dynamically change.

1.5.1.3 JAVA ARCHITECTURE

Java architecture provides a portable, robust, high performing environment for


development. Java provides portability by compiling the byte codes for the Java Virtual
Machine, which is then interpreted on each platform by the run-time environment. Java is a
dynamic system, able to load code when needed from a machine in the same room or across
the planet.

1.5.1.4 COMPLILATION OF CODE

When you compile the code, the Java compiler creates machine code (called byte code)
for a hypothetical machine called Java Virtual Machine (JVM). The JVM is supposed t
executed the byte code. The JVM is created for the overcoming the issue of probability.
The code is written and compiled for one machine and interpreted on all machines .This
machine is called Java Virtual Machine.

SUSPICIOUS EMAIL DETECTION 6


1.5.1.5 COMPILING AND INTERPRETING JAVA SOURCE CODE

Java
Pc Java Byte interpreter
compiler code
Java
Macintosh
interpreterm
compiler
Platform acintosh
Source independ
code ent
SPARC Java
Compiler interpreter(
SPARC)

Fig. 3.1

During run-time the Java interpreter tricks the byte code file into thinking that it is running
on a Java Virtual Machine. In reality this could be an Intel Pentium windows 95 or sun SPARCstation
running Solaris or Apple Macintosh running system and all could receive code from any computer
through internet and run the Applets.

1.5.1.6 SIMPLE

Java was designed to be easy for the Professional programmer to learn and to use
)))
effectively. If you are an experienced C++ Programmer. Learning Java will oriented features
of C++ . Most of the confusing concepts from C++ are either left out of Java or implemented
in a cleaner, more approachable manner. In Java there are a small number of clearly defined
ways to accomplish a given task.

1.5.1.7 OBJECT ORIENTED


Java was not designed to be source-code compatible with any other language. This
allowed the Java team the freedom to design with a blank state. One outcome of this was a
clean usable, pragmatic approach to objects. The object model in Java is simple and easy to
extend, while simple types, such as integers, are kept as high-performance non-objects.

SUSPICIOUS EMAIL DETECTION 7


1.5.1.8 ROBUST
The multi-platform environment of the web places extraordinary demands on a
program, because the program must execute reliably in a variety of systems.The ability to
create robust programs. Was given a high priority in the design of Java. Java is strictly typed
language; it checks your code at compile time and runtime.

Java virtually eliminates the problems of memory management and deal location, which is
completely automatic. In a well-written Java program, all run-time errors can and should be
managed by your program.

1.5.2 SERVLET

1.5.2.1 INTRODUCTION

A Servlet is a generic server extension. a Java class that can be loaded Dynamically
to expand the functionality of a server. Servlets are commonly used with web servers.Where
they can take the place CGI scripts.
A servlet is similar to proprietary server extension, except that it runs inside a Java
Virtual Machine (JVM) on the server, so it is safe and portable Servlets operate solely within
the domain of the server.
Unlike CGI and Fast CGI, which use multiple processes to handle separate program or
separate requests, separate threads within web server process handle all servlets. This means
that servlets are all efficient and scalable. Servlets are portable; both across operating systems
and also across web servers. Java Servlets offer the best possible platform for web application
development.
Servlets are used as replacement for CGI scripts on a web server,they can extend any
sort of server such as a mail server that allows servlets extend its functionality perhaps by
performing a virus scan on all attached documents or handling mail filtering tasks.
Servlets provide a Java-based solution used to address the problems currently associated
with doing server-side programming including inextensible scripting solutions platform-
specific API’s and incomplete interface.Servlets are objects that conform to a specific
interface that can be plugged into a Java-based server.

SUSPICIOUS EMAIL DETECTION 8


Servlets are to the server-side what applets are to the server-side what applets are to the
client-side-object byte codes that can be dynamically loaded off the net. They differ from
applets in than they are faceless objects(without graphics or a GUI component).They serve as
platform independent, dynamically loadable,plugable helper byte code objects on the server
side that can be used to dynamically extend server-side functionality.
For example an HTTP servlet can be used to generate dynamic HTML content when
you use servlets to do dynamic content you get the following advantages:
 They’re faster and cleaner then CGI scripts
 They use a standard API( the servlet API)
 They provide all the advantages of Java (run on a variety of servers without
needing to be rewritten

1.5.2.2 ATTRACTIVENESS OF SERVLETS

They are many features of servlets that make them easy and attractive to use these
include:
 Easily configure using the GUI-based Admin tool
 Can be Loaded and Invoked from a local disk or remotely across the network.
 Can be linked together or chained, so that on servlet can call another servlet or
several servlets in sequence.
 Can be called dynamically from within HTML, pages using server-side include-tags.
 Are secure-even when downloading across the network, the servlet security model
and servlet and box protect your system from unfriendly behavior.

1.5.2.3 ADVANTAGES OF THE SERVLET API


 One of the great advantages of the servlet API is protocol independent. It assumes
nothing about:
 The protocol being used to transmit on the net
 How it is loaded
 The server environment it will be running in

SUSPICIOUS EMAIL DETECTION 9


 These quantities are important, because it allows the Servlet API to be embedded in
many different kinds of servers. There are other advantages to the servlet. API as well
These include:
 It’s extensible-you can inherit all your functionality from the base classes made
available to you
 It’s simple small, and easy to use.

1.5.2.4 FEATURES OF SERVLETS

 Servlets are persistent.Servlet are loaded only by the web server and can maintain
services between requests.
 Servlets are fast. Since servlets only need to be l\loaded once, they offer much better
performance over their CGI counterparts.
 Servlets are platform independent.
 Servlets are extensible Java is a robust, object-oriented programming language, which
easily can be extended to suit your needs.
 Servlets are secure
 Servlets are used with a variety of client.

Servlets are classes and interfaces from tow packages,javax .servlet and
javax.servlet.http.The java.servlet package contains classes t support generic, protocol-
independent servlets.The classes in the javax.servelt.http package To and HTTP specific
functionality extend these classes
Every servlet must implement the javax.servelt interface. Most servlets implement it by
extending oneoftwo classes.javax.servlet.GenericServlet or javax.servlet.http.HttpServlet. A
protocol-independent servlet should subclass Generic-Servlet.while an Http servlet should
subclass HttpServlet, which is itself a subclass of Generic-servlet with added HTTP-specific
functionality.
Unlike a java program, a servlet does not have a main() method,Instead the server in the
process of handling requests invoke certain methods of a servlet.Each time the server
dispatches a request to a servlet, it invokes the servelts Service() method,

SUSPICIOUS EMAIL DETECTION 10


A generic servlet should override its service() method to handle requests as appropriate for
the servlet.The service() accepts two parameters a request object and a response object .The
request object tells the servlet about the request, while the response object is used to return a
response
InContrast.anHttp servlet usually does not override the service() method.Instead it overrides
doGet() to handle GET requests and doPost() to handle Post requests. An Http servlet can
override either or both of these modules the service() method of HttpServlet handles the setup
and dispatching to all the doXXX() methods.which iswhy it usually should not be overridden
The remainders in the javax.servlet and javax.servlet.http.package are largely support
classes .The ServletRequest and ServletResponse classes in javax.servlet provide access to
generic server requests and responses while HttpServletRequest and HttpServletResponse
classes in javax.servlet provide access to generic server requests and responses while
HttpServletRequest and HttpServletResponse in javax.servlet.http provide access a HTTP
requests and responses . The javax.servlet.http provide contains an HttpSession class that
provides built-in session tracking functionality and Cookie class that allows quickly setup and
processing HttpCookies.

1.5.3 JSP
The first JavaServer Pages specification was released in 1999. Originally JSP was
modeled after other server-side template technologies to provide a simple method of
embedding dynamic code with static markup. When a request is made for the content of a
JSP, a container interprets the JSP, executes any embedded code, and sends the results in a
response. At the time this type of functionality was nothing terribly new, but it was and still is
a helpful enhancement to Servlets.
JSP has been revised several times since the original release, each adding functionality,
and is currently in version 2.0. The JSP specifications are developed alongside the Servlet
specifications and can be found on Sun Microsystems’
JavaServer Pages product information page,http://java.sun.com/products/jsp.The
functionality defined by the JSP 2.0 specifications can be broken down as follows:
 JSP

SUSPICIOUS EMAIL DETECTION 11


The JSP specifications define the basic syntax and semantics of a JavaServer Page. A
basic JavaServer Page consists of plain text and markup and can optionally take advantage of
embedded scripts and other functionality for creating dynamic content.

 JavaBeans
JavaBeans are not defined by the JSP specifications, but JSP does provide support for
easily using and manipulating them. Often objects used on the server-side of a Web
Application are in the form of what is commonly called a JavaBean.
 Custom Tags and JSP Fragments
JSP provides a mechanism for linking what would normally be static markup to
custom Java code. This mechanism is arguably one of the strong points of JSP and can be
used in place of or to complement embedded scripts of Java code.

 Expression Language
JSP includes a mechanism for defining dynamic attributes for custom tags. Any
scripting language can be used for this purpose; usually Java is implemented, but the JSP
specification defines a custom expression language designed specifically for the task. Often
the JSP EL is a much simpler and more flexible solution, especially when combined with JSP
design patterns that do not use embedded scripts.
Discussing the basics of JSP is the focus of this chapter. JavaBeans, Custom Tags, and the
JSP Expression Language are all fully discussed in later chapters after a proper foundation of
JSP is established.

1.5.3.1 JSP LIFE CYCLE


Much like Servlets, understanding JSP requires understanding the simple life cycle that
JSP follows. JSP follows a three-phase life cycle: initialization, service, and destruction, as
shown in Figure 3-1. This life cycle should seem familiar and is identical to the one described
for Servlets.
While a JSP does follow the Servlet life cycle, the methods have different names.
Initialization corresponds to the jspInit() method, service corresponds to the _jspService()
method, and destruction corresponds to the jspDestroy() method. The three phases are all

SUSPICIOUS EMAIL DETECTION 12


used the same as a Servlet and allow a JSP to load resources, provide service to multiple
client requests, and destroy loaded resources when the JSP is taken out of service.

JSP is designed specifically to simplify


the task of creating text producing HttpServlet objects and does so by eliminating all the
redundant parts of coding a Servlet. Unlike with Servlets there is no distinction between a
normal JSP and one meant for use with HTTP. All JSP are designed to be used with HTTP
and to generate dynamic content for the World Wide Web. The single JSP _jspService()
method is also responsible for generating responses to all seven of the HTTP methods. For
most practical purposes a JSP developer does not need to know anything about HTTP, nor
anything more than basic Java to code a dynamic JSP.

1.5.4 ORACLE
Oracle is a relational database management system, which organizes data in the form
of tables. Oracle is one of many database servers based on RDBMS model, which manages a
seer of data that attends three specific things-data structures, data integrity and data
manipulation.
With oracle cooperative server technology we can realize the benefits of open,
relational systems for all the applications. Oracle makes efficient use of all systems resources,
on all hardware architecture; to deliver unmatched performance, price performance and
scalability. Any DBMS to be called as RDBMS has to satisfy Dr.E.F.Codd’s rules.

1.5.4.1 FEATURES OF ORACLE


PORTABLE
The Oracle RDBMS is available on wide range of platforms ranging from PCs to
super computers and as a multi user loadable module for Novel NetWare, if you develop

SUSPICIOUS EMAIL DETECTION 13


application on system you can run the same application on other systems without any
modifications.

COMPATIBLE
Oracle commands can be used for communicating with IBM DB2 mainframe
RDBMS that is different from Oracle, which is Oracle compatible with DB2. Oracle RDBMS
is a high performance fault tolerant DBMS, which is specially designed for online transaction
processing and for handling large database applications.

MULTITHREADED SERVER ARCHITECTURE


Oracle adaptable multithreaded server architecture delivers scalable high performance
for very large number of users on all hardware architecture including symmetric
multiprocessors (sumps) and loosely coupled multiprocessors. Performance is achieved by
eliminating CPU, I/O, memory and operating system bottlenecks and by optimizing the
Oracle DBMS server code to eliminate all internal bottlenecks.
Oracle has become the most popular RDBMS in the market because of its ease of use
 Client/server architecture.
 Data independence.
 Ensuring data integrity and data security.
 Managing data concurrency.
 Parallel processing support for speed up data entry and online transaction processing
used for applications.
 DB procedures, functions and packages.

1.5.4.1 Dr.E.F.CODD’S RULES


These rules are used for valuating a product to be called as relational database
management systems. Out of 12 rules, a RDBMS product should satisfy at least 8 rules + rule
called rule 0 that must be satisfied.

RULE 0: FOUNDATION RULE

SUSPICIOUS EMAIL DETECTION 14


For any system to be advertised as, or claimed to be relational DBMS should manage
database with in itself, without using an external language
RULE 1: INFORMATION RULE
All information in relational database is represented at logical level in only one way as
values in tables.
RULE 2: GUARANTEED ACCESS
Each and every data in a relational database is guaranteed to be logically accessibility
by using to a combination of table name, primary key value and column name.
RULE 3: SYSTEMATIC TREATMENT OF NULL VALUES
Null values are supported for representing missing information and inapplicable
information. They must be handled in systematic way, independent of data types.
RULE 4: DYNAMIC ONLINE CATALOG BASED RELATION MODEL
The database description is represented at the logical level in the same way as ordinary
data so that authorized users can apply the same relational language to its interrogation as
they do to the regular data.
RULE 5: COMPREHENSIVE DATA SUB LANGUAGE
A relational system may support several languages and various models of terminal
use. However there must be one language whose statement can express all of the following
DataDefinitions,ViewDefinitions,DataManipulations,Integrity,Constraints,Authorization .
RULE 6: VIEW UPDATING
Any view that is theoretical can be updatable if changes can be made to the tables that
effect the desired changes in the view.
RULE 7: HIGH LEVEL UPDATE, INSERT AND DELETE
The capability of handling a base relational or derived relational as a single operand
applies not only retrieval of data also to its insertion, updating, and deletion.

RULE 8: PHYSICAL DATA INDEPENDENCE


Application program and terminal activities remain logically unimpaired whenever any
changes are made in either storage representation or access method.
RULE 9: LOGICAL DATA INDEPENDENCE
Application programs and terminal activities remain logically unimpaired whenever
any changes are made in either storage representation or access methods.

SUSPICIOUS EMAIL DETECTION 15


RULE 10: INTEGRITY INDEPENDENCE
Integrity constraints specific to particular database must be definable in the relational
data stored in the catalog, not in application program.
RULE 11: DISTRIBUTED INDEPENDENCE
Whether or not a system supports database distribution, it must have a data sub-
language that can support distributed databases without changing the application program.
RULE 12: NON SUB-VERSION
If a relational system has low level language, that low language cannot use to
subversion or by pass the integrity rules and constraints expressed in the higher level
relational language.

1.5.4.2 ORACLE SUPPORTS THE FOLLOWING CODD’S RULES


Rule 1: Information Rule (Representation of information)-YES.
Rule 2: Guaranteed Access-YES.
Rule 3: Systematic treatment of Null values-YES.
Rule 4: Dynamic on-line catalog-based Relational Model-YES.
Rule 5: Comprehensive data sub language-YES.
Rule 6: View Updating-PARTIAL.
Rule 7: High-level Update, Insert and Delete-YES.
Rule 8: Physical data Independence-PARTIAL.
Rule 9: Logical data Independence-PARTIAL.
Rule 10: Integrity Independence-PARTIAL.
Rule 11: Distributed Independence-YES.
Rule 12: Non-subversion-YES.

SUSPICIOUS EMAIL DETECTION 16


2. DESIGN

Systems design is the process or art of defining the architecture,components,


modules, interfaces, and data for a system to satisfy specified requirements. One could see it
as the application of systems theory to product development. There is some overlap and
synergy with the disciplines of systems analysis, systems architecture and systems
engineering.

2.1 UML DIAGRAMS

2.1.1 UNIFIED MODELING LANGUAGE

The Unified Modeling Language allows the software engineer to express an analysis
model using the modeling notation that is governed by a set of syntactic semantic and
pragmatic rules.A UML system is represented using five different views that describe the
system from distinctly different perspective. Each view is defined by a set of diagram, which
is as follows.

2.1.1.1 USER MODEL VIEW


 This view represents the system from the users perspective.
 The analysis representation describes a usage scenario from the end-users
perspective.
2.1.1.2 STRUCTURAL MODEL VIEW
 In this model the data and functionality are arrived from inside the system.
 This model view models the static structures.
2.1.1.3 BEHAVIORAL MODEL VIEW
It represents the dynamic of behavioral as parts of the system, depicting
the interactions of collection between various structural elements described in
the user model and structural model view.

2.1.1.4 IMPLEMENTATION MODEL VIEW


In this the structural and behavioral as parts of the system are represented as
they are to be built.

SUSPICIOUS EMAIL DETECTION 17


2.1.1.5 ENVIRONMENTAL MODEL VIEW

In this the structural and behavioral aspects of the environment in which the system
is to be implemented are represented.
UML is specifically constructed through two different domains they are:
 UML Analysis modeling, this focuses on the user model and structural model views
of the system.
 UML design modeling, which focuses on the behavioral modeling, implementation
modeling and environmental model views.
Use case Diagrams represent the functionality of the system from a user’s point of
view. Use cases are used during requirements elicitation and analysis to represent the
functionality of the system. Use cases focus on the behavior of the system from external point
of view.
Actors are external entities that interact with the system. Examples of actors include
users like administrator, bank customer …etc., or another system like central database.

2.2 DATA FLOW DIAGRAMS

2.2.1 ADMIN

Fig. 2.1 Data Flow Diagram for Admin

SUSPICIOUS EMAIL DETECTION 18


2.2.2 USER

Fig. 2.2 Data Flow Diagram for User

2.3 CLASS DIAGRAMS

2.3.1 ADMIN

Keywords
Manage Keywords

Add Keywords()
Display Keywords()

Admin
Keywords
Alert Mails
Informative
Block List
Enter keywords() Alert Mails
check mails() Informative Mails

check mails()

SUSPICIOUS EMAIL DETECTION 19


Fig. 2.3 Class Diagram for Admin

2.3.2USER

Compose Mails
composing the mail

send the mail()

Sent Mails
User
Sent items
Mails
check the sent items()
Compose()
send()

Inbox
Received mails

check the received mails()

Fig. 2.4 Class Diagram for User

2.4 SEQUENCE DIAGRAM

2.4.1 ADMIN

SUSPICIOUS EMAIL DETECTION 20


Admin Keywords Alert List Informative

Manage Keywords

Check Alert Mails

Check Informative Mails

Fig. 2.5 Sequence Diagram for Admin

2.4.2 USER

User Compose Mails Inbox Sent Items

Compose the mails to be sent

Check the mails

Check the sent mails

Fig. 2.6 Sequence Diagram for User

2.5 COLLABORATION DIAGRAM

2.5.1 ADMIN

SUSPICIOUS EMAIL DETECTION 21


Keyword
s

Admin Alert
Mails

Informativ
e Mails

Fig. 2.7 Collaboration Diagram for Admin

2.5.2 USER

Compos
e Mail

User Inbox

Sent
Items

Fig. 2.8 Collaboration Diagram for User

2.6 OBJECT DIAGRAM

2.6.1 ADMIN

SUSPICIOUS EMAIL DETECTION 22


Fig. 2.9 Object Diagram for Admin

2.6.2 USER

Fig. 2.10 Object Diagram for Use

2.7 USECASE DIAGRAM

2.7.1 ADMIN

SUSPICIOUS EMAIL DETECTION 23


Keywords

Alert Mails
Admin

Informative Mails

Fig. 2.11 Usecase Diagram for Admin

2.7.2 USER

Compose Mail

Inbox
User

Sent Items

Fig. 2.7.2 Usecase Diagram for User

2.8 COMPONENT DIAGRAM

2.8.1 ADMIN

SUSPICIOUS EMAIL DETECTION 24


Keywords

Admin Alert Mails

Informative
Mails

Fig. 2.13 Component Diagram for Admin

2.8.2 USER

Compose
Mail

User Inbox

Sent Items

Fig. 2.14 Component Diagram for User

2.9 DEPLOYMENT DIAGRAM

2.9.1 ADMIN

SUSPICIOUS EMAIL DETECTION 25


2.9.2 USER

Compos
e Mails

User Inbox

Sent
Items

Fig. 2.16 Deployment Diagram for User

3. IMPLEMENTATION REQUIREMENTS

3.1 HARDWARE REQUIREMENTS


Processor : Pentium-III (or) Higher
RAM : 64MB (or) Higher
Cache : 512MB
Hard disk : 10GB

3.2 SOFTWARE REQUIREMENTS

Technology : Java
Database : MySql
JDK Version : JDK1.5

SUSPICIOUS EMAIL DETECTION 26


4. LAYOUT

4.1 CODING

Login.java

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

/*
* login.java
*
* Created on 22 Apr, 2017, 5:55:32 PM
*/

package regt;

/**
*
* @author DELL
*/
import java.awt.Toolkit;
import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
public class login extends javax.swing.JFrame {

/** Creates new form login */

SUSPICIOUS EMAIL DETECTION 27


public login() {
initComponents();

int lebar = this.getWidth()/2;


int tinggi = this.getHeight()/2;
int x = (Toolkit.getDefaultToolkit().getScreenSize().width/2)-
lebar;
int y = (Toolkit.getDefaultToolkit().getScreenSize().height/2)-
tinggi;
this.setLocation(x, y);

/** This method is called from within the constructor to


* initialize the form.
* WARNING: Do NOT modify this code. The content of this method
is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
private void initComponents() {

jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
t1 = new javax.swing.JTextField();
p1 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel1.setFont(new java.awt.Font("Book Antiqua", 1, 14));


jLabel1.setForeground(new java.awt.Color(0, 0, 204));
jLabel1.setText("Password:");
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(60, 120, -1, -1));

jLabel2.setFont(new java.awt.Font("Book Antiqua", 1, 14));


jLabel2.setForeground(new java.awt.Color(0, 0, 204));
jLabel2.setText("Email Checker");
getContentPane().add(jLabel2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(180, 40, -1, -1));

jLabel3.setFont(new java.awt.Font("Book Antiqua", 1, 14));


jLabel3.setForeground(new java.awt.Color(0, 0, 204));

SUSPICIOUS EMAIL DETECTION 28


jLabel3.setText("User Name:");
getContentPane().add(jLabel3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(60, 70, -1, -1));

t1.setFont(new java.awt.Font("Book Antiqua", 1, 14));


t1.setForeground(new java.awt.Color(0, 0, 204));
getContentPane().add(t1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(190, 70, 180, -1));

p1.setFont(new java.awt.Font("Book Antiqua", 1, 14));


p1.setForeground(new java.awt.Color(0, 0, 204));
getContentPane().add(p1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(190, 120, 180, -1));

jButton1.setText("Close");
jButton1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(300, 170, -1, -1));

jButton2.setText("Registration");
jButton2.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(100, 170, -1, -1));

jButton3.setText("Login");
jButton3.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton3ActionPerformed(evt);
}
});
getContentPane().add(jButton3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(220, 170, -1, -1));

jLabel4.setFont(new java.awt.Font("Book Antiqua", 1, 24));


jLabel4.setForeground(new java.awt.Color(0, 0, 204));
jLabel4.setText("Login Window");
getContentPane().add(jLabel4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(160, 0, -1, -1));

SUSPICIOUS EMAIL DETECTION 29


pack();
}// </editor-fold>//GEN-END:initComponents

private void jButton3ActionPerformed(java.awt.event.ActionEvent


evt) {//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
try
{
String pp=new String(p1.getPassword());
Class.forName("java.sql.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/email",
"root","123");
Statement stmt=con.createStatement();
String qq="select * from login where uname='" +
t1.getText() +"' && password='"+pp+"'";
ResultSet rs= stmt.executeQuery(qq);
int cc=0;
while(rs.next())
{
if(pp.equals(rs.getString(2)))
{
this.setVisible(false);

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
SplashScreen splash = new SplashScreen();
Thread.sleep(3000);
splash.setVisible(false);
// for sending value
// method 1
// String uname[]=new String[1];
// uname[0]=t1.getText();
// menu.main(uname);
// this.setVisible(false);
//method 2
String loginuser = t1.getText();
menu frameOne = new menu();
frameOne.setUser(loginuser);
//end of sending
// menu mm= new menu();
frameOne.setVisible(true);
cc=1;
}
}
if(cc==0)
{
JOptionPane.showMessageDialog(rootPane, "Password is not
Correct/Empty Fields");
}
}catch(Exception ex)
{
JOptionPane.showMessageDialog(rootPane,ex.getMessage());

SUSPICIOUS EMAIL DETECTION 30


}

}//GEN-LAST:event_jButton3ActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent


evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
System.exit(0);
}//GEN-LAST:event_jButton1ActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent


evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
regis nn = new regis();
nn.setVisible(true);
}//GEN-LAST:event_jButton2ActionPerformed

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new login().setVisible(true);
}
});
}

// Variables declaration - do not modify//GEN-BEGIN:variables


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPasswordField p1;
private javax.swing.JTextField t1;
// End of variables declaration//GEN-END:variables

Regis.java

package regt;

SUSPICIOUS EMAIL DETECTION 31


/**
*
* @author DELL
*/
import java.awt.Toolkit;
import javax.swing.JOptionPane;
import java.sql.*;
public class regis extends javax.swing.JFrame {

/** Creates new form regis */


public regis() {
initComponents();
int lebar = this.getWidth()/2;
int tinggi = this.getHeight()/2;
int x = (Toolkit.getDefaultToolkit().getScreenSize().width/2)-
lebar;
int y = (Toolkit.getDefaultToolkit().getScreenSize().height/2)-
tinggi;
this.setLocation(x, y);
}

/** This method is called from within the constructor to


* initialize the form.
* WARNING: Do NOT modify this code. The content of this method
is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jLabel2 = new javax.swing.JLabel();


jLabel3 = new javax.swing.JLabel();
t1 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
p1 = new javax.swing.JPasswordField();
jLabel4 = new javax.swing.JLabel();
t2 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel2.setFont(new java.awt.Font("Book Antiqua", 1, 24));


jLabel2.setForeground(new java.awt.Color(0, 0, 204));
jLabel2.setText("Registration Window");
getContentPane().add(jLabel2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(220, 20, -1, -1));

jLabel3.setFont(new java.awt.Font("Book Antiqua", 1, 14));

SUSPICIOUS EMAIL DETECTION 32


jLabel3.setForeground(new java.awt.Color(0, 0, 204));
jLabel3.setText("Mobile No:");
getContentPane().add(jLabel3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(150, 180, -1, -1));

t1.setFont(new java.awt.Font("Book Antiqua", 1, 14));


t1.setForeground(new java.awt.Color(0, 0, 204));
getContentPane().add(t1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(280, 80, 180, -1));

jLabel1.setFont(new java.awt.Font("Book Antiqua", 1, 14));


jLabel1.setForeground(new java.awt.Color(0, 0, 204));
jLabel1.setText("Password:");
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(150, 130, -1, -1));

p1.setFont(new java.awt.Font("Book Antiqua", 1, 14));


p1.setForeground(new java.awt.Color(0, 0, 204));
getContentPane().add(p1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(280, 130, 180, -1));

jLabel4.setFont(new java.awt.Font("Book Antiqua", 1, 14));


jLabel4.setForeground(new java.awt.Color(0, 0, 204));
jLabel4.setText("Email ID:");
getContentPane().add(jLabel4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(150, 80, -1, -1));

t2.setFont(new java.awt.Font("Book Antiqua", 1, 14));


t2.setForeground(new java.awt.Color(0, 0, 204));
getContentPane().add(t2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(280, 170, 180, -1));

jButton1.setFont(new java.awt.Font("Tahoma", 1, 14)); //


NOI18N
jButton1.setForeground(new java.awt.Color(204, 0, 0));
jButton1.setText("Close");
jButton1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(330, 220, -1, -1));

jButton2.setFont(new java.awt.Font("Tahoma", 1, 14)); //


NOI18N
jButton2.setForeground(new java.awt.Color(204, 0, 0));
jButton2.setText("Save");
jButton2.addActionListener(new
java.awt.event.ActionListener() {

SUSPICIOUS EMAIL DETECTION 33


public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(220, 220, -1, -1));

pack();
}// </editor-fold>

private void jButton1ActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
this.dispose();
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
String a,b,c;
a=t1.getText();
b=new String(p1.getPassword());
c=t2.getText();
try
{
Class.forName("java.sql.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/email",
"root","123");
Statement stmt = con.createStatement();
String qq="insert into login
values('"+a+"','"+b+"','"+c+"')";
stmt.executeUpdate(qq);
JOptionPane.showMessageDialog(rootPane,"Record is
saved...");

}catch(Exception ex)
{
JOptionPane.showMessageDialog(rootPane, ex.getMessage());

}
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new regis().setVisible(true);
}

SUSPICIOUS EMAIL DETECTION 34


});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPasswordField p1;
private javax.swing.JTextField t1;
private javax.swing.JTextField t2;
// End of variables declaration

Inbox.java

package regt;

import java.awt.Toolkit;
import java.sql.*;

import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
*
* @author DELL
*/
public class inbox extends javax.swing.JFrame {
private String userField;

public void setUser(String user)


{this.userField =user;}

/** Creates new form inbox */


public inbox() {
initComponents();
int lebar = this.getWidth()/2;
int tinggi = this.getHeight()/2;
int x = (Toolkit.getDefaultToolkit().getScreenSize().width/2)-
lebar;
int y = (Toolkit.getDefaultToolkit().getScreenSize().height/2)-
tinggi;

SUSPICIOUS EMAIL DETECTION 35


this.setLocation(x, y);
}

/** This method is called from within the constructor to


* initialize the form.
* WARNING: Do NOT modify this code. The content of this method
is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jLabel1 = new javax.swing.JLabel();


jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel1.setFont(new java.awt.Font("Times New Roman", 0,


24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(0, 0, 255));
jLabel1.setText("Inbox Email");
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(210, 20, 170, 30));

jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null}
},
new String [] {
"Receive Name", "Subject", "Msg"
}
));
jScrollPane1.setViewportView(jTable1);

getContentPane().add(jScrollPane1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(60, 60, -1, 190));

jButton1.setText("Show Inbox");
jButton1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton1ActionPerformed(evt);
}
});

SUSPICIOUS EMAIL DETECTION 36


getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(409, 30, 100, -1));

jButton2.setText("Close");
jButton2.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(240, 260, -1, -1));

jButton3.setText("Close");
jButton3.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent
evt) {
jButton3ActionPerformed(evt);
}
});
getContentPane().add(jButton3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(240, 260, -1, -1));

pack();
}// </editor-fold>
//String sn=this.userField;
void load_inbox()
{

private void jButton1ActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
DefaultTableModel mm=(DefaultTableModel)
jTable1.getModel();
for( int i = mm.getRowCount() - 1; i >= 0; i-- )
{
mm.removeRow(i);
}

Connection con = null;


Statement str = null;
ResultSet rs=null;
String sn1=this.userField;
try
{
// Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// con = DriverManager.getConnection("jdbc:odbc:ins");
Class.forName("java.sql.Driver");

SUSPICIOUS EMAIL DETECTION 37


con=DriverManager.getConnection("jdbc:mysql://localhost:3306/email",
"root","123");

str = con.createStatement();
rs= str.executeQuery("select * from email where
trim(rname)='"+this.userField.trim()+"'");
// System.out.println(rs.getRow());
while(rs.next())
{
String sct=rs.getString("rname");
String stn=rs.getString("sub");
String stc=rs.getString("msg");
mm.addRow(new Object[]{sct,stn,stc});
}

}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null, ex.getMessage());
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
this.dispose();
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new inbox().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;

SUSPICIOUS EMAIL DETECTION 38


private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
// End of variables declaration

4.2 SNAPSHOT

SUSPICIOUS EMAIL DETECTION 39


SUSPICIOUS EMAIL DETECTION 40
5. APPLICATION

5.1 EXISTING SYSTEM & DISADVANTAGES


In the existing system, the mails are sent to the authenticated users who are intended to
be received. Some defects in existing system are:
 Suspicious mails cannot be detected.
 Offensive users cannot be identified.

5.2 PROPOSED SYSTEM & ITS ADVANTAGES


In the proposed system the suspicious users are detected and the offensive mails are
blocked
Features of proposed system:
 This helps in finding out anti social elements.
 This provides the security to system which adapts it.

SUSPICIOUS EMAIL DETECTION 41


 This also helps the intelligence bureau, crime branch etc.,
 Insurance premium calculations, for quarterly, half yearly and annually is completely
automated gives us a reliable environment.
 The system provides claim reporting and status enquiry.

6. CONCLUSION AND FUTURE ENHANCEMENTS

CONCLUSION
Email has been an efficient and popular communication mechanism as the number of
Internet user's increase. In many security informatics applications it is important to detect
deceptive communication in email. In this application the mails are classified as suspicious
or normal using the key words and encrypted keywords. The mails containing these keywords
and encrypted keywords are classified as suspicious mails and they can be blocked and
verified by the administrator. The proposed work will be helpful for identifying the
suspicious email and also assist the investigators to get the information in time to take
effective actions to reduce the criminal activities.

FUTURE ENHANCEMENTS

SUSPICIOUS EMAIL DETECTION 42


Even though the project fulfills the requirements of the present application there is
always scope for further work. According to the emerging changes and new versions, further
work can be done to improve the application Since project is designed in a flexible software.

This application which is a web based is of standalone application. This can be


implemented on internet by buying the network space and by creating a website.

The present application when implemented on internet requires a large database as the
backend; this can be done by using the MySql database as the backend.

As we use encrypted keyword in this application we can implement many encrypted


algorithms like RSA, DES/3DES, BLOWFISH, AES, IDEA and many more.

REFERENCES

References for the project development were taken from the following books and web
sites
9.1 BOOKS REFERED
9.1.1 HTML
Holzner, HTML Black Book
Larne Pekowsley, JAVA Server Pages
9.1.2 JAVA TECHNOLOGIES
Larne Pekowsley, JAVA Server Pages
Nick Todd, JAVA Server Pages
Pistoria, JAVA2 Networking
Scott oaks, JAVA Security
Shadab siddiqui, J2EE Professional

SUSPICIOUS EMAIL DETECTION 43


Sierra Bates, Head First EJB
Yehuda Shiran, Java Script Programming
Mastering JAVA Security
JAVA Complete Reference
9.1.3 JDBC
Patel Moss, JAVA Database Programming with JDBC
9.1.4 SOFTWARE ENGINEERING
Roger Pressman, Software Engineering

SUSPICIOUS EMAIL DETECTION 44

You might also like