3 Level Authentication - TutorialsDuniya
3 Level Authentication - TutorialsDuniya
COM
3 Level Authentication
3 LEVEL AUTHENTICATION
omm
SOFTWARE ENGINEERING PROJECT
REPORT
cco
B. Sc. (H) Computer Science
a.
iy
un
slsD
aial
SUBMITTED BY:
orri
Keshav Mahavidyalaya
(University of Delhi)
ACKNOWLEDGEMENT
omm
We have taken efforts in this project. However, it would not have been possible
without the kind support and help of many individuals. We would like to extend
our sincere thanks to all of them. We are highly indebted to TutorialsDuniya.Com
cco
for their guidance and constant supervision as well as for providing necessary
information regarding the project & also for their support in completing the
project.
a.
We would like to express our gratitude towards our teachers for their kind co-
iy
operation and encouragement which helped us in completion of this project.
A huge thanks and appreciations also go to the team members in developing the
project and people who have willingly helped us out with their abilities.
un
slsD
aial
orri
utot
TTu
ii
CERTIFICATE
omm
This is to certify that Software Engineering project report entitled “3 Level
cco
Authentication” is the work carried out by Rallapalli Nagarjun, Sachin Kumar,
Shashikant Patel and Yukti Kaushik, student of BSc(H) Computer Science 4th
Semester, Keshav Mahavidyalaya, University of Delhi under the supervision of
a.
TutorialsDuniya.com.
iy
This report has not been submitted to any other organization/institution for the
award of any other degree/diploma.
un
slsD
aial
TutorialsDuniya.com TutorialsDuniya.com
utot
TTu
Principal
TutorialsDuniya.com
iii
ABSTRACT
The project is an authentication system that validates user for accessing
omm
the system only when they input correct password. The project involves
three levels of user authentication. There are varieties of password
systems available, many of which have failed due to bot attacks while
cco
few have sustained it but to a limit. In short, almost all the passwords
available today can be broken to a limit. Hence this project is aimed to
a.
achieve the highest security in authenticating users.
It contains three authentication phases having three different kinds of
iy
password system. The password difficulty increases with each level.
Users have to input correct password for successful login. Users would
un
be given privilege to set passwords according to their wish. The project
comprises of text password i.e. pass phrase, image based password and
OTP password for the three levels respectively. This way there would be
slsD
case of three level password we tried creating a simple user interface and
providing users with the best possible comfort in solving password.
utot
TTu
iv
TABLE OF CONTENTS
omm
1. Software Requirement Specification 1
1.1 Introduction 1
cco
1.3 External Interface Requirements 4
a.
1.5 Other Non-Functional Requirements 7
iy
Appendix A: Data Flow Diagrams 8
3.Architectural Design 18
4.Risk Analysis 19
aial
5.Implementation 21
orri
5.1 Coding 21
utot
5.2 Snapshots 28
6.Testing 32
TTu
7.User Manual 36
8.Conclusion 38
9.References 39
List of Figures
1.Figure 1-Project View
omm
2.Figure 2-Project Implementation
cco
4.Figure 4-Level 1 Data Flow Diagram
a.
6. Figure 6:-Architectural Design Level 2
iy
7. Figure 7:-Snapshot 1
un
8. Figure 8:-Snapshot 2
9. Figure 9:-Snapshot 3
vi
List of Tables
1. EI table
omm
2. EO table
3. ILF table
cco
4. EQ table
5. EIF table
a.
6. Combined Functional point table
iy
7. Gantt chart
8. RMMM 1
un
9. RMMM 2
1.1. Introduction
1.1.1. Purpose
omm
The purpose of product is to provide high level protection from thefts involving privacy of data.
In this fast advancing world, almost all the security systems are becoming obsolete. So,
something is needed to increase the level of security for our data, that’s why this application is
made.
cco
1.1.1 Document Conventions
The font used for headings are Times with BOLD function and font used for content part in a
a.
paragraph is Arial with italics function. In the paragraph body, special lines have been quoted
and highlighted with bold function.
Every heading is followed by its sub headings described by 1.1, 1.2.
iy
un
1.1.3. Intended Audience and Reading Suggestions
This document is made for all the kind of readers who intend to get a brief knowledge about
what this software is about.
The developers should directly jump to part 2, that is, Overall Description to part 5 of the
slsD
The main objective is to provide high level of security so that users can rely on the storage that
their data is secure. The more authentication methods get introduced in the near future, the more
utot
updates will be patched to the main software. “The users can rely on our database for saving
their sensitive data.” this is the prime objective of our software.
1.1.5 References
TTu
This SRS has been referred from SRS template provided by IEEE.
Nowadays, many hackers hack into our system and can use our sensitive information for their
purpose as mostly we are relying upon text-based password system where our username
identifies us and password validates us. But this already existing technique has some weaknesses
omm
as more than one person can possess its knowledge at one time as the textual password can be
easily known by using brute force method and hence our identity can land into trouble with
people having venomous intent. Thus, along with text-based password two more techniques
have been providednamely picture based password and OTP generated password.
cco
a.
iy
un
slsD
aial
The user will be provided a sign-up page for the first time and sign in page after sign up
for that particular user.
TTu
When the user signs up, he will provide a mobile number/email on which an OTP system
will be used.
Also, the user will select a group of photos for which we will assign a picture password.\
Once the user successfully logs in, he will have access to his own previously saved data
or he can add more data to his online storage which is provided to each specific user (to a
certain limit).
SIGN UP
omm
cco
SIGN IN
a.
PICTURE
iy
un
TEXT PASSWORD OTP SERVICE
PASSWORD
slsD
aial
DATABASE
orri
utot
This software can be used by any type of user. Everyone who wants to save their data from any
attacks and maintain their privacy, can use this software.
omm
1.2.4 Operating Environment
This software can operate on any hardware platform, as it is a web storage type of software.Any
cco
browser can be used to access this software. The browser should support JavaScript.
a.
This system limits to one user at a time.
iy
1.2.6 User Documentation
A video will be provided on how to sign up and initialize the user page for inputting the text
password, picture password and enabling OTP service.
un
A tutorial will be provided on how to upload your files on the cloud storage assigned to you.
Also, the directives that would be followed in case of “FORGOT PASSWORD” situation will
also be provided along with the user manual.
slsD
We are assuming that the OTP service provided is reliable and we can have no more than 1
person at a time accessing the storage.
aial
orri
The interface used in each webpage is similar to the Gmail login page.
TTu
The browser on which the user runs the webpage should be preferably 1024 x 768 px.
The errors are generally shown in the text fields and the errors that are due to database non
connection or smtp server failure.
The interface uses PHP in backend for which a XAMPP server is being used.
And for sending OTP, the gmail SMTP server is being used.
The port for SMTP Gmail server is PORT 587 and for Apache server port 80 and MySQL port
3306. And PHPMyAdmin is the database used for MySQL queries.
omm
reCAPTCHA API used for CAPTCHA.
PHPMyAdmin used for MySQL server.
Gmail SMTP server for sending mails.
PHPMailer and SMTP classes used for OTP functionality.
cco
Refer to User Manual
a.
The port for SMTP Gmail server is PORT 587 and for Apache server port 80 and MySQL port
3306. And PHPMyAdmin is the database used for MySQL queries.
iy
un
1.4 System Features
Refer to Brief Overview.
LOGIN
1.4.1.1 Description and Priority
Priority: HIGH.
aial
The user types in his username and password that he had used for signup.
As the user hits the validate button in the login page, firstly the text field replies
whether the inputted data is correct or not.
utot
Then, user clicks the proceed button and proceeds to reCAPTCHA page.
TTu
SIGN UP
1.4.2.1 Description and Priority
omm
Priority: HIGH.
The user types in his username and password.
cco
As the user hits the validate button in the signup page, firstly the text field replies
whether the inputted data is correct or not.
Then, user clicks the proceed button and proceeds to reCAPTCHA page.
a.
1.4.2.3 Functional Requirements
iy
REQ-1: The database should be connected.
REQ-2: The proceed button only works when correct data is validated
un
1.4.3 System Feature 3
reCAPTCHA
slsD
OTP
1.4.4.1 Description and Priority
7
Priority: HIGH.
The user types in his username and then the OTP received.
omm
As the user hits the validate UID button in the OTP page, firstly the text field
replies whether the inputted data is correct or not.
Then the user receives the OTP on his email id and then hits validate button.
Then, user clicks the proceed button and proceeds to web page.
cco
1.4.4.3 Functional Requirements
a.
REQ-1: The internet should be connected.
REQ-2: The proceed button only works when correct data is validated
REQ-3: The database should be connected.
iy
un
1.5 Other Nonfunctional Requirements
1.5.1 Performance Requirements
slsD
This software can be used by 5 users at a time with each user occupying 100 MB of space.
Safety of data is given prime importance in this software where users’ data is stored and can only
aial
be accessed by his/her permission by authenticating through various phases provided. There will
be no one accessing your storage other than yourself.
By providing OTP from the system only the intended user can achieve access onto his data
orri
allowing full safety to the data. Even if he/she by mistakenly shares the password of account then
also full rights of retrieving the data remains with him/her as other users will not be able to gain
access and will be blocked after several attempts.
utot
The user can jump to another webpage on the site by changing the URL to the location file.
TTu
The user can use SQL injection to break into the database for UIDs.
The proceed button in some pages work without validating causing chaos.
This software is limited to localhost that means the system of the project invoking the files,
therefore, it has very limited usage capability.
omm
cco
Appendix A: Analysis Models
a.
iy
un
slsD
aial
orri
utot
omm
cco
a.
iy
un
slsD
aial
orri
utot
TTu
10
omm
(i)description:password
(ii)source:user
cco
(iii)destination:login process (database = "uid" )
a.
II SUCCESSFUL LOGIN
iy
(i)description:access to user storage
(ii)source: storage
un
(iii)destination: user
(ii)source: user
IV PICTURE PASSWORD
11
V OTP
omm
(ii) source : user
cco
VI FORGOT PASSWORD
a.
(ii) source : user
iy
(iii) destination : SIGN UP
(iii)destination:datastore:otp+text+picture
12
1.6.2 SIGN UP
I FIRST SESSION
omm
(ii)source : user
cco
(iv) type : alphanumeric
II TEXT PASSWORD
a.
(i)description : user inputs password
iy
(iii) destination :datastore
un
(iv) type : alphanumeric
(ii)source : user
IV OTP
orri
13
omm
2. Size Estimation and Scheduling
cco
2.1 Size Estimation
a.
EQ TABLE
iy
Enquiry weighing factor weight description
eq1 D 6 User database interaction
un
eq2 M 4 3rd party OTP service
sum= 10
ILF TABLE
orri
p2 D 15 login
p3 M 10 text password
TTu
p4 D 15 picture password
p5 S 7 OTP
p6 S 7 sign up
p7 M 10 forgot password
sum= 79
14
omm
EI TABLE
Input Weighing factor Weight Description
i1 M 4 text password
i2 D 6 picture password
cco
i3 S 3 OTP
i4 S 3 Username
i5 D 6 Storing in database
a.
sum= 22
iy
un
TABLE 3: EXTERNAL INPUT
slsD
aial
EO TABLE
Output Weighing factor Weight Description
orri
o5 S 4 signup
sum= 28
15
EIF TABLE
omm
Process weighing factor weight Description
p1 M 7 3rd Party OTP
p2 S 5 User Storage
cco
sum= 12
a.
CAF (Cumulative Adjustment Factor)= 0.65 + (0.01 * 14
iy
*3) =1.07
un
slsD
aial
orri
ILF 7 79
EO 5 28
TTu
EI 5 22
EQ 2 10
UFP= 151
16
omm
161.57 x 67 = 10,825.19
cco
EFFORT=1.4XL^0.93 = 1.4 X (10,825.19)^0.93 = 7909.57
DOCUMENTATION= 30.4 x (10,825.19)^0.9 = 129,974.66
a.
DURATION = 4.6 x (10,825.19)^0.26 = 51.488
iy
un
Assumptions taken during functional point analysis:
17
omm
cco
a.
iy
un
slsD
aial
orri
utot
18
3. Architectural Design
Level 1
omm
cco
a.
iy
un
FIGURE 5: ARCHITECTURAL DESIGN LEVEL 1
slsD
Level 2
aial
orri
utot
TTu
19
4. Risk Analysis
4.1Risk Mitigation, Monitoring and Management Plan
omm
Risk Mitigation, Monitoring and Management 1:
cco
Risk ID: DATE: Probability: Impact:
a.
DESCRIPTION
iy
Lack of training on tools required to build the project
REFINEMENT/CONTEXT:
un
1. Certain reusable components were developed by a third party with no
knowledge of internal design standards.
2. Certain reusable components have been implemented in a language that
is not supported on the target environment.
slsD
MITIGATION/MONITORING:
MANAGEMENT/CONTINGENCY PLAN/TRIGGER
CURRENT STATUS:
TTu
TABLE 8: RMMM 1
20
omm
R02 15-02-2018 80% Very high
DESCRIPTION:
cco
Staff lacks experience in skills required to complete the project.
REFINEMENT/CONTEXT:
a.
3. More work load on the experienced people.
4. Time exceeded due to inexperienced staff.
iy
MITIGATION/MONITORING:
MANAGEMENT/CONTINGENCY PLAN/TRIGGER
slsD
CURRENT STATUS:
orri
TABLE 9:RMMM 2
21
5. Implementation of Module
5.1 Coding
omm
Otp.Php One Time Password in Project 3rd Module
<?php
cco
// These must be at the top of your script, not inside a function
require 'Exception.php';
a.
iy
//Load composer's autoloader
require 'PHPMailerAutoload.php';
un
functionsendOTP($email,$otp){
try {
//Server settings
// $message_body = "One Time Password for PHP login authentication is:<br/><br/>" . $otp;
//Recipients
22
$mail->setFrom('rallapallinagarjun16@gmail.com', '3-LEVEL Authentication');
//Content
omm
// $mail->MsgHTML($message_body);
$mail->isHTML(true);
cco
// Set email format to HTML
a.
$mail->Body = "One Time Password for PHP login authentication is:<br/><br/>" . $otp;
$result1 = $mail->send();
iy
echo '<h1><center><b>Message has been sent</b></center></h1>';
return $result1;
un
}
return 0;
}
aial
?>
orri
<?php
utot
$success=null;
$error_message = null;
TTu
$emailref = null;
$conn = mysqli_connect("localhost","root","","mydb");
23
$count1 = mysqli_num_rows($result);
if($count1>0){
//generate OTP
omm
$otp = rand(100000,999999);
//Send OTP
cco
$mail_status = sendOTP($_POST['name1'],$otp);
if($mail_status == 1){
a.
$result = mysqli_query($conn,"INSERT INTO
otp_expiry(otp,is_expired,create_at) VALUES ('".$otp."',0,'" . date("Y-m-d H:i:s")."')");
iy
//$current_id = mysqli_insert_id($conn);
// if(!empty($current_id)){
un
// $success =1;
// }
}
slsD
else{
$error_message = "error";
aial
}
orri
else{
$error_message = "Email is not present in the database Either Sign Up or get the
utot
}
TTu
24
$count = mysqli_num_rows($result2);
if($count>0){
omm
$result2 = mysqli_query($conn,"UPDATEotp_expiry SET is_expired = 1
WHERE otp = '".$_POST["OTPrec"]."'");
$error_message = "success";
cco
header("Location:C:\xampp\htdocs\home2.php");
a.
else{
iy
}
un
}
?>
slsD
<!DOCTYPE html>
<html>
<head>
aial
<title>OTP page</title>
orri
"text/css"/>
</head>
<body>
<center>
25
<div id = "logo">
</div>
omm
<div id = "info1">
cco
</div>
<div id = "info2">
a.
Enter OTP after submitting your email
</div>
iy
<div id = "form1">
type = "email" name = "name1" style="width:270px; height:42px; border:solid 1px #c2c4c6; font-
size:16px;
</div>
<div id = "OTPfield">
orri
<input placeholder="Enter the OTP" name ="OTPrec" style="width:270px; height:42px; border:solid 1px
#c2c4c6; font-size:16px;
utot
padding-left:8px"/>
</div>
TTu
padding-left:8px">
<?php
26
echo $error_message;
?>
</div>
<div>
omm
<input type ="submit" id="button1" value ="Validate Email" />
</div>
<div>
cco
<input type ="submit" id="button2" value ="Validate OTP" />
</div>
a.
<div id = "jump1">
iy
<button class = "button3" onclick="myFunction()" >
un
<span>
</span>
</button>
aial
</div>
</div>
orri
<div id = "bottom">
utot
</div>
TTu
</div>
</center>
<script>
27
functionmyFunction(){
var x = document.getElementById("jump1");
if(y!="success"){
omm
if(x.style.display === "none"){
x.style.display ="block";
cco
else{
x.style.display = "none";
a.
}
iy
}
}
un
</script>
</body>
slsD
</html>
aial
orri
utot
TTu
omm
cco
a.
iy
un
Figure 7: Snapshot 1
slsD
aial
orri
utot
TTu
Figure 8: Snapshot 2
30
omm
cco
a.
iy Figure 9: Snapshot 3
un
slsD
aial
orri
utot
TTu
31
omm
cco
a.
iy
un
slsD
32
6. Testing
Basis Path Testing Of theRecaptcha Module
omm
cco
a.
iy
un
slsD
33
omm
cco
a.
iy
un
slsD
aial
orri
utot
VG = E – N + 2
VG = 23 – 21 +2
34
=4
No. of regions = 3 + 1
omm
=4
cco
Cyclomatic complexity = Predicate nodes + 1 = 3+1 = 4
a.
1-3 , ( 3,6) , (6,10) , 10-14 , 14-21
1-3, (3,6), 6-10, 10 -14, 14-15-16-21
iy
1-6, 6-10, 10-14, 14-20, 20-21
1-14, 14-20 , 21
un
Which is equal to 4
Test cases:
Path no. Input Expected Output Received output
aial
14 , 14-21 $captcha
Another file is opened Another file is opened
$responsekeys[‘success’]
utot
.1-3, (3,6),
TTu
35
$_POST[‘g-recaptcha-
omm
response’]
$captcha != null
$captcha $captcha != null
.1-6, 6-10, Please check the captcha
10-14, 14- $responsekeys[‘success’] form Please check the captcha
cco
20, 20-21 exit form
exit
a.
iy
un
slsD
response’]
$captcha
$captcha != null $captcha != null
orri
$responsekeys[‘success’]
Another file is opened Another file is opened
utot
TTu
36
omm
The project’s main objective is to provide three level authentication for the user to access a
webpage.
The homepage is used for first level which is login page to login and proceed to the next
authentication which is reCAPTCHA. The homepage has the link to the Sign Up page naming
cco
Create Account. For every page the user is directed to, he has to firstly validate his inputted
data. Then, after successful validation, the user has to click the proceed button. If the user clicks
the proceed button before the validation procedure, the proceed button will vanish and the user
a.
has to reload the page to again validate and proceed.
The validation procedure in the Sign Up procedure has the following possibilities:
iy
1. Invalid User ID
2. The user has been taken
un
3. The passwords inputted by the user don’t match
4. Fields are empty
The validation in the Login procedure has the following possibilities:
slsD
pattern from the given images and then proceeds to the OTP page.
In the OTP page, the user has to firstly validate his/her email and then the user receives an email
orri
having 6 digit one time password and then the user inputs the OTP in the text field and then
proceeds to the webpage.
utot
When the email is validated, the CLIENT AND THE SERVER interaction is displayed behind
TTu
If the username is used previously in the database, it can’t be used again. Once OTP is generated
and used, it can’t be used again.
37
Some of the systems with enhanced security won’t be able to send the mail as the system will
block the unauthorized and unprotected access to that port.
omm
Port 587 doesn’t have TLS encryption so the mail server can work easily.
Mailing procedure is done by using SMTP.php and PHPMailer.php where a Gmail account is
used to send the emails in the backend. That Gmail id should give access to the less secure apps
cco
feature in Gmail or else the mailer won’t work.
Steps to be followed while signing up for a new account:-
1. Click on the link Create Account which will lead you to sign up page.
a.
2. Enter your valid email id in the id box provided
3. Enter your password in the box provided
iy
4. Validate your email
5. Then proceed further.
un
slsD
aial
orri
utot
TTu
38
8. Conclusion
omm
The delivered prototype of our software demonstrates how authentication can be
achieved by using three level protection/authentication. With this we can conclude
that our prototype can be used for security purposes by individuals and
cco
organizations in order to prevent their data from theft. Extending this model to
other resources will definitely increase the security level at its best.
a.
iy
un
slsD
aial
orri
utot
TTu
39
9. References
omm
1. https://www.tutorialsduniya.com
cco
3. github.com for PHPMailer and SMTP
4. php.net/manual
a.
5. https://www.tutorialsduniya.com
iy
un
slsD
aial
orri
utot
TTu