Final
Final
INTRODUCTION
In an increasingly digital world, securing access to online resources and ensuring
that only authorized users can reach specific web content is paramount. This project
addresses this need by combining the convenience of QR codes with a password-protected
authentication system, ultimately guiding users to an actual website upon successful
verification. By leveraging Python and its built-in qrcode module for QR code generation,
along with HTML and JavaScript for web-based interactions, this project offers a robust
solution for controlled access to web content.
The core of the project involves generating a QR code that, when scanned, redirects users
to a password-protected page. This page, implemented in HTML and JavaScript, requires
users to enter a password. If the password is correct, users are redirected to the intended
website, ensuring that only those with the correct credentials can access the content.
While the current implementation uses client-side password validation for simplicity, it
sets the stage for potential enhancements. Future iterations can include server-side
password verification, database integration for user management, multi-factor
authentication (MFA), and other advanced security measures.
This project showcases how the combination of QR code technology and web-based
authentication can provide a secure and user-friendly method for controlling access to
online resources, balancing ease of use with robust security measures.
1
1.1 Problem Definition
In the digital age, ensuring secure access to online resources is a critical concern for both
individuals and organizations. Traditional methods of access control, such as password-
protected pages, are often vulnerable to unauthorized access if not implemented correctly.
Additionally, the ease with which sensitive URLs can be shared or accessed without proper
authorization further complicates the security landscape. The challenge is to create a
system that combines convenience and security, providing controlled access to web content
in a user-friendly manner.
The objective of this project is to create a secure and user-friendly system for
accessing web content using QR codes and password protection. The project will generate
QR codes with Python, which link to a password-protected page. Users must enter the correct
password to access the actual website. The system is designed to be intuitive, with clear
instructions, and is scalable for future enhancements such as server-side validation and
multi-factor authentication.
2
1.3 Limitation of Project
• Limited Scalability and Database Integration: The project does not support large-scale
applications or integrate with a database for managing user credentials and access logs.
3
2. SYSTEM ANALYSIS
Existing systems for web access control often use static password protection and
URLs. Authentication is typically handled on the server side, and QR codes, when used, are
static and do not incorporate advanced security features. This project aims to improve upon
these methods by combining QR code technology with a password-protected page for
enhanced security and a better user experience.
2.1.1 Disadvantages
2.2.1 Advantages
It deals with defining software resource requirements and prerequisites that need to
be installed on a computer to provide optimal functioning of an application. These
requirements or prerequisites are generally not included in the software installation package
and need to be installed separately before the software is installed. The software
requirements are a description of features and functionalities of the target system.
4
1. Python: Programming language used for QR code generation.
o Version: 3.x
2. qrcode Library: Python library for generating QR codes.
o Installation: pip install qrcode[pil]
3. HTML/CSS: Markup and styling languages for creating web pages.
4. JavaScript: Scripting language for client-side password validation and user
interaction.
5. Web Browser: For testing and accessing the web pages.
o Examples: Google Chrome, Mozilla Firefox, Microsoft Edge
6. Text Editor or IDE: For writing and editing code.
o Examples: Visual Studio Code, PyCharm, Sublime Text
7. Web Server: Optional, for serving the web pages locally or on a network.
o Examples: Apache, Nginx, or Python's built-in HTTP server (http.server)
8. Operating System: The project can be developed and run on any operating system
that supports Python and web development.
o Examples: Windows, macOS, Linux
Requirement’s analysis is very critical process that enables the success of a system or
software project to be assessed. Requirements are generally split into two types: Functional
and non-functional requirements.
Functional Requirements
These are the requirements that the end user specifically demands as basic facilities that
the system should offer. All these functionalities need to be necessarily incorporated into the
system as a part of the contract. These are represented or stated in the form of input to be
given to the system, the operation performed and the output expected. They are basically the
requirements stated by the user which one can see directly in the final product, unlike the
non-functional requirements.
Functional requirements of this project are:
• QR Code Generation
• Password-Protected Page
5
• Dynamic URL Handling
• Access Control
Non-functional requirements
These are basically the quality constraints that the system must satisfy according to the
project contract. The priority or extent to which these factors are implemented varies from
one project to other. They are also called non-behavioural requirements.
• Portability
• Security
• Maintainability
• Reliability
• Scalability
• Performance
• Reusability
The most common set of requirements defined by any operating system or software
application is the physical computer resources, also known as hardware, a hardware
requirements list is often accompanied by a hardware compatibility list (HCL), especially in
case of operating systems. An HCL lists tested, compatible, and sometimes incompatible
hardware devices for a particular operating system or application.
6
2.5 Content Diagram
7
3. IMPLEMENTATION
The more complex the system being implemented, the more involved will be the
systems analysis and design efforts required for implementation. The implementation phase
comprises of several activities. The required hardware and software acquisition is carried
out. The system may require some software to be developed. For this, programs are written
and tested. The user then change over to his new fully tested system and the old system is
discontinued.
1. Python
2. qrcode
3. html
4. javascript
5. css
1. Python
8
• Python is Object-Oriented
• Python is a Beginner's Language
2. qrcode
The qrcode module in Python is a handy library for generating QR codes (Quick Response
Codes).
• Creates QR codes that can store text, URLs, and even small amounts of data.
• Offers options to customize the size, error correction level, and appearance of the
QR code.
• Converts the QR code information into a usable image file (PNG by default).
3. HTML
HTML, which stands for Hyper Text Markup Language, is the fundamental building block
for web pages. It's not a programming language, but rather a markup language that uses
tags to define the structure and content of a web page.
• Creates the skeleton of a web page, defining elements like headings, paragraphs,
lists, images, links, and more.
• Doesn't control the visual appearance (CSS handles that).
• Provides a way to structure information for browsers to interpret and display.
4.Java Script
9
• Server-side scripting: Node.js allows JS to be used for server-side development,
handling backend logic and data access.
5.CSS
CSS stands for Cascading Style Sheets. It's a language specifically designed to style the
presentation of a web page, separate from the content itself. Here's a quick breakdown of
what CSS offers:
• Styling Elements: CSS allows you to define styles for different HTML elements
like headings, paragraphs, lists, buttons, and more. You can control their
appearance using properties like:
o Font: Family, size, color, weight
o Background: Color, image
o Borders: Style, width, color
o Margins: Spacing around elements
o Padding: Space within elements
• Responsiveness: CSS can be used to create responsive websites that adapt their
layout to different screen sizes (desktop, mobile, tablet) by using media queries.
1. Generate QR Code:
o Import qrcode and other necessary modules.
o Set up the QR code with parameters for version, error correction, etc.
o Encode the URL and generate the QR code image.
o Save the QR code image to a file.
2. Create Password-Protected Page:
o Write HTML for user interface (input for password and submit button).
o Style the page with CSS for better presentation.
o Implement JavaScript to handle password verification and redirection.
3. Deploy and Test:
o Upload the HTML file to your web server.
o Generate the QR code and distribute it.
10
o Test the entire flow from scanning the QR code to accessing the password-
protected page and verifying password functionality.
import qrcode
11
3.3.2 Protected Page HTML
A password-protected page where users must enter the correct password to access the
actual website.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Protected Page</title>
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
.container {
text-align: center;
input {
margin: 10px;
12
padding: 10px;
font-size: 16px;
button {
font-size: 16px;
.message {
margin-top: 20px;
color: red;
</style>
</head>
<body>
<div class="container">
<button onclick="checkPassword()">Submit</button>
</div>
<script>
function checkPassword() {
13
const targetUrl = 'https://www.example.com'; // Replace with the target URL
window.location.href = targetUrl;
} else {
</script>
</body>
</html>
1. QR Code Generation:
o Run the Python script to generate the QR code image. This image should be
distributed or displayed where users can scan it.
2. Protected Page Hosting:
o Host the protected_page.html file on a web server. Ensure the page is
accessible through the URL embedded in the QR code.
3. Testing:
o Test the QR code scanning process and password verification to ensure the
system redirects users correctly upon entering the correct password.
4. Distribution:
o Share or display the QR code where intended, and ensure that users know
the QR code leads to a password-protected page.
14
4. OUTPUT SCREENSHOTS
4.1 QR CODE:
4.1 QR CODE
15
4.3 Password-Protected Page:
After entering the correct password it redirects to the website else provides incorrect
password message.
16
4.4 Actual Website:
17
5. CONCLUSION AND FUTURE ENHANCEMENT
5.1 Project Conclusion
The project effectively integrates QR code generation with password-protected web access,
offering a blend of security and convenience. Utilizing Python’s qrcode module, we created
a QR code that directs users to a password-protected page. On this page, JavaScript manages
password verification, ensuring that only users with the correct password can access the
target website. This method streamlines the process of accessing secure content by reducing
the need for manual URL entry.
Overall, the project highlights a practical use of QR codes for enhancing digital security
while providing a user-friendly experience. Future improvements could involve
implementing multi-factor authentication and dynamic QR codes to further bolster security.
This approach demonstrates how combining QR codes with password protection can
effectively manage secure access in a web-based environment.
Future enhancements for this project could focus on several areas to improve
security, usability, and functionality:
• Access Control Levels: Implement varying access levels for different user roles to
manage content visibility and permissions more effectively.
• User Management and Logging: Introduce user management systems and logging
features for better account management and monitoring of access patterns.
18
6. REFERENCES
• https://pypi.org/project/qrcode/
• https://www.w3schools.com/html/
• https://www.geeksforgeeks.org/javascript/
• https://web.dev/learn/css/
• https://github.com/
• https://chatgpt.com/
19
20