Secure Password Recovery Mechanism For Online Book Reading Platform
Secure Password Recovery Mechanism For Online Book Reading Platform
GUIDED BY
Mrs. B. Swetha
Assistant Professor
Malla Reddy
University 2021-2025
Department of Computer Science & Engineering (Cyber Security)
CERTIFICATE
This is to certify that this is the project report entitled “SECURE
PASSWORD RECOVERY MECHANISM FOR ONLINE BOOK
READING PLATFORM” submitted by B.SAI MANI DEVENDAR
REDDY (2111CS040089), M.POOJITH MOHAN VAMSI
(2111CS040071), B.NITHIN REDDY (2111CS040064), J.NITHIN RAJ
(2111CS040065)
B.Tech III year II semester, Department of CSE (CS), during the year 2023-
24. The results embodied in this report have not been submitted to any other
university or institute for the award of any degree or diploma.
External Examiner
DECLARATION
Place:
Date:
We extend our sincere gratitude to all those who have contributed to the completion of
this project report. Firstly, we would like to extend our gratitude to Dr. V. S. K
Reddy, Vice-Chancellor, for his visionary leadership and unwavering commitment to
academic excellence.
We would also like to express our deepest appreciation to our project guide Mrs. B.
Swetha Assistant Professor whose invaluable guidance, insightful feedback, and
unwavering support have been instrumental throughout the course of this project for
successful outcomes.
We extend our gratitude to our PRC – convenor, Dr. G. Latha, for giving valuable
inputs andtimely guidelines to improve the quality of our project through a critical
review process. We thank our project coordinator, Mrs. A. Ramya, for her timely
support.
We are also grateful to Dr. G. Anand Kumar, Head of the Department Cyber
Security & IOT, for providing us with the necessary resources and facilities to carry
out this project.
We would like to thank Dr. Kasa Ravindra, Dean, School of Engineering, for his
encouragement and support throughout my academic pursuit.
We are deeply indebted to all of them for their support, encouragement, and guidance,
withoutwhich this project would not have been possible.
Secure Password Recovery Mechanism for Online Book Reading Platform targets
enhancing password recovery security on a free online book reading platform through a
robust and user-friendly mechanism. Users start the process by selecting the password
recovery option and entering their email associated with the account. User should
answer the security question which they have previously selected and answered during
registration. If it is correct then an 8-character OTP is then sent to the user's email to
thwart unauthorized access and brute force attacks. Upon successful OTP entry within
a 30-second timeframe, the website triggers the password recovery process. The hashed
password is securely transmitted to a specialized web service for password recovery.
This service employs a binary search algorithm in a precomputed rainbow table to
swiftly locate the corresponding plaintext password linked to the hash value. Regular
hash value checks are conducted to ensure the hash table's integrity, contributing to
rapid and secure password recovery while reducing unauthorized access risks. The
project's goal is to offer users a seamless and secure experience when regaining access
to their accounts on the online book reading platform.
i
INDEX
CONTENTS Page
No
Chapter 1 Introduction 1-5
ii
3.1 Modules Design 17-19
3.3Project Architecture
21-26
4.4 Testing 47
Bibliography 59
Web Link 68
iv
List of Figures Page No
3.3.1 Architectural Diagram 21
3.3.2 Class Diagram 22
3.3.3 Use case Diagram 23
3.3.4 Sequence Diagram 24
3.3.5 Activity Diagram 25
List of Screen shots
5.1.1 User Interface to Register. 48
5.1.2 User Interface to select a Security Question. 49
5.1.3 User Interface for Home Page 49
5.1.4 Login and Password Recovery Interface 50
5.1.5 Password Recovery Process 50
5.1.6 Password sent through email 51
5.1.7 Home Page 51
5.1.8 Invalid Credentials Popup 52
5.1.9 Invalid Security Answer Popup 52
5.1.10 Invalid OTP Popup 53
v
CHAPTER - 1
INTRODUCTION
In the digital landscape, securing user data is vital, particularly on platforms like free
online book-reading websites where personal information is stored. This project
focuses on enhancing the security of password recovery mechanisms on such
platforms. By implementing a user-friendly approach, the project aims to fortify
defences against unauthorized access and potential brute-force attacks. The proposed
solution entails a streamlined, multi-step process. Users initiate password recovery
through a dedicated option, proceeding to verify their identity via a unique 8-character
OTP sent to their email address and a security question. These verification steps act as
a safeguard against unauthorized access. Utilizing advanced algorithms, including
binary search in precomputed rainbow tables, the project ensures swift and accurate
password recovery while maintaining robust security measures. Regular integrity
checks of the rainbow tables enhance system resilience. This project's goal is to provide
users with a secure and hassle-free experience when regaining access to their accounts
on the online book reading platform.
In the digital era, online book reading platforms have become an essential service for
readers worldwide, providing convenient access to a vast library of books at their
fingertips. As these platforms continue to grow in popularity, ensuring the security of
user accounts has become increasingly critical. One of the key components of account
security is a robust password recovery mechanism. Password recovery mechanisms are
essential for users who forget their passwords or lose access to their accounts.
However, these mechanisms are often targeted by malicious actors through various
attacks such as phishing, brute force attempts, and social engineering. Therefore, it is
imperative to design a secure password recovery system that not only protects user data
but also enhances the overall trust and reliability of the platform.
This project focuses on a secure password recovery mechanism tailored for an online
1
book reading platform. The primary objectives are to ensure that the recovery process
is secure, user-friendly, and resistant to common attack vectors. By employing
advanced security technologies and methodologies, the proposed mechanism aims to
safeguard user accounts from unauthorized access while maintaining a seamless user
experience. Implementing a secure password recovery mechanism will provide
multiple benefits, including enhanced user trust, improved account security, and a more
resilient platform against potential security threats. This initiative underscores our
commitment to protecting user data and ensuring a safe and enjoyable reading
experience for all users.
2
1.1 Problem Definition & Description
The project addresses the critical need for enhancing the security and efficiency of
password recovery processes on an online book reading platform. Currently, the
platform lacks a robust mechanism for users to securely recover their passwords in
case of forgotten credentials or unauthorized access attempts. It poses a significant
risk to user data and platform integrity.
In the dynamic environment of online book reading platforms, user account security
is a fundamental concern. The password recovery mechanism, a critical component
of account security, is particularly vulnerable to various security threats.
Developing a secure, reliable, and user-friendly password recovery system is
essential to protect user accounts from unauthorized access, data breaches, and
potential identity theft. The goal is to create a mechanism that ensures robust
authentication, protects sensitive data, resists common cyber-attacks, provides a
seamless user experience, and adheres to regulatory requirements.
4
authentication (MFA) system, which verifies the identity of users requesting
password recovery. By incorporating additional verification steps like email
verification, and security questions, the platform can significantly reduce the risk of
unauthorized password reset attempts, thus enhancing the overall security of the
recovery process.
In terms of data protection, the project scope includes the encryption of all sensitive
information involved in the password recovery process. This ensures that user data
remains confidential and secure during transmission and storage. These measures
will help prevent unauthorized access and potential data breaches.
Additionally, the project will focus on improving the user experience by designing a
user-friendly interface for the password recovery process. This involves creating
clear, concise instructions and an intuitive navigation system to guide users
5
through the
recovery steps efficiently. User feedback will be collected and incorporated into the
6
design to ensure the process is as seamless and frustration-free as possible.
7
CHAPTER – 2
SYSTEM
The existing password recovery systems for many online book reading platforms
often rely on basic and less secure mechanisms, such as email-based password reset
links or security questions. While these methods provide a rudimentary level of
password recovery, they fall short in several critical areas.
Basic recovery systems are more susceptible to brute force attacks. Without the
implementation of OTP and other advanced verification methods, attackers can more
easily exploit these systems to gain unauthorized access to user accounts. Current
systems often lack comprehensive data integrity checks and robust security measures,
resulting in data corruption and making the recovery process less reliable. Many
systems do not encrypt sensitive information during the recovery process, increasing
the risk of data breaches.
9
of precomputed rainbow tables means that many systems do not leverage efficient
precomputed hash values, leading to longer recovery times. Without such
optimizations, the process remains inefficient and less effective in providing quick
password recovery solutions.
The online book reading platform industry has seen significant growth over
the past decade, driven by the convenience and accessibility of digital content.
These platforms provide users with vast libraries of e-books, audiobooks, and
other digital reading materials, making it easier for people to access literature
from anywhere at any time. As these platforms handle sensitive user data,
including personal information, reading histories, and payment details,
ensuring robust security measures is crucial. One critical aspect of security is
the password recovery mechanism, which allows users to regain access to
their accounts in case they forget their passwords. However, traditional
password recovery methods have proven to be susceptible to various security
threats, necessitating the development of more secure and user-friendly
mechanisms.
Literature Survey
11
utilization of tools like RainbowCrack, which leverages rainbow tables for
efficient hash lookup, has become instrumental in enhancing password
recovery processes for such platforms.
Moreover, the rise in cyber threats and data breaches, such as the 2012
LinkedIn breach, underscores the necessity for secure password recovery
mechanisms. The breach, which exposed millions of user passwords,
highlighted the vulnerabilities in existing systems and the critical need for
advanced security measures. Studies, such as those by Furnell (2007) and
Reeder & Schechter (2011), emphasize the significance of implementing
secondary authentication methods to bolster security during password
recovery.
In summary, the literature underscores the need for advanced, secure, and
user- friendly password recovery mechanisms. By integrating methodologies
such as rainbow tables, brute force techniques, and comprehensive password
policies, online book reading platforms can significantly enhance their
13
security
14
measures, ensuring the protection and reliability of user accounts. The
proposed system aims to incorporate these advanced techniques to provide a
robust and efficient password recovery solution, addressing the limitations of
existing systems and setting a new standard for security and user experience
in online platforms. This integration not only improves the efficiency of
password recovery but also enhances overall system resilience against cyber
threats.
The existing password recovery systems for many online book reading
platforms often rely on basic and less secure mechanisms, such as email-based
password reset links or security questions. While these methods provide a
rudimentary level of password recovery, they fall short in several critical areas:
16
Poor Data Integrity and Security Measures:
Current systems often lack comprehensive data integrity checks and robust
security measures. This can result in data corruption and makes the recovery
process less reliable. Additionally, many systems do not encrypt sensitive
information during the recovery process, increasing the risk of data breaches.
Limited User-Friendliness:
Many existing systems do not balance security with user-friendliness. Complex
recovery processes without adequate guidance can frustrate users and lead to
poor user experiences, potentially causing users to abandon the platform.
The proposed system begins with the user initiating the password recovery
process through a dedicated option on the login page. Once the user selects this
option, they are prompted to provide the email ID associated with their account.
To prevent unauthorized access and mitigate brute force attacks, the system
sends a unique 8-character OTP, comprising both digits and characters, to the
17
user's
18
email ID. The user must enter this OTP within a 30-second window to proceed
with the recovery process.
Upon successful OTP verification, the system triggers the password recovery
mechanism. The user's hashed password is securely sent to a specialized web
service for password recovery. This service utilizes a binary search algorithm to
efficiently search through precomputed rainbow tables, generated using
RainbowCrack, to find the corresponding plaintext password. Rainbow tables
are sorted and organized to facilitate quick lookup of hash values, significantly
enhancing the speed and accuracy of the password recovery process.
2.2.1 Advantages:
The proposed system offers several advantages over existing password recovery
methods:
19
Enhanced Security: The use of OTP for user verification and advanced hashing
techniques significantly reduces the risk of unauthorized access.
20
2.3 Software & Hardware Requirements
Applications like Xampp to run web server, database systems and cryptographic
libraries, programming languages like Python or Java & Php and declarative languages
like HTML, CSS, JavaScript.
Technical Feasibility:
The technical feasibility of this project is high due to the availability of
mature and reliable technologies that can be utilized for implementing the
proposed password recovery mechanism. Key components include:
22
languages. This ensures the technical viability of implementing an efficient
search mechanism.
Security Protocols: Implementing industry-standard security protocols, such
as HTTPS for secure data transmission and encryption for sensitive data
storage, is technically feasible and essential for maintaining user trust and
data integrity.
Operational Feasibility:
Operational feasibility focuses on how well the proposed system will
function within the current operational environment and its ease of use for
end users.
23
Economic Feasibility:
Economic feasibility assesses the cost-effectiveness of the proposed solution.
24
CHAPTER - 3
ARCHITECTURAL DESIGN
26
3.1.7 Results & Accuracy:
The secure password recovery mechanism developed for the online book
reading platform was evaluated across several metrics to determine its
effectiveness, efficiency, and robustness. This section presents the results
of these evaluations and provides an analysis of the key findings.
27
3.2 Methods & Algorithms
In the proposed password recovery mechanism, several methods and algorithms are
employed to ensure efficient and secure retrieval of passwords. These include:
28
3.3Project Architecture
3.3.1 Architectural diagram
• The signup page takes Name, Email, Password, and Confirm Password and stores them
in the database.
• The login page takes email and password verifies them in the database and redirects to
the home page.
• The home page will have books and filter options where users can read books and filter
the books according to the genre, author, etc.
• Password Recovery page takes email and verifies the user by sending OTP to
mail and after successful verification, it sends the password through mail.
• The database maintains all the user credentials and helps in verifying the user in the
future.
29
3.3.2 Class Diagram
• User class: Represents users with attributes name, email, and password, and methods
for signup, login, and password recovery.
• Book class: Represents books with attributes title, author, genre, publisher, and content,
and a method to display books based on filters.
• DatabaseConnector class: Handles database operations with methods to connect,
disconnect, and execute queries.
• PasswordRecovery class: Manages password recovery processes with methods to send
OTP, verify OTP, and recover passwords.
30
3.3.3 Use Case Diagram
Actor: User
Use Cases:
• Signup: User signs up with Name, email, password, and confirm password.
• Login: User logs in with email and password.
• Read Books: User accesses and reads books available on the platform.
• Recover Password: User initiates the password recovery process.
31
3.3.4 Sequence Diagram
32
3.3.5 Activity Diagram
33
• If OTP verification is successful:
• Find original password hash in the database.
• If password hash not found, send email with "Not able to recover
the password" message.
• If password hash found, email the password to the user.
34
CHAPTER - 4
4.1.1 showInvalidCredentialsPopup():
It displays a popup message indicating that the login credentials provided are invalid.
4.1.2 closePopup():
It hides the invalid credentials popup when the user clicks the close button.
4.1.3 getFormData($key):
It retrieves the value of the form data associated with the given key. It's typically
used to get user inputs like username and password from the POST request.
4.1.4 submitRecoveryForm():
It handles the submission of the password recovery form, collecting user input
and sending it to the server.
4.1.5 generate_file_hash():
This Python function takes the file path as input and returns the hash value of the
file content, typically using a hashing algorithm like SHA-256.
4.1.6 session_start():
It starts a new session or resumes an existing one, essential for user authentication.
4.1.7 checkUserExists($email)():
It checks if a user with the given email address exists in the database.
4.1.9 fetchSecurityQuestion(email):
It fetches the security question given by the user from the database and evaluates
the answer.
4.1.10 generateOTP():
It generates a random 8-character alpha-numeric OTP.
35
4.1.11 sendOTP(email):
It sends OTP to the user for verification.
4.1.13 get_password_hash(email):
It fetches the password hash value of the particular user from the database based
on their email.
4.1.14 find_original_text(target_hash):
It compares the target hash value in the hash table and returns the plain text of it
when found otherwise it returns None.
36
4.2 Sample Code:
CommonPasswordsHashing.py:
import os
import hashlib
# Function to hash a line using MD5
def hash_line(line):
return hashlib.md5(line.encode()).hexdigest()
# Path to the directory containing text files
directory_path = r"C:\Users\TOM & JERRY\Downloads\Commonpasswords"
# Output file to store hashed lines
output_file = 'hashTheWords.txt'
count=0
# Loop through each file in the directory
with open(output_file, 'w', encoding='utf-8') as outfile:
for filename in os.listdir(directory_path):
if filename.endswith('.txt'): # Process only text files
count+=1
print(f"{count}. Hashing lines in file: {filename}") # Print the file name
file_path = os.path.join(directory_path, filename)
with open(file_path, 'r', encoding='utf-8') as infile:
for line in infile:
hashed_line = hash_line(line.strip())
outfile.write(f'{hashed_line}: {line}')
FilteringAndSorting.py:
# Read the content of hashTheWords.txt and sort lines based on hash value
with open('hashTheWords.txt', 'r', encoding='utf-8') as infile:
lines = infile.readlines()
# Sort lines based on hash value
sorted_lines = sorted(lines, key=lambda x: x.split(':')[0])
# Remove duplicates based on hash value
unique_lines = []
seen_hashes = set()
for line in sorted_lines:
hash_value = line.split(':')[0]
if hash_value not in seen_hashes:
unique_lines.append(line)
seen_hashes.add(hash_value)
with open('hashTheWordsSorted.txt', 'w', encoding='utf-8') as outfile:
outfile.writelines(unique_lines)
37
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Online Book Reading Platform</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<!-- Add logout link/button at the top right corner -->
<div class="logout">
<a href="logout.php">Logout</a>
</div>
<h1>Welcome to our Online Book Reading Platform</h1>
<div class="books">
<div class="book">
<a href="wof.pdf"><img src="wof.jpg" alt="Book 1"></a>
<h3>Wings of Fire</h3>
<p>Author: A.P.J. Abdul Kalam</p>
<p>Genre: Autobiography</p>
</div>
<div class="book">
<a href="temper.pdf"><img src="temper.jpg" alt="Book 2"></a>
<h3>Temper</h3>
<p>Author: Vakkantham Vamsi</p>
<p>Genre: Drama</p>
</div>
<div class="book">
<a href="asura.pdf"><img src="asura.jpg" alt="Book 3"></a>
<h3>Asura - Tale of the Vanquished</h3>
<p>Author: Anand Neelakantan</p>
<p>Genre: Fictional</p>
</div>
<div class="book">
<a href="python.pdf"><img src="python.png" alt="Book 4"></a>
<h3>Python Programming - 3 books in 1</h3>
<p>Author: Dylan Penny</p>
<p>Genre: Education</p>
</div>
38
<!-- Add more books as needed -->
</div>
</div>
</body>
</html>
login.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="login_style.css">
<style>
/* Style for popup */
.popup-container
{ display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
}
.popup-content
{ position:
absolute; top:
50%;
left: 50%;
transform: translate(-50%, -
50%); background-color: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
width: 300px;
text-align: center;
}
.close {
position: absolute;
top: 5px;
39
right: 10px;
cursor: pointer;
font-size: 20px;
}
</style>
</head>
<body>
<div class="login-div">
<div class="logo"><img class="img" src="logo.png" alt="logo"></div>
<div class="title">Happy Reading</div>
<form id="login-form" class="fields">
<div class="username">
<svg class="svg-icon" viewBox="0 0 20 20">
<path d="M12.075,10.812c1.358-0.853,2.242-2.507,2.242-4.037c0-2.181-1.795-4.618-
4.198- 4.618S5.921,4.594,5.921,6.775c0,1.53,0.884,3.185,2.242,4.037c-3.222,0.865-
5.6,3.807-
5.6,7.298c0,0.23,0.189,0.42,0.42,0.42h14.273c0.23,0,0.42-0.189,0.42-
0.42C17.676,14.619,15.297,11.677,12.075,10.812 M6.761,6.775c0-2.162,1.773-3.778,3.358-
3.778s3.359,1.616,3.359,3.778c0,2.162-1.774,3.778-3.359,3.778S6.761,8.937,6.761,6.775
M3.415,17.69c0.218-3.51,3.142-6.297,6.704-
6.297c3.562,0,6.486,2.787,6.705,6.297H3.415z"></path>
</svg>
<input type="email" name="username" class="user-input" placeholder="Email">
</div>
<div class="password">
<svg class="svg-icon" viewBox="0 0 20 20">
<path d="M17.308,7.564h-1.993c0-2.929-2.385-5.314-
5.314- 5.314S4.686,4.635,4.686,7.564H2.693c-0.244,0-
0.443,0.2-
0.443,0.443v9.3c0,0.243,0.199,0.442,0.443,0.442h14.615c0.243,0,0.442-0.199,0.442-0.442v-
9.3C17.75,7.764,17.551,7.564,17.308,7.564
M10,3.136c2.442,0,4.43,1.986,4.43,4.428H5.571C5.571,5.122,7.558,3.136,10,3.136
M16.865,16.864H3.136V8.45h13.729V16.864z M10,10.664c-0.854,0-1.55,0.696-
1.55,1.551c0,0.699,0.467,1.292,1.107,1.485v0.95c0,0.243,0.2,0.442,0.443,0.442s0.443-
0.199,0.443-0.442V13.7c0.64-0.193,1.106-0.786,1.106-
1.485C11.55,11.36,10.854,10.664,10,10.664 M10,12.878c-0.366,0-0.664-0.298-0.664-
0.663c0-0.366,0.298-0.665,0.664-
0.665c0.365,0,0.664,0.299,0.664,0.665C10.664,12.58,10.365,12.878,10,12.878"></path>
</svg>
<input type="password" name="password" class="pass-input" placeholder="Password">
</div>
<button type="submit" class="signin-button">Login</button>
</form>
40
<div class="link">
<a href="password_recovery.html">Password Recovery</a> or <a href="signup.html">Sign
41
Up</a>
</div>
</div>
<!-- Popup for invalid credentials -->
<div id="invalid-credentials-popup" class="popup-container">
<div class="popup-content">
<span class="close" onclick="closePopup()">×</span>
<h2>Invalid Credentials</h2>
<p>Please try again.</p>
</div>
</div>
<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
// Function to close the popup
function closePopup() {
$('.popup-container').css('display', 'none');
}
42
</html>
login_styles.css
*{
box-sizing: border-box;
}
body {
margin: 0;
height: 100vh;
width: 100vw;
overflow:
hidden;
font-family: "Lato" , sans-
serif; font-weight: 700;
display: flex;
align-items: center;
justify-content:
center; color: #555;
background-color: #ecf0f3;
}
.login-div
{ width:
400px;
height:
580px;
padding: 60px 35px 35px
35px; border-radius: 40px;
background-color: #ecf0f3;
box-shadow: 13px 13px 20px #cbced1,
-13px -13px 20px #fff;
}
.logo {
width: 100px;
height: 100px;
border-radius:
50%;
margin: 0 auto;
box-shadow: 0px 0px 2px #cbced1,
0px 0px 0px 5px #ecf0f3,
8px 8px 15px #a7aaaf,
-8px -8px 15px #fff;
}
.img{
43
width: 100px;
height: 100px;
}
44
.title {
text-align:
center; font-size:
28px; padding:
20px;
letter-spacing: 0.5px;
}
.fields {
width: 100%;
padding: 40px 5px 5px 5px;
}
.fields input {
border: none;
outline: none;
background:
none; font-size:
18px; color: #555;
padding: 20px 10px 10px 5px;
}
.username,
.password {
margin-bottom:
30px; border-radius:
25px;
box-shadow: inset 8px 8px 8px #cbced1,
inset -8px -8px 8px #fff;
}
.fields
svg{ height:
22px;
margin: 0 10px -3px 25px;
}
.signin-button
{ outline: none;
border: none;
cursor: pointer;
width: 100%;
height: 60px;
border-radius:
30px; font-size:
20px;
font-weight: 700;
font-family: "Lato" , sans-serif;
color: #fff;
text-align: center;
45
background-color:
#02c8db;
box-shadow: 3px 3px 8px #b1b1b1,-3px -3px 8px #fff;
transition: all 0.5s;
46
}
.signin-button:hover
{ background-color:
#50e5b9;
}
.signin-button:active
{ background-color:
#88ef9e;
}
.link {
padding-top:
20px; text-align:
center;
}
.link a {
text-decoration: none;
color: #aaa;
font-size: 15px;
}
/* sign Up */
.fields-signup
{ width: 100%;
padding: 30px 5px 5px 5px;
}
.fields-signup input
{ border: none;
outline: none;
background: none;
font-size: 18px;
color: #555;
padding: 15px 10px 10px 5px;
}
.email {
margin-bottom:
30px; border-radius:
25px;
box-shadow: inset 8px 8px 8px #cbced1,
inset -8px -8px 8px #fff;
}
.phone {
margin-bottom:
30px; border-radius:
25px;
47
box-shadow: inset 8px 8px 8px #cbced1,
inset -8px -8px 8px #fff;
}
.password {
48
margin-bottom:
10px; border-radius:
25px;
box-shadow: inset 8px 8px 8px #cbced1,
inset -8px -8px 8px #fff;
}
.signup-button {
margin-bottom: -13px;
outline: none;
border: none;
cursor: pointer;
width: 100%;
height: 50px;
border-radius:
30px; font-size:
20px;
font-weight: 700;
font-family: "Lato" , sans-serif;
color: #fff;
text-align: center;
background-color:
#02c8db;
box-shadow: 3px 3px 8px #b1b1b1,-3px -3px 8px #fff;
transition: all 0.5s;
}
.signup-button:hover
{ background-color:
#50e5b9;
}
.signup-button:active
{ background-color:
#88ef9e;
}
.fields-signup
svg{ height: 22px;
margin: 0 10px -3px 25px;
}
login.php
<?php
session_start(); // Start session at the beginning
50
$password = md5($_POST['password']); // Hash the password
if ($result->num_rows == 1) {
// Login successful
$_SESSION['username'] = $username; // Store username in session if needed
echo 'success';
} else {
// Login failed
echo 'failure';
}
$stmt->close();
$conn->close();
?>
logout.php
<?php
// Start session
session_start();
signup.html
<!DOCTYPE html>
<html lang="en">
<head>
51
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Signup</title>
<link rel="stylesheet" href="login_style.css">
<style>
/* CSS for the eye icon */
.eye-icon {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
}
</style>
</head>
<body>
<div class="login-div">
<div class="title">Register</div>
<div class="fields-signup">
<div class="username">
<svg class="svg-icon" viewBox="0 0 20 20">
<!-- Username icon path -->
<path d="M12.075,10.812c1.358-0.853,2.242-2.507,2.242-4.037c0-2.181-
1.795- 4.618-4.198-4.618S5.921,4.594,5.921,6.775c0,1.53,0.884,3.185,2.242,4.037c-
3.222,0.865-
5.6,3.807-5.6,7.298c0,0.23,0.189,0.42,0.42,0.42h14.273c0.23,0,0.42-0.189,0.42-
0.42C17.676,14.619,15.297,11.677,12.075,10.812 M6.761,6.775c0-2.162,1.773-3.778,3.358-
3.778s3.359,1.616,3.359,3.778c0,2.162-1.774,3.778-3.359,3.778S6.761,8.937,6.761,6.775
M3.415,17.69c0.218-3.51,3.142-6.297,6.704-
6.297c3.562,0,6.486,2.787,6.705,6.297H3.415z"></path>
</svg>
<input type="username" class="user-input" placeholder="Full name">
</div>
<div class="email">
<svg class="svg-icon" viewBox="0 0 20 20">
<!-- Email icon path -->
<path d="M17.388,4.751H2.613c-0.213,0-0.389,0.175-
0.389,0.389v9.72c0,0.216,0.175,0.389,0.389,0.389h14.775c0.214,0,0.389-0.173,0.389-
0.389v-9.72C17.776,4.926,17.602,4.751,17.388,4.751
M16.448,5.53L10,11.984L3.552,5.53H16.448zM3.002,6.081l3.921,3.925l-
3.921,3.925V6.081z M3.56,14.471l3.914-
3.916l2.253,2.253c0.153,0.153,0.395,0.153,0.548,0l2.253-2.253l3.913,3.916H3.56z
M16.999,13.931l-3.921-3.925l3.921-3.925V13.931z"></path>
52
</svg>
<input type="email" class="email-id" placeholder="[email protected]">
</div>
</svg>
<input type="password" class="pass-input" placeholder="password"
id="passwordInput">
<!-- Eye icon for viewing password -->
<i class="eye-icon" id="togglePassword">
<svg class="svg-icon" viewBox="0 0 20 20" width="20" height="20">
<path fill="none" d="M0 0h20v20H0z"/>
<path d="M10 5C6.691 5 4 7.691 4 11s2.691 6 6 6 6-2.691 6-6-2.691-6-6-
6zM8 11c0-1.105.895-2 2-2s2 .895 2 2-.895 2-2 2-2-.895-2-2zm9-1l-3 3-1-1-1 1 2 2 4-4-1-
1z"/>
</svg>
</i>
</div>
<br/>
</svg>
<input type="password" class="confirm-pass-input" placeholder="confirm
password">
<!-- Eye icon for viewing password -->
<i class="eye-icon" id="toggleConfirmPassword">
<svg class="svg-icon" viewBox="0 0 20 20" width="20" height="20">
<path fill="none" d="M0 0h20v20H0z"/>
<path d="M10 5C6.691 5 4 7.691 4 11s2.691 6 6 6 6-2.691 6-6-2.691-6-6-
6zM8 11c0-1.105.895-2 2-2s2 .895 2 2-.895 2-2 2-2-.895-2-2zm9-1l-3 3-1-1-1 1 2 2 4-4-1-
1z"/>
</svg>
</i>
</div>
</div>
<button class="signup-button" id="signup-btn">Sign Up</button>
<div class="link">
<p>Already have an account? <a href="login.html">Login</a></p>
</div>
</div>
<!-- Add jQuery for AJAX functionality -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function () {
// Function to toggle password visibility
function togglePasswordVisibility(inputField, eyeIcon) {
var type = inputField.attr('type') === 'password' ? 'text' : 'password';
inputField.attr('type', type);
eyeIcon.toggleClass('fa-eye fa-eye-slash');
}
$('#toggleConfirmPassword').click(function ()
{ togglePasswordVisibility($('.confirm-pass-input'), $
(this));
});
$('#signup-btn').click(function (e) {
54
e.preventDefault(); // Prevent default form submission
55
// Get form data
var name = $('.user-input').val();
var email = $('.email-id').val();
var password = $('.pass-input').val();
var confirmPassword = $('.confirm-pass-input').val();
56
signup.php
<?php
session_start(); // Start session at the beginning
if ($stmt->execute()) {
// Redirect to secquestion.html upon successful registration
$_SESSION['email'] = $email;
header("Location: secquestion.html");
exit();
} else {
echo "Error: " . $stmt->error;
}
$stmt->close();
$conn->close();
?>
styles.css
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
57
background-color: #f0f0f0; /* Light gray background */
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
h1 {
text-align: center;
color: #333;
}
.books
{ display:
grid;
grid-template-columns: repeat(auto-fit, minmax(200px,
1fr)); grid-gap: 20px;
margin-top: 20px;
}
.book {
background-color:
#fff; border-radius:
5px; padding: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.book img {
max-width: 100%;
height: auto;
border-radius:
5px;
margin-bottom: 10px;
}
.book h3
{ margin: 0;
font-size: 18px;
color: #333;
}
.book p
{ margin: 5px
58
0;
font-size: 14px;
59
color: #666;
}
.logout {
position: absolute;
top: 10px;
right: 10px;
}
.logout a
{ color: #fff;
background-color:
#f00; padding: 8px
12px; border-radius:
5px;
text-decoration: none;
}
.logout a:hover
{ background-color:
#d00;
}
60
4.1 Execution Flow
1. User Interaction:
• User accesses the web application and interacts with the User Interface.
2. Signup Process:
• User navigates to the Signup/Login Page.
• User provides Name, email, password, and confirm password.
• System stores the user's data in the Database, hashing the password
using MD5.
• User selects a security question or enters a custom question along
with answer.
3. Login Process:
• User inputs their email and password.
• System verifies the credentials in the Backend Server.
• If credentials are invalid, the system displays an error message on
the login page.
• If credentials are valid, the system redirects the user to the Home Page.
4. Home Page Display:
• User views books and filter options based on genre and author on
the Home Page.
5. Password Recovery:
• User clicks on the Password Recovery option on the login page.
6. Email Verification:
• System verifies the user's email.
7. Security Question Verification:
• The security question selected or entered during registration will be
displayed and user should answer it correctly to go for next step in
the password recovery.
8. OTP Generation:
• System generates an 8-digit alpha-numeric OTP and sends it to the user's
61
email.
9. OTP Entry:
• User enters the OTP within a 30-second time limit.
10. OTP Verification:
• System verifies the entered OTP.
• If OTP entry is incorrect or time limit is exceeded, the system ends
the process.
• If OTP entry is correct, the system triggers the password
recovery process.
11. Password Recovery Process:
• System retrieves the original password hash from the Database.
• System uses a binary search algorithm to find the plaintext
password from a password recovery file or hash table.
• If the plaintext password is found, the system emails it to the user.
• If the plaintext password is not found, the system sends an email with
the message "not able to recover the password."
4.2 Testing
During the testing phase, the password recovery mechanism for the online book reading
platform was validated for its reliability and security. When valid login credentials are
entered, users are successfully redirected to the home page, while incorrect credentials
trigger a popup stating "Invalid credentials." For the security question, correct answers lead
to an OTP being sent to the registered email, while incorrect answers display "Invalid
security answer." The OTP verification box, with a 30-second time frame, accepts correct
OTP entries to start the password recovery process; incorrect OTPs result in an "Invalid
OTP" popup. The password recovery service utilizes a binary search algorithm in
precomputed rainbow tables and a hash table of common passwords to retrieve the original
password, which is then presented to the user. Overall, the system accurately differentiates
between valid and invalid inputs, ensuring a secure and user-friendly experience.
62
CHAPTER - 5
TESTING AND RESULTS
In the above 5.1.1 figure users register to the website by giving the necessary details
on the signup page.
63
5.1.2 User Interface to select a Security Question
In the above 5.1.2 figure users select a security question or else give their own custom
question and answers it.
In the above 5.1.3 figure after successful registration users will be redirected to this Home
Page where they can read books.
64
5.1.4 Login and Password Recovery Interface
In the above 5.1.4 figure when users forget password, they click on Password Recovery
option in login page and then enters their registered email.
In the above 5.1.5 figure first users answer the security question and then verify OTP
sent to their registered email.
65
5.1.6 Password sent through email
In the above 5.1.6 figure users receive their password to their registered mail within 10
minutes if it is found in the hash table and then they can login with it.
In the above 5.1.7 figure home page is shown as the login is successful.
66
5.1.8 Invalid Credentials Popup
In the above 5.1.8 figure it shows a popup saying “Invalid Credentials” as the user entered
wrong email or password.
In the above 5.1.10 figure it shows a popup saying “Invalid OTP” as the user entered wrong
OTP.
68
5.2 Results Analysis
5.2.1 Time Complexity:
1. Feature Extraction:
Directory Iteration: Assuming there are n files in the directory, iterating through the
directory takes O(n) time.
File Reading and Hashing:
For each file, reading all lines takes O(m) time, where m is the number of lines in
a file.
Hashing each line takes O(1) time (since hashing a single string is O(1)).
Writing the hashed lines to the output file also takes O(1) per line.
Overall Time Complexity:
Let n be the number of files and m be the average number of lines per file.
Total time complexity: O(n * m).
3. Binary Search:
Searching for a hash value in the sorted list of hashed passwords involves a binary search.
The time complexity of binary search is O(log m), where m is the number of hashed
passwords in the file.
Overall Time Complexity:
Let m be the number of hashed passwords in the file.
Total time complexity: O(log m).
69
5.2.2 Space Complexity:
1. Feature Extraction:
Storing the hashed lines in hashTheWords.txt: O(m), where m is the total number of
lines across all files.
No significant additional space is used aside from the input and output files.
Overall Space Complexity: O(m).
3. Binary Search:
Storing the hashed passwords in memory for performing binary search: O(m), where m
is the number of hashed passwords in the file.
No significant additional space is used aside from the input parameters and the contents
of the text file.
Overall Space Complexity: O(m).
70
5.2.3 Results Summary
Furthermore, the incorporation of error handling features, such as popup messages for
invalid credentials or errors during the recovery process, improves the robustness of the
system. These error messages provide clear feedback to users, enabling them to rectify
issues promptly and continue with their authentication journey seamlessly.
By prioritizing both security and user experience, the project establishes a strong
foundation for safeguarding user accounts while ensuring a positive interaction with
the authentication system. This balance between security and usability is essential for
fostering trust and confidence among users, ultimately contributing to the success and
reliability of the application.
71
CHAPTER - 6
CONCLUSION AND FUTURE SCOPE
6.1 CONCLUSION:
The development and implementation of a secure password recovery mechanism for online
book reading platforms represent a crucial step towards enhancing user experience and data
security in the digital realm. By integrating advanced technologies such as RainbowCrack
and OTP-based verification, the proposed solution not only streamlines the password
recovery process but also fortifies the platform against potential cyber threats. Through
rigorous feasibility analysis and performance evaluation, it is evident that the system
achieves its objectives of reliability, efficiency, and user-friendliness.
Moreover, the successful execution of this project underscores the importance of proactive
measures in mitigating cybersecurity risks and ensuring user trust in online services.
Moving forward, ongoing research and innovation will be essential in refining the proposed
mechanism, adapting to evolving security challenges, and incorporating emerging
technologies to bolster data protection further.
Ultimately, the implementation of a robust password recovery system not only safeguards
user accounts but also fosters a secure and conducive environment for online interaction and
engagement. As technology continues to evolve, continued vigilance and adaptation will be
paramount in maintaining the integrity and resilience of online platforms in the face of ever-
evolving cyber threats.
72
6.2 FUTURE SCOPE:
There are various avenues for enhancing and expanding the secure password recovery
mechanism for the online book reading platform:
Enhanced User Verification Techniques: Delve into the incorporation of supplementary user
verification methods, like biometric authentication or multi-factor authentication (MFA), to
fortify the security of the password recoveryprocedure.
Machine Learning for Anomaly Detection: Investigate the application of machine learning
algorithms for identifying anomalies during the password recovery process. This could
entail detecting suspicious login attempts or unauthorized access patterns to bolster threat
detection capabilities.
Extension of Rainbow Table Length: Assess the feasibility of elongating the length of
passwords in rainbow tables generated via RainbowCrack. Expanding the length of
precomputed tables can improve the coverage and accuracy of hash value retrieval during
password recovery, thereby enhancing the likelihood of successful password retrieval.
Augmentation of Common Passwords Hash Table: Consider expanding the existing hash
table of common passwords by adding more entries. Including a wider range of frequently
used passwords can broaden the range of hash value matches and boost the success rate of
password recovery attempts.
73
REFERENCES:
[1] C. M. Frenz, "Improving Organizational Password Policy Compliance via Open
Source Tools," in 2011 IEEE World Congress on Services, USA, 2011.
[4] 2012 linkedin breach just got a lot worse: 117 million new logins for sale (Last
checked April 2018).
[6] Barton, B.F., Barton, M.S.: User-friendly password methods for computer-
mediated information systems. Comput. Secur. 3(3), 186–195 (1984).
[7] Reeder, R., Schechter, S.: When the password doesn’t work:Secondary
authentication for websites. IEEE Security & Privacy 9(2), 43–49 (2011).
74
PUBLICATION
SECURE PASSWORD RECOVERY MECHANISM FOR ONLINE BOOK
READING PLATFORM
Mrs. B. Swetha
Assistant
professor
Cyber Security, Malla Reddy University
VIII. REFERENCES
68
Weblink Of the Project:
https://github.com/smdr9999/Secure-Password-Recovery-Mechanism-for-Online-
Book-Reading-Platform
69